The Dify connector lets your AI agent act in each user's Dify account. Each user connects their own Dify access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 26 tools.
- Tools
- 26
- What they doRead · write · destructive
- 14 · 10 · 214 read10 write2 destructive
- Users sign in with
- Access token
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret>Create the Dify connection
In AgentKit > Connections, create a Dify connection. The name you give it is the
connection_nameyour code passes. See Configure connections.Authorize a user and make your first call
quickstart.mts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'import { createInterface } from 'node:readline/promises'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENVIRONMENT_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET,)const actions = scalekit.actionsconst connector = 'dify'const identifier = 'user_123'// Generate an authorization link for the userconst { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })console.log('Authorize Dify:', link)const rl = createInterface({ input: process.stdin, output: process.stdout })await rl.question('Press Enter after authorizing...')rl.close()// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'dify_annotations_list',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "dify"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize Dify:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="dify_annotations_list",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach user opens the link once and enters their Dify credentials there. See Authorize a user for the full flow and statuses.
Tools
Pass the exact name toexecute_tooldify_annotation_reply_status_getGet the status of an annotation reply enable or disable job.Read-onlyGet Annotation Reply Job Status
Get the status of an annotation reply enable or disable job. Returns job_id, job_status (waiting, processing, completed, error) and error_msg. Use this after dify_annotation_reply_configure.
Inputs
actionstringrequired- The action of the job: enable or disable. Example: enable.one of
enabledisable job_idstringrequired- Job ID returned by dify_annotation_reply_configure. Example: b15c8f68-1cf4-4877-bf21-ed7cf2011802.
dify_annotations_listList the app's annotations (saved question-answer pairs the app replies with directly when a question matches).Read-onlyList Annotations
List the app's annotations (saved question-answer pairs the app replies with directly when a question matches). Returns data with each annotation's id, question, answer, hit_count and created_at, plus paging. Use this to find an annotation ID.
Inputs
keywordstring- Only annotations whose question or answer contains this text. Example: refund.
limitinteger- Items per page, up to 100. Defaults to 20. Example: 20.
pageinteger- Page number. Defaults to 1. Example: 1.
dify_app_feedbacks_listList all likes, dislikes and comments on the app's messages, from end users and admins.Read-onlyList App Feedback
List all likes, dislikes and comments on the app's messages, from end users and admins. Returns data with each feedback's message_id, rating, content, source and created_at. Use this to review answer quality.
Inputs
limitinteger- Items per page. Defaults to 20. Example: 20.
pageinteger- Page number. Defaults to 1. Example: 1.
dify_app_info_getGet basic information about the Dify app this API key belongs to.Read-onlyGet App Info
Get basic information about the Dify app this API key belongs to. Returns name, description, tags, mode (chat, agent-chat, advanced-chat, workflow or completion) and author_name. Use this first to know which run tool fits the app.
Inputs
This tool takes no inputs.
dify_app_meta_getGet the display icons of the tools the app uses.Read-onlyGet App Meta
Get the display icons of the tools the app uses. Returns tool_icons keyed by tool name. Use this only when you need tool icons.
Inputs
This tool takes no inputs.
dify_app_parameters_getGet the app's input form and feature settings.Read-onlyGet App Parameters
Get the app's input form and feature settings. Returns opening_statement, suggested_questions, user_input_form (the input variables with their types and options), file upload limits and feature toggles. Use this to build the inputs object for the run and send tools.
Inputs
This tool takes no inputs.
dify_app_site_getGet the branding and display settings of the app's hosted web app.Read-onlyGet App Web Settings
Get the branding and display settings of the app's hosted web app. Returns title, icon, theme color, description, copyright, privacy policy and default language. Use this to mirror the app's branding.
Inputs
This tool takes no inputs.
dify_conversation_variables_listList the variables stored in a conversation (Chatflow and Chatbot apps).Read-onlyList Conversation Variables
List the variables stored in a conversation (Chatflow and Chatbot apps). Returns data with each variable's id, name, value_type, value and description, plus has_more. Use this to read conversation memory. Use dify_conversation_variable_update to change a value.
Inputs
conversation_idstringrequired- Conversation ID, from dify_conversations_list or a chat response. Example: 45701982-8118-4bc5-8e9b-64562b4555f2.
last_idstring- Paging cursor: the id of the last variable on the previous page. Example: 3c5d7e9f-1a2b-4c6d-8e0f-2a4b6c8d0e1f.
limitinteger- Items per page. Defaults to 20. Example: 20.
userstring- End-user identifier you choose. Lists only that user's data. Example: user-123.
variable_namestring- Only the variable with this name. Example: customer_tier.
dify_conversations_listList an end user's conversations in a chat app, most recently active first.Read-onlyList Conversations
List an end user's conversations in a chat app, most recently active first. Returns data with each conversation's id, name, inputs, status and timestamps, plus has_more and limit. Use this to resume a conversation. Use dify_messages_list for its messages.
Inputs
last_idstring- Paging cursor: the id of the last conversation on the previous page. Example: 45701982-8118-4bc5-8e9b-64562b4555f2.
limitinteger- Items per page. Defaults to 20. Example: 20.
sort_bystring- Sort field; prefix - for descending. Defaults to -updated_at. Example: -updated_at.one of
created_at-created_atupdated_at-updated_at userstring- End-user identifier you choose. Lists only that user's data. Example: user-123.
dify_end_user_getGet an end user's details by Dify end-user ID.Read-onlyGet End User
Get an end user's details by Dify end-user ID. Returns the end user's id, type, session_id (your user identifier) and timestamps. Use this to resolve an end-user ID returned by another call.
Inputs
end_user_idstringrequired- Dify end-user ID, as returned in conversation or log data. Example: a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d.
dify_message_suggested_questions_getGet the follow-up questions Dify suggests after a message.Read-onlyGet Suggested Questions
Get the follow-up questions Dify suggests after a message. Returns data, a list of suggested question strings (empty when none). Use this to offer next questions in a chat.
Inputs
message_idstringrequired- Message ID, from dify_messages_list or a chat response. Example: 9da23599-e713-473b-982c-4328d4f5c78a.
userstringrequired- End-user identifier you choose. Lists only that user's data. Example: user-123.
dify_messages_listGet a conversation's message history, newest first.Read-onlyList Conversation Messages
Get a conversation's message history, newest first. Returns data with each message's id, query, answer, feedback, attached files and created_at, plus has_more. Pass first_id to page back to older messages.
Inputs
conversation_idstringrequired- Conversation to read, from dify_conversations_list. Example: 45701982-8118-4bc5-8e9b-64562b4555f2.
first_idstring- Paging cursor: the id of the first (oldest) message on the current page, to get older ones. Example: 9da23599-e713-473b-982c-4328d4f5c78a.
limitinteger- Messages to return. Defaults to 20. Example: 20.
userstring- End-user identifier you choose. Lists only that user's data. Example: user-123.
dify_workflow_logs_listList past workflow runs of the app, newest first, with filters.Read-onlyList Workflow Logs
List past workflow runs of the app, newest first, with filters. Returns data with each run's id, status, error, elapsed time, tokens, steps and creator, plus page, limit, total and has_more. Use this to audit or debug runs. Use dify_workflow_run_get for one run's outputs.
Inputs
created_at_afterstring- Only runs created after this ISO 8601 time. Example: 2026-11-01T00:00:00Z.
created_at_beforestring- Only runs created before this ISO 8601 time. Example: 2026-11-30T23:59:59Z.
created_by_accountstring- Only runs started by this Dify account email. Example: name@example.com.
created_by_end_user_session_idstring- Only runs started by this end-user session ID. Example: user-123.
keywordstring- Text to search for in the logs. Example: invoice.
limitinteger- Items per page. Defaults to 20. Example: 20.
pageinteger- Page number. Defaults to 1. Example: 1.
statusstring- Only runs with this result. Example: failed.one of
succeededfailedstopped
dify_workflow_run_getGet one workflow run's status, inputs, outputs and metrics.Read-onlyGet Workflow Run
Get one workflow run's status, inputs, outputs and metrics. Returns id, workflow_id, status (running, succeeded, failed, stopped), inputs, outputs, error, total_steps, total_tokens, created_at and finished_at. Use this for Workflow and Chatflow apps.
Inputs
workflow_run_idstringrequired- Workflow run ID, from dify_workflow_run or dify_workflow_logs_list. Example: fb47b2e6-5e3b-4c8e-9a43-2f5e7d0c1a9b.
dify_annotation_createAdd an annotation: a question and the exact answer the app should return when a user asks something matching.WriteCreate Annotation
Add an annotation: a question and the exact answer the app should return when a user asks something matching. Returns the new annotation with its id. Annotation reply must be enabled (dify_annotation_reply_configure) for it to be used.
Inputs
answerstringrequired- Answer to return. Example: You can request a full refund within 30 days.
questionstringrequired- Question to match. Example: What is your refund policy?.
dify_annotation_reply_configureTurn annotation reply on or off for the app, with the embedding model and match threshold.WriteConfigure Annotation Reply
Turn annotation reply on or off for the app, with the embedding model and match threshold. Runs as a background job. Returns job_id and job_status. Check progress with dify_annotation_reply_status_get.
- Idempotent
Inputs
actionstringrequired- enable or disable. Example: enable.one of
enabledisable embedding_model_namestringrequired- Embedding model used to match questions. Example: text-embedding-3-small.
embedding_provider_namestringrequired- Embedding model provider. Example: openai.
score_thresholdnumberrequired- Minimum similarity (0 to 1) for an annotation to match. Example: 0.9.
dify_annotation_updateReplace an annotation's question and answer.WriteUpdate Annotation
Replace an annotation's question and answer. Returns the updated annotation. Send both fields.
- Idempotent
Inputs
annotation_idstringrequired- Annotation ID from dify_annotations_list. Example: 69d48372-ad81-4c75-9c46-2ce197b4d402.
answerstringrequired- New answer. Example: Refunds are available within 45 days.
questionstringrequired- New question. Example: What is your refund policy?.
dify_chat_message_sendSend a user message to a Dify chat app (Chatbot, Chatflow or Agent) and wait for the full reply.WriteSend Chat Message
Send a user message to a Dify chat app (Chatbot, Chatflow or Agent) and wait for the full reply. Returns answer, conversation_id, message_id, metadata (token usage, retriever resources) and created_at. Send the returned conversation_id with the next message to continue the conversation. Agent apps that only stream may reject blocking calls.
Inputs
inputsobjectrequired- Values for the app's input variables, keyed by variable name. Get the names and types from user_input_form in dify_app_parameters_get. Send {} when the app has none. Example: {"topic": "pricing"}
querystringrequired- The user's message. Example: What are your support hours?.
userstringrequired- End-user identifier you choose, unique within your app. Conversations, messages and files are only visible to calls with the same user. Example: user-123.
auto_generate_nameboolean- Generate a conversation title automatically. Defaults to true. Example: true.
conversation_idstring- Conversation to continue. Leave out to start a new one. Example: 45701982-8118-4bc5-8e9b-64562b4555f2.
filesarray- Files to attach, each with type (image, document, audio, video), transfer_method remote_url and url. Only for apps whose model accepts files. Example: [{"type": "image", "transfer_method": "remote_url", "url": "https://example.com/photo.png"}]
workflow_idstring- Chatflow apps only: published workflow version to run instead of the latest. Example: b6e9c6f4-3a0e-4f7a-9c1d-2e8b7a6c5d4e.
dify_completion_message_sendRun a Dify Text Generator app once with the given inputs and wait for the generated text.WriteSend Completion Message
Run a Dify Text Generator app once with the given inputs and wait for the generated text. Returns answer, message_id, metadata (token usage) and created_at. Use this for text generator apps. Use dify_chat_message_send for chat apps and dify_workflow_run for workflow apps.
Inputs
inputsobjectrequired- Values for the app's input variables, keyed by variable name. Get the names and types from user_input_form in dify_app_parameters_get. Send {} when the app has none. Example: {"topic": "pricing"}
userstringrequired- End-user identifier you choose, unique within your app. Conversations, messages and files are only visible to calls with the same user. Example: user-123.
filesarray- Files to attach, each with type (image, document, audio, video), transfer_method remote_url and url. Only for apps whose model accepts files. Example: [{"type": "image", "transfer_method": "remote_url", "url": "https://example.com/photo.png"}]
querystring- Text to process, for older apps that take it outside inputs. Example: Summarize this paragraph...
dify_conversation_renameRename a conversation, or let Dify generate a name from its messages.WriteRename Conversation
Rename a conversation, or let Dify generate a name from its messages. Returns the conversation with its new name. Send name, or auto_generate true.
- Idempotent
Inputs
conversation_idstringrequired- Conversation ID, from dify_conversations_list or a chat response. Example: 45701982-8118-4bc5-8e9b-64562b4555f2.
auto_generateboolean- Generate the name automatically; name is then ignored. Example: false.
namestring- New name. Needed unless auto_generate is true. Example: Pricing questions.
userstring- End-user identifier you choose, unique within your app. Conversations, messages and files are only visible to calls with the same user. Example: user-123.
dify_conversation_variable_updateSet a conversation variable's value.WriteUpdate Conversation Variable
Set a conversation variable's value. The value must match the variable's type. Returns the updated variable. Use dify_conversation_variables_list to find variable IDs and types.
- Idempotent
Inputs
conversation_idstringrequired- Conversation ID, from dify_conversations_list or a chat response. Example: 45701982-8118-4bc5-8e9b-64562b4555f2.
valuestringrequired- New value, of the variable's type (string, number, object or array). Example: gold.
variable_idstringrequired- Variable ID from dify_conversation_variables_list. Example: 3c5d7e9f-1a2b-4c6d-8e0f-2a4b6c8d0e1f.
userstring- End-user identifier you choose, unique within your app. Conversations, messages and files are only visible to calls with the same user. Example: user-123.
dify_message_feedback_submitLike or dislike a message, with an optional comment, or revoke earlier feedback.WriteSubmit Message Feedback
Like or dislike a message, with an optional comment, or revoke earlier feedback. Returns result success. Set rating to null to remove feedback. The user must be the one who received the message.
- Idempotent
Inputs
message_idstringrequired- Message ID, from dify_messages_list or a chat response. Example: 9da23599-e713-473b-982c-4328d4f5c78a.
userstringrequired- End-user identifier you choose, unique within your app. Conversations, messages and files are only visible to calls with the same user. Example: user-123.
contentstring- Optional text feedback. Example: Very helpful, thanks.
ratingstring- like or dislike; null revokes earlier feedback. Example: like.one of
likedislike
dify_workflow_runRun a Dify Workflow app's published workflow with the given inputs and wait for it to finish.WriteRun Workflow
Run a Dify Workflow app's published workflow with the given inputs and wait for it to finish. Returns workflow_run_id, task_id and data with status, outputs, error, elapsed_time and total_tokens. Use dify_workflow_run_get to read a run later. Use dify_workflow_run_by_id to run a specific version.
Inputs
inputsobjectrequired- Values for the app's input variables, keyed by variable name. Get the names and types from user_input_form in dify_app_parameters_get. Send {} when the app has none. Example: {"topic": "pricing"}
userstringrequired- End-user identifier you choose, unique within your app. Conversations, messages and files are only visible to calls with the same user. Example: user-123.
filesarray- Files to attach, each with type (image, document, audio, video), transfer_method remote_url and url. Only for apps whose model accepts files. Example: [{"type": "image", "transfer_method": "remote_url", "url": "https://example.com/photo.png"}]
dify_workflow_run_by_idRun a specific published version of a Dify Workflow app's workflow and wait for it to finish.WriteRun Workflow Version
Run a specific published version of a Dify Workflow app's workflow and wait for it to finish. Returns workflow_run_id, task_id and data with status, outputs, error and timings. Use dify_workflow_run to run the latest published version.
Inputs
inputsobjectrequired- Values for the app's input variables, keyed by variable name. Get the names and types from user_input_form in dify_app_parameters_get. Send {} when the app has none. Example: {"topic": "pricing"}
userstringrequired- End-user identifier you choose, unique within your app. Conversations, messages and files are only visible to calls with the same user. Example: user-123.
workflow_idstringrequired- Published workflow version ID, from a previous run's workflow_id or dify_workflow_run_get. Example: b6e9c6f4-3a0e-4f7a-9c1d-2e8b7a6c5d4e.
filesarray- Files to attach, each with type (image, document, audio, video), transfer_method remote_url and url. Only for apps whose model accepts files. Example: [{"type": "image", "transfer_method": "remote_url", "url": "https://example.com/photo.png"}]
dify_annotation_deleteDelete an annotation and its hit history.DestructiveDelete Annotation
Delete an annotation and its hit history. Returns no content on success. Use dify_annotations_list to find IDs.
- Idempotent
Inputs
annotation_idstringrequired- Annotation ID from dify_annotations_list. Example: 69d48372-ad81-4c75-9c46-2ce197b4d402.
dify_conversation_deleteDelete a conversation.DestructiveDelete Conversation
Delete a conversation. Returns no content on success. Use dify_conversations_list to find IDs.
- Idempotent
Inputs
conversation_idstringrequired- Conversation ID, from dify_conversations_list or a chat response. Example: 45701982-8118-4bc5-8e9b-64562b4555f2.
userstring- End-user identifier you choose, unique within your app. Conversations, messages and files are only visible to calls with the same user. Example: user-123.
No tools match.