Run an agent as a step in your workflow, reasoning and using tools to complete a task
Classic Agent
New Agent
The classic Agent node gives your LLM autonomous control over tools, enabling it to iteratively decide which tools to use and when to use them. Instead of pre-planning every step, the Agent reasons through problems dynamically, calling tools as needed to complete complex tasks.
Agent strategies define how your Agent thinks and acts. Choose the approach that best matches your model’s capabilities and task requirements.
Available Agent Strategy Options
Function Calling
ReAct (Reason + Act)
Uses the LLM’s native function calling capabilities to directly pass tool definitions through the tools parameter. The LLM decides when and how to call tools using its built-in mechanism.Best for models like GPT-4, Claude 3.5, and other models with robust function calling support.
Uses structured prompts that guide the LLM through explicit reasoning steps. Follows a Thought → Action → Observation cycle for transparent decision-making.Works well with models that may not have native function calling or when you need explicit reasoning traces.
Install additional strategies from Marketplace → Agent Strategies or contribute custom strategies to the community repository.
Choose an LLM that supports your selected agent strategy. More capable models handle complex reasoning better but cost more per iteration. Ensure your model supports function calling if using that strategy.
Configure the tools your Agent can access. Each tool requires:Authorization - API keys and credentials for external services configured in your workspaceDescription - Clear explanation of what the tool does and when to use it (this guides the Agent’s decision-making)Parameters - Required and optional inputs the tool accepts with proper validation
Define the Agent’s role, goals, and context using natural language instructions. Use Jinja2 syntax to reference variables from upstream workflow nodes.Query specifies the user input or task the Agent should work on. This can be dynamic content from previous workflow nodes.
Max Iterations sets a safety limit to prevent infinite loops. Configure based on task complexity - simple tasks need 3-5 iterations, while complex research might require 10-15.Memory controls how many previous messages the Agent remembers using TokenBufferMemory. Larger memory windows provide more context but increase token costs. This enables conversational continuity where users can reference previous actions.
Tools can have parameters configured as auto-generated or manual input. Auto-generated parameters (auto: false) are automatically populated by the Agent, while manual input parameters require explicit values that become part of the tool’s permanent configuration.
Agent nodes provide comprehensive output including:Final Answer - The Agent’s ultimate response to the queryTool Outputs - Results from each tool invocation during executionReasoning Trace - Step-by-step decision process (especially detailed with ReAct strategy) available in the JSON outputIteration Count - Number of reasoning cycles usedSuccess Status - Whether the Agent completed the task successfullyAgent Logs - Structured log events with metadata for debugging and monitoring tool invocations
Research and Analysis - Agents can autonomously search multiple sources, synthesize information, and provide comprehensive answers.Troubleshooting - Diagnostic tasks where the Agent needs to gather information, test hypotheses, and adapt its approach based on findings.Multi-step Data Processing - Complex workflows where the next action depends on intermediate results.Dynamic API Integration - Scenarios where the sequence of API calls depends on responses and conditions that can’t be predetermined.
Clear Tool Descriptions help the Agent understand when and how to use each tool effectively.Appropriate Iteration Limits prevent runaway costs while allowing sufficient flexibility for complex tasks.Detailed Instructions provide context about the Agent’s role, goals, and any constraints or preferences.Memory Management balance context retention with token efficiency based on your use case requirements.
The new Agent node is in beta and available in Workflow apps only.
The new Agent node runs an agent as one step of a workflow. Unlike the classic node’s model-with-tools setup, the agent arrives as a complete worker with its own capabilities and sandbox.You pick the agent and tell it what to do; it works through the task on its own and hands the results back to the rest of the flow.
You can invite any published agent: it arrives with its saved capabilities, and you set only its task here.An invited agent is like a full-time employee: its capabilities are managed centrally in Agents. When you publish an update there, every workflow that uses the agent gets it.
To edit its capabilities, click Edit in Agents.
If you want changes for this step only, click Make a copy: the node switches to a one-time copy that no longer follows the original.
Create a one-time agent that lives on this node alone, and configure it right here, the same way you build in Agents.It’s like a temp you bring in for one job. If it proves its worth, promote it to Agents to reuse it elsewhere.
You can always swap the agent later.
Two nodes that invite the same agent still work separately: each starts from the agent’s saved setup in its own sandbox, and nothing from one node’s run (files it wrote, tools it installed) carries into another.To pass results between nodes, declare them as outputs and reference them downstream.
In Agent task, describe what you need at this step, the way you’d brief a colleague on one job. This is separate from the agent’s own prompt and capabilities. Type / to pull in outputs from earlier nodes.Say you’ve invited a support agent that already knows your product docs and writes in your support tone, and the workflow hands it inbound customer emails. The task covers only this step:
Read the customer email in {{customer_email}} and draft a reply that answers every question in it. Keep it under 150 words.
Variables you pull in reach the agent as text and are truncated at 2,000 characters.To hand over longer content in full, pass it as a file: the agent receives the whole file and reads it in its sandbox.
By default, an Agent node returns a single output, text: the agent’s reply to its task, as one block of text. When a later step needs something more specific, like a single value or a particular file, declare it as its own output.Type / in the Agent task, choose New output, then name it and pick a type in place. Each declared output can be referenced by downstream nodes on its own.A declared output sits right in the task text, so you can tell the agent exactly what to put in it. For example, in this task {{vendor_name}} and {{quote_file}} are declared outputs:
Compare the three vendor quotes in {{vendor_quotes}} and write a recommendation. Put the winning vendor's name in {{vendor_name}} and its quote PDF in {{quote_file}}.
Each file the agent returns is capped at 50 MB.
Last modified on August 27, 2026
Was this page helpful?
⌘I
{"docsConfig":{"theme":"luma","$schema":"https://mintlify.com/docs.json","name":"Dify Docs","description":"Dify is an open-source platform for building AI applications. It provides a comprehensive set of tools and features to help you build, deploy, and manage your AI applications.","colors":{"primary":"#0060FF","light":"#688FE8","dark":"#0034FF"},"logo":{"light":"https://assets-docs.dify.ai/2025/05/d05cfc6ebe48f725d171dc71c64a5d16.svg","dark":"https://assets-docs.dify.ai/2025/05/c51f1cda47c1d9a4a162d7736f6e4c53.svg","href":"https://docs.dify.ai"},"favicon":"https://mintcdn.com/dify-6c0370d8/7ofzWAXbPyxqXN2g/logo/dify-logo.png?fit=max\u0026auto=format\u0026n=7ofzWAXbPyxqXN2g\u0026q=85\u0026s=1ff6cbe1000cf72c39ff756308a85823","navbar":{"links":[{"href":"https://github.com/langgenius/dify","label":"GitHub"}],"primary":{"type":"button","label":"Try Dify","href":"https://cloud.dify.ai"}},"footer":{"socials":{"x":"https://x.com/dify_ai","github":"https://github.com/langgenius/dify-docs","linkedin":"https://www.linkedin.com/company/langgenius"}},"integrations":{"ga4":{"measurementId":"G-HHGQ6GKNCE"}},"contextual":{"options":["copy","view","download-spec","claude","chatgpt","perplexity","mcp","add-mcp","cursor","vscode","devin-mcp"],"display":"header"},"metadata":{"timestamp":true},"styling":{"latex":false},"navigation":{"languages":[{"language":"en","default":true,"href":"en/cloud/use-dify/getting-started/introduction"},{"language":"zh","href":"zh/cloud/use-dify/getting-started/introduction"},{"language":"ja","href":"ja/cloud/use-dify/getting-started/introduction"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"dify-6c0370d8","hasAudioNarration":false,"actualSubdomain":"dify-6c0370d8","customDomains":["docs.dify.ai"],"gitSource":{"type":"github","owner":"langgenius","repo":"dify-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adaffc85acdd37854d01e9e","collectionId":"16feb855-ef63-49d4-8c80-bb506c2406aa","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adaffc85acdd37854d01e9e"},"feedback":{"thumbs":true,"edits":true,"issues":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6adaffc85acdd37854d01e9e","clientVersion":"0.0.3965","searchFilterCounts":[{"language":"en","tag":"Self-Host","count":267},{"language":"ja","tag":"セルフホスト","count":267},{"language":"zh","tag":"自部署","count":267},{"language":"en","tag":"Use","count":183},{"language":"ja","tag":"使い方","count":183},{"language":"zh","tag":"使用","count":183},{"language":"en","tag":"Developer Resources","count":165},{"language":"ja","tag":"開発者リソース","count":165},{"language":"zh","tag":"开发者资源","count":165},{"language":"en","tag":"Cloud","count":112},{"language":"ja","tag":"Cloud","count":112},{"language":"zh","tag":"Cloud","count":112},{"language":"en","tag":"API","count":93},{"language":"ja","tag":"API","count":93},{"language":"zh","tag":"API","count":93},{"language":"en","tag":"Orchestrate","count":80},{"language":"ja","tag":"オーケストレーション","count":80},{"language":"zh","tag":"编排","count":80},{"language":"en","tag":"Workflow \u0026 Chatflow","count":65},{"language":"ja","tag":"Workflow と Chatflow","count":65},{"language":"zh","tag":"Workflow 与 Chatflow","count":65},{"language":"zh","tag":"知识库","count":50},{"language":"en","tag":"Knowledge APIs","count":46},{"language":"ja","tag":"ナレッジ API","count":46},{"language":"zh","tag":"知识库 API","count":46},{"language":"en","tag":"Knowledge","count":44},{"language":"en","tag":"Nodes","count":44},{"language":"ja","tag":"ナレッジ","count":44},{"language":"ja","tag":"ノード","count":44},{"language":"zh","tag":"节点","count":44}],"searchSettings":{"maxResults":12}},"assistantConfig":{},"hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"body{text-autospace:normal}html[data-current-path=\"/\"] .nav-tabs,html[data-current-path=\"/en/home\"] .nav-tabs,html[data-current-path=\"/ja/home\"] .nav-tabs,html[data-current-path=\"/zh/home\"] .nav-tabs{display:none}#sidebar-content :has(>a[href=\"/en/home\"]),#sidebar-content :has(>a[href=\"/ja/home\"]),#sidebar-content :has(>a[href=\"/zh/home\"]),#sidebar-content a[href=\"/en/home\"],#sidebar-content a[href=\"/ja/home\"],#sidebar-content a[href=\"/zh/home\"]{display:none}.uo-wrap{max-width:64rem;margin:0 auto;padding:2.5rem 2rem 4rem}.uo-hero{display:flex;gap:40px;align-items:center;margin:0 0 48px}.uo-hero-text{flex:1 1 100%}.uo-actions{display:flex;flex-wrap:wrap;align-items:center;gap:20px;margin-top:24px}.uo-cta{display:inline-flex;align-items:center;gap:6px;background:#0060ff;color:#fff!important;padding:8px 18px;border-radius:8px;font-weight:600;text-decoration:none!important;border:0!important}.uo-cta:hover{background:#0034ff}.uo-secondary{font-weight:500}.uo-secondary a{text-decoration:none!important}.uo-secondary a:hover{color:#0060ff}.uo-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:16px}.uo-grid>*{grid-column:span 2;margin:0}.uo-grid>:nth-child(4):nth-last-child(2){grid-column:2/span 2}.uo-help-links{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin-top:10px;font-weight:500}@media (max-width:900px){.uo-grid{grid-template-columns:1fr}.uo-grid>*,.uo-grid>:nth-child(4):nth-last-child(2){grid-column:auto}}"}],"page":{"pagePath":"en/cloud/use-dify/nodes/agent","slug":"/en/cloud/use-dify/nodes/agent","pageMetadata":{"title":"Agent","description":"Run an agent as a step in your workflow, reasoning and using tools to complete a task","href":"/en/cloud/use-dify/nodes/agent"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Run an agent as a step in your workflow, reasoning and using tools to complete a task\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,img:`img`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Frame,Heading,Info,Note,OptimizedImage,Tab,Tabs}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Note)_missingMdxReference(`Note`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);return _jsxs(Tabs,{children:[_jsxs(Tab,{title:`Classic Agent`,id:`classic-agent`,\"data-child-tab-ids\":`[\"function-calling\",\"react-reason-%2B-act\"]`,\"data-child-heading-ids\":`[\"agent-strategies\",\"configuration\",\"model-selection\",\"tool-configuration\",\"instructions-and-context\",\"execution-controls\",\"tool-parameter-auto-generation\",\"output-variables\",\"use-cases\",\"best-practices\"]`,children:[_jsx(_components.p,{children:`The classic Agent node gives your LLM autonomous control over tools, enabling it to iteratively decide which tools to use and when to use them. Instead of pre-planning every step, the Agent reasons through problems dynamically, calling tools as needed to complete complex tasks.`}),_jsx(Frame,{caption:`Agent Node Configuration Interface`,children:_jsx(_components.p,{children:_jsx(_components.img,{src:`https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/node/1f4d803ff68394d507abd3bcc13ba0f3.png`,alt:`Agent Node Configuration Interface`})})}),_jsx(Heading,{level:`2`,id:`agent-strategies`,children:`Agent Strategies`}),_jsx(_components.p,{children:`Agent strategies define how your Agent thinks and acts. Choose the approach that best matches your model’s capabilities and task requirements.`}),_jsx(Frame,{caption:`Available Agent Strategy Options`,children:_jsx(_components.p,{children:_jsx(_components.img,{src:`https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/node/f14082c44462ac03955e41d66ffd4cca.png`,alt:`Available Agent Strategy Options`})})}),_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Function Calling`,id:`function-calling`,children:[_jsx(_components.p,{children:`Uses the LLM’s native function calling capabilities to directly pass tool definitions through the tools parameter. The LLM decides when and how to call tools using its built-in mechanism.`}),_jsx(_components.p,{children:`Best for models like GPT-4, Claude 3.5, and other models with robust function calling support.`})]}),_jsxs(Tab,{title:`ReAct (Reason + Act)`,id:`react-reason-%2B-act`,children:[_jsxs(_components.p,{children:[`Uses structured prompts that guide the LLM through explicit reasoning steps. Follows a `,_jsx(_components.strong,{children:`Thought → Action → Observation`}),` cycle for transparent decision-making.`]}),_jsx(_components.p,{children:`Works well with models that may not have native function calling or when you need explicit reasoning traces.`})]})]}),_jsx(Info,{children:_jsxs(_components.p,{children:[`Install additional strategies from `,_jsx(_components.strong,{children:`Marketplace → Agent Strategies`}),` or contribute custom strategies to the `,_jsx(_components.a,{href:`https://github.com/langgenius/dify-plugins`,children:`community repository`}),`.`]})}),_jsx(Frame,{caption:`Function Calling Strategy Configuration`,children:_jsx(_components.p,{children:_jsx(_components.img,{src:`https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/node/10505cd7c6f0b3ba10161abb88d9e36b.png`,alt:`Function Calling Strategy Configuration`})})}),_jsx(Heading,{level:`2`,id:`configuration`,children:`Configuration`}),_jsx(Heading,{level:`3`,id:`model-selection`,children:`Model Selection`}),_jsx(_components.p,{children:`Choose an LLM that supports your selected agent strategy. More capable models handle complex reasoning better but cost more per iteration. Ensure your model supports function calling if using that strategy.`}),_jsx(Heading,{level:`3`,id:`tool-configuration`,children:`Tool Configuration`}),_jsx(_components.p,{children:`Configure the tools your Agent can access. Each tool requires:`}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Authorization`}),` - API keys and credentials for external services configured in your workspace`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Description`}),` - Clear explanation of what the tool does and when to use it (this guides the Agent’s decision-making)`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Parameters`}),` - Required and optional inputs the tool accepts with proper validation`]}),_jsx(Heading,{level:`3`,id:`instructions-and-context`,children:`Instructions and Context`}),_jsx(_components.p,{children:`Define the Agent’s role, goals, and context using natural language instructions. Use Jinja2 syntax to reference variables from upstream workflow nodes.`}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Query`}),` specifies the user input or task the Agent should work on. This can be dynamic content from previous workflow nodes.`]}),_jsx(Frame,{caption:`Agent Configuration Parameters`,children:_jsx(_components.p,{children:_jsx(_components.img,{src:`https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/node/54c8e4f0eaa7379bd8c1b5ac6305b326.png`,alt:`Agent Configuration Parameters`})})}),_jsx(Heading,{level:`3`,id:`execution-controls`,children:`Execution Controls`}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Max Iterations`}),` sets a safety limit to prevent infinite loops. Configure based on task complexity - simple tasks need 3-5 iterations, while complex research might require 10-15.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Memory`}),` controls how many previous messages the Agent remembers using TokenBufferMemory. Larger memory windows provide more context but increase token costs. This enables conversational continuity where users can reference previous actions.`]}),_jsx(Heading,{level:`3`,id:`tool-parameter-auto-generation`,children:`Tool Parameter Auto-Generation`}),_jsxs(_components.p,{children:[`Tools can have parameters configured as `,_jsx(_components.strong,{children:`auto-generated`}),` or `,_jsx(_components.strong,{children:`manual input`}),`. Auto-generated parameters (`,_jsx(_components.code,{children:`auto: false`}),`) are automatically populated by the Agent, while manual input parameters require explicit values that become part of the tool’s permanent configuration.`]}),_jsx(`video`,{controls:true,src:`https://assets-docs.dify.ai/2025/04/1801b96763eb8f22f1e2158645897885.mp4`,width:`100%`}),_jsx(Heading,{level:`2`,id:`output-variables`,children:`Output Variables`}),_jsx(_components.p,{children:`Agent nodes provide comprehensive output including:`}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Final Answer`}),` - The Agent’s ultimate response to the query`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Tool Outputs`}),` - Results from each tool invocation during execution`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Reasoning Trace`}),` - Step-by-step decision process (especially detailed with ReAct strategy) available in the JSON output`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Iteration Count`}),` - Number of reasoning cycles used`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Success Status`}),` - Whether the Agent completed the task successfully`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Agent Logs`}),` - Structured log events with metadata for debugging and monitoring tool invocations`]}),_jsx(Heading,{level:`2`,id:`use-cases`,children:`Use Cases`}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Research and Analysis`}),` - Agents can autonomously search multiple sources, synthesize information, and provide comprehensive answers.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Troubleshooting`}),` - Diagnostic tasks where the Agent needs to gather information, test hypotheses, and adapt its approach based on findings.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Multi-step Data Processing`}),` - Complex workflows where the next action depends on intermediate results.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Dynamic API Integration`}),` - Scenarios where the sequence of API calls depends on responses and conditions that can’t be predetermined.`]}),_jsx(Heading,{level:`2`,id:`best-practices`,children:`Best Practices`}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Clear Tool Descriptions`}),` help the Agent understand when and how to use each tool effectively.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Appropriate Iteration Limits`}),` prevent runaway costs while allowing sufficient flexibility for complex tasks.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Detailed Instructions`}),` provide context about the Agent’s role, goals, and any constraints or preferences.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Memory Management`}),` balance context retention with token efficiency based on your use case requirements.`]})]}),_jsxs(Tab,{title:`New Agent`,id:`new-agent`,\"data-child-tab-ids\":`[\"invite-an-agent\",\"start-from-scratch\"]`,\"data-child-heading-ids\":`[\"choose-an-agent\",\"give-it-a-task\",\"declare-its-outputs\"]`,children:[_jsx(Info,{children:_jsx(_components.p,{children:`The new Agent node is in beta and available in Workflow apps only.`})}),_jsxs(_components.p,{children:[`The new Agent node runs an `,_jsx(_components.a,{href:`/en/cloud/use-dify/build/new-agent/overview`,children:`agent`}),` as one step of a workflow. Unlike the classic node’s model-with-tools setup, the agent arrives as a complete worker with its own capabilities and sandbox.`]}),_jsx(_components.p,{children:`You pick the agent and tell it what to do; it works through the task on its own and hands the results back to the rest of the flow.`}),_jsx(`a`,{id:`choose-an-agent`}),_jsx(Heading,{level:`2`,id:`choose-an-agent`,children:`Choose an Agent`}),_jsx(_components.p,{children:`When you add the node, pick who does the work:`}),_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Invite an Agent`,id:`invite-an-agent`,children:[_jsx(_components.p,{children:`You can invite any published agent: it arrives with its saved capabilities, and you set only its task here.`}),_jsxs(_components.p,{children:[`An invited agent is like a full-time employee: its capabilities are managed centrally in `,_jsx(_components.strong,{children:`Agents`}),`. When you publish an update there, every workflow that uses the agent gets it.`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`To edit its capabilities, click `,_jsx(_components.strong,{children:`Edit in Agents`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`If you want changes for this step only, click `,_jsx(_components.strong,{children:`Make a copy`}),`: the node switches to a one-time copy that no longer follows the original.`]}),`\n`]}),`\n`]})]}),_jsxs(Tab,{title:`Start from Scratch`,id:`start-from-scratch`,children:[_jsxs(_components.p,{children:[`Create a one-time agent that lives on this node alone, and configure it right here, the same way you `,_jsx(_components.a,{href:`/en/cloud/use-dify/build/new-agent/build`,children:`build`}),` in `,_jsx(_components.strong,{children:`Agents`}),`.`]}),_jsxs(_components.p,{children:[`It’s like a temp you bring in for one job. If it proves its worth, promote it to `,_jsx(_components.strong,{children:`Agents`}),` to reuse it elsewhere.`]}),_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/dify-6c0370d8/gjnt2OpRwfqVDcSX/images/use-dify/workflow/save-onetime-agent-to-roster.png?fit=max\u0026auto=format\u0026n=gjnt2OpRwfqVDcSX\u0026q=85\u0026s=8b8818ab7d301cb01e2c4556e96e8ba3`,alt:`Save a One-Time Agent`,\"data-og-width\":`1176`,width:`1176`,\"data-og-height\":`300`,height:`300`,\"data-path\":`images/use-dify/workflow/save-onetime-agent-to-roster.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/dify-6c0370d8/gjnt2OpRwfqVDcSX/images/use-dify/workflow/save-onetime-agent-to-roster.png?w=280\u0026fit=max\u0026auto=format\u0026n=gjnt2OpRwfqVDcSX\u0026q=85\u0026s=bb54c5eff620eb358eefa70c01f99b7d 280w, https://mintcdn.com/dify-6c0370d8/gjnt2OpRwfqVDcSX/images/use-dify/workflow/save-onetime-agent-to-roster.png?w=560\u0026fit=max\u0026auto=format\u0026n=gjnt2OpRwfqVDcSX\u0026q=85\u0026s=0e8462a6301f6cb9075f632c76a03d46 560w, https://mintcdn.com/dify-6c0370d8/gjnt2OpRwfqVDcSX/images/use-dify/workflow/save-onetime-agent-to-roster.png?w=840\u0026fit=max\u0026auto=format\u0026n=gjnt2OpRwfqVDcSX\u0026q=85\u0026s=65666d0bed33bba9f6b62c59588f0d4d 840w, https://mintcdn.com/dify-6c0370d8/gjnt2OpRwfqVDcSX/images/use-dify/workflow/save-onetime-agent-to-roster.png?w=1100\u0026fit=max\u0026auto=format\u0026n=gjnt2OpRwfqVDcSX\u0026q=85\u0026s=615b663dd08d29fe71031418d82952dd 1100w, https://mintcdn.com/dify-6c0370d8/gjnt2OpRwfqVDcSX/images/use-dify/workflow/save-onetime-agent-to-roster.png?w=1650\u0026fit=max\u0026auto=format\u0026n=gjnt2OpRwfqVDcSX\u0026q=85\u0026s=fd13018d334480b169bc4cf43406aec4 1650w, https://mintcdn.com/dify-6c0370d8/gjnt2OpRwfqVDcSX/images/use-dify/workflow/save-onetime-agent-to-roster.png?w=2500\u0026fit=max\u0026auto=format\u0026n=gjnt2OpRwfqVDcSX\u0026q=85\u0026s=0f96e0354a619967211eabbcfe619269 2500w`})})]})]}),_jsx(_components.p,{children:`You can always swap the agent later.`}),_jsxs(Info,{children:[_jsx(_components.p,{children:`Two nodes that invite the same agent still work separately: each starts from the agent’s saved setup in its own sandbox, and nothing from one node’s run (files it wrote, tools it installed) carries into another.`}),_jsx(_components.p,{children:`To pass results between nodes, declare them as outputs and reference them downstream.`})]}),_jsx(`a`,{id:`give-it-a-task`}),_jsx(Heading,{level:`2`,id:`give-it-a-task`,children:`Give It a Task`}),_jsxs(_components.p,{children:[`In `,_jsx(_components.strong,{children:`Agent task`}),`, describe what you need at this step, the way you’d brief a colleague on one job. This is separate from the agent’s own prompt and capabilities. Type `,_jsx(_components.code,{children:`/`}),` to pull in outputs from earlier nodes.`]}),_jsx(_components.p,{children:`Say you’ve invited a support agent that already knows your product docs and writes in your support tone, and the workflow hands it inbound customer emails. The task covers only this step:`}),_jsx(CodeBlock,{filename:``,wrap:`true`,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Read the customer email in {{customer_email}} and draft a reply that answers every question in it. Keep it under 150 words.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),_jsxs(Note,{children:[_jsx(_components.p,{children:`Variables you pull in reach the agent as text and are truncated at 2,000 characters.`}),_jsx(_components.p,{children:`To hand over longer content in full, pass it as a file: the agent receives the whole file and reads it in its sandbox.`})]}),_jsx(Heading,{level:`2`,id:`declare-its-outputs`,children:`Declare Its Outputs`}),_jsxs(_components.p,{children:[`By default, an Agent node returns a single output, `,_jsx(_components.code,{children:`text`}),`: the agent’s reply to its task, as one block of text. When a later step needs something more specific, like a single value or a particular file, declare it as its own output.`]}),_jsxs(_components.p,{children:[`Type `,_jsx(_components.code,{children:`/`}),` in the `,_jsx(_components.strong,{children:`Agent task`}),`, choose `,_jsx(_components.strong,{children:`New output`}),`, then name it and pick a type in place. Each declared output can be referenced by downstream nodes on its own.`]}),_jsxs(_components.p,{children:[`A declared output sits right in the task text, so you can tell the agent exactly what to put in it. For example, in this task `,_jsx(_components.code,{children:`{{vendor_name}}`}),` and `,_jsx(_components.code,{children:`{{quote_file}}`}),` are declared outputs:`]}),_jsx(CodeBlock,{filename:``,wrap:`true`,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Compare the three vendor quotes in {{vendor_quotes}} and write a recommendation. Put the winning vendor's name in {{vendor_name}} and its quote PDF in {{quote_file}}.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),_jsx(_components.p,{children:`Each file the agent returns is capped at 50 MB.`})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Agent","description":"Run an agent as a step in your workflow, reasoning and using tools to complete a task","href":"/en/cloud/use-dify/nodes/agent"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Agent Strategies","slug":"agent-strategies","depth":2,"children":[],"tabId":"classic-agent"},{"title":"Configuration","slug":"configuration","depth":2,"children":[{"title":"Model Selection","slug":"model-selection","depth":3,"children":[],"tabId":"classic-agent"},{"title":"Tool Configuration","slug":"tool-configuration","depth":3,"children":[],"tabId":"classic-agent"},{"title":"Instructions and Context","slug":"instructions-and-context","depth":3,"children":[],"tabId":"classic-agent"},{"title":"Execution Controls","slug":"execution-controls","depth":3,"children":[],"tabId":"classic-agent"},{"title":"Tool Parameter Auto-Generation","slug":"tool-parameter-auto-generation","depth":3,"children":[],"tabId":"classic-agent"}],"tabId":"classic-agent"},{"title":"Output Variables","slug":"output-variables","depth":2,"children":[],"tabId":"classic-agent"},{"title":"Use Cases","slug":"use-cases","depth":2,"children":[],"tabId":"classic-agent"},{"title":"Best Practices","slug":"best-practices","depth":2,"children":[],"tabId":"classic-agent"},{"title":"Choose an Agent","slug":"choose-an-agent","depth":2,"children":[],"tabId":"new-agent"},{"title":"Give It a Task","slug":"give-it-a-task","depth":2,"children":[],"tabId":"new-agent"},{"title":"Declare Its Outputs","slug":"declare-its-outputs","depth":2,"children":[],"tabId":"new-agent"}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/dify-6c0370d8/90066d529e522771/contributing-footer.js"],"subdomain":"dify-6c0370d8","siteName":"Dify Docs","title":"Agent - Dify Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/en/cloud/use-dify/nodes/agent","matchLevel":0},"zh":{"href":"/zh/cloud/use-dify/nodes/agent","matchLevel":1},"ja":{"href":"/ja/cloud/use-dify/nodes/agent","matchLevel":1}}},"lastModified":"2026-08-27T08:01:29.857Z","gitLastModified":"2026-08-27T08:00:38.000Z","originalFileLocation":"en/cloud/use-dify/nodes/agent.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Run an agent as a step in your workflow, reasoning and using tools to complete a task\">\u003cmeta data-mint-head name=\"application-name\" content=\"Dify Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/dify-6c0370d8/tWYYD8GkT0MUJV0z/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/dify-6c0370d8/tWYYD8GkT0MUJV0z/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/dify-6c0370d8/tWYYD8GkT0MUJV0z/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/dify-6c0370d8/tWYYD8GkT0MUJV0z/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/dify-6c0370d8/tWYYD8GkT0MUJV0z/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/dify-6c0370d8/tWYYD8GkT0MUJV0z/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/dify-6c0370d8/tWYYD8GkT0MUJV0z/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/dify-6c0370d8/tWYYD8GkT0MUJV0z/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/dify-6c0370d8/tWYYD8GkT0MUJV0z/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Agent - Dify Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Run an agent as a step in your workflow, reasoning and using tools to complete a task\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Dify Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.dify.ai/en/cloud/use-dify/nodes/agent\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://dify-6c0370d8.mintlify.app/_mintlify/api/og/v2?division=Nodes\u0026amp;title=Agent\u0026amp;description=Run+an+agent+as+a+step+in+your+workflow%2C+reasoning+and+using+tools+to+complete+a+task\u0026amp;theme=fc270d2c96587e5833522f0e\u0026amp;signature=f7d71ddf14d0d95cab0e4258c1a06efca8c4b455ad1511cee47e058a0dbeaa9e\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Agent - Dify Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Run an agent as a step in your workflow, reasoning and using tools to complete a task\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://dify-6c0370d8.mintlify.app/_mintlify/api/og/v2?division=Nodes\u0026amp;title=Agent\u0026amp;description=Run+an+agent+as+a+step+in+your+workflow%2C+reasoning+and+using+tools+to+complete+a+task\u0026amp;theme=fc270d2c96587e5833522f0e\u0026amp;signature=f7d71ddf14d0d95cab0e4258c1a06efca8c4b455ad1511cee47e058a0dbeaa9e\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/dify-6c0370d8/tWYYD8GkT0MUJV0z/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Dify Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0060FF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.dify.ai/en/cloud/use-dify/nodes/agent\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/en/cloud/use-dify/nodes/agent.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.dify.ai/en/cloud/use-dify/nodes/agent\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh\" href=\"https://docs.dify.ai/zh/cloud/use-dify/nodes/agent\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ja\" href=\"https://docs.dify.ai/ja/cloud/use-dify/nodes/agent\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.dify.ai/en/cloud/use-dify/nodes/agent\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.dify.ai/#organization\",\"name\":\"Dify Docs\",\"url\":\"https://docs.dify.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://assets-docs.dify.ai/2025/05/d05cfc6ebe48f725d171dc71c64a5d16.svg\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.dify.ai#website\",\"name\":\"Dify Docs\",\"url\":\"https://docs.dify.ai\",\"publisher\":{\"@id\":\"https://docs.dify.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.dify.ai/en/cloud/use-dify/nodes/agent#webpage\",\"url\":\"https://docs.dify.ai/en/cloud/use-dify/nodes/agent\",\"name\":\"Agent\",\"description\":\"Run an agent as a step in your workflow, reasoning and using tools to complete a task\",\"dateModified\":\"2026-08-27T08:00:38.000Z\",\"isPartOf\":{\"@id\":\"https://docs.dify.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.dify.ai/en/cloud/use-dify/nodes/agent#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.dify.ai/en/cloud/use-dify/nodes/agent#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Orchestrate\",\"item\":\"https://docs.dify.ai/en/cloud/use-dify/build/workflow-chatflow\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Workflow \u0026 Chatflow\",\"item\":\"https://docs.dify.ai/en/cloud/use-dify/build/workflow-chatflow\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Nodes\",\"item\":\"https://docs.dify.ai/en/cloud/use-dify/nodes/user-input\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Agent\",\"item\":\"https://docs.dify.ai/en/cloud/use-dify/nodes/agent\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.dify.ai/en/cloud/use-dify/nodes/agent#article\",\"headline\":\"Agent\",\"name\":\"Agent\",\"description\":\"Run an agent as a step in your workflow, reasoning and using tools to complete a task\",\"url\":\"https://docs.dify.ai/en/cloud/use-dify/nodes/agent\",\"mainEntityOfPage\":{\"@id\":\"https://docs.dify.ai/en/cloud/use-dify/nodes/agent#webpage\"},\"dateModified\":\"2026-08-27T08:00:38.000Z\",\"publisher\":{\"@id\":\"https://docs.dify.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.dify.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Dify Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Dify Docs","nav":{"global":null,"languages":[{"language":"en","default":true,"products":[{"product":"Cloud","icon":"cloud","tabs":[{"tab":"Use","icon":"book-open","pages":[{"title":"Use Dify","sidebarTitle":"Overview","mode":"frame","href":"/en/cloud/use-dify/getting-started/introduction"},{"title":"Dify Documentation","mode":"custom","hidden":true,"href":"/en/home"},{"group":"Orchestrate","icon":"hammer","pages":[{"group":"Workflow \u0026 Chatflow","expanded":false,"pages":[{"title":"Workflow \u0026 Chatflow","sidebarTitle":"Overview","href":"/en/cloud/use-dify/build/workflow-chatflow"},{"title":"Orchestration Logic","href":"/en/cloud/use-dify/build/orchestrate-node"},{"group":"Nodes","expanded":false,"pages":[{"group":"Start","root":{"title":"Start Node","href":"/en/cloud/use-dify/nodes/start"},"pages":[{"title":"User Input","href":"/en/cloud/use-dify/nodes/user-input"},{"group":"Trigger","root":{"title":"Trigger","sidebarTitle":"Overview","href":"/en/cloud/use-dify/nodes/trigger/overview"},"pages":[{"title":"Schedule Trigger","href":"/en/cloud/use-dify/nodes/trigger/schedule-trigger"},{"title":"Integration Trigger","href":"/en/cloud/use-dify/nodes/trigger/plugin-trigger"},{"title":"Webhook Trigger","href":"/en/cloud/use-dify/nodes/trigger/webhook-trigger"}]}]},{"title":"LLM","href":"/en/cloud/use-dify/nodes/llm"},{"title":"Knowledge Retrieval","href":"/en/cloud/use-dify/nodes/knowledge-retrieval"},{"title":"Answer","href":"/en/cloud/use-dify/nodes/answer"},{"title":"Output","description":"Return workflow results to the end user or API caller","href":"/en/cloud/use-dify/nodes/output"},{"title":"Agent","href":"/en/cloud/use-dify/nodes/agent"},{"title":"Question Classifier","description":"Intelligently categorize user input to route workflow paths","href":"/en/cloud/use-dify/nodes/question-classifier"},{"title":"If-Else","href":"/en/cloud/use-dify/nodes/ifelse"},{"group":"Human Input","root":{"title":"Human Input","href":"/en/cloud/use-dify/nodes/human-input"},"expanded":false,"pages":[]},{"title":"Iteration","href":"/en/cloud/use-dify/nodes/iteration"},{"title":"Loop","href":"/en/cloud/use-dify/nodes/loop"},{"title":"Code","href":"/en/cloud/use-dify/nodes/code"},{"title":"Template","href":"/en/cloud/use-dify/nodes/template"},{"title":"Variable Aggregator","href":"/en/cloud/use-dify/nodes/variable-aggregator"},{"title":"Document Extractor","href":"/en/cloud/use-dify/nodes/doc-extractor"},{"title":"Variable Assigner","href":"/en/cloud/use-dify/nodes/variable-assigner"},{"title":"Parameter Extractor","href":"/en/cloud/use-dify/nodes/parameter-extractor"},{"title":"HTTP Request","href":"/en/cloud/use-dify/nodes/http-request"},{"title":"List Operator","href":"/en/cloud/use-dify/nodes/list-operator"},{"title":"Tool Node","sidebarTitle":"Tool","href":"/en/cloud/use-dify/nodes/tools"}]},{"title":"Hotkeys","href":"/en/cloud/use-dify/build/shortcut-key"},{"title":"Version Control","href":"/en/cloud/use-dify/build/version-control"},{"title":"Snippets","sidebarTitle":"Snippets","href":"/en/cloud/use-dify/build/snippet"},{"group":"Debug","expanded":false,"pages":[{"title":"Handle Errors","href":"/en/cloud/use-dify/build/predefined-error-handling-logic"},{"title":"Single Node","href":"/en/cloud/use-dify/debug/step-run"},{"title":"Variable Inspector","href":"/en/cloud/use-dify/debug/variable-inspect"},{"title":"Run History","href":"/en/cloud/use-dify/debug/history-and-logs"},{"title":"Error Types","href":"/en/cloud/use-dify/debug/error-type"}]}]},{"group":"Agent","tag":"New","expanded":false,"pages":[{"title":"Agent","sidebarTitle":"Overview","href":"/en/cloud/use-dify/build/new-agent/overview"},{"title":"Build an Agent","sidebarTitle":"Build","href":"/en/cloud/use-dify/build/new-agent/build"}]},{"group":"Basic Apps","expanded":false,"pages":[{"title":"Agent","tag":"Legacy","href":"/en/cloud/use-dify/build/agent"},{"title":"Chatbot","sidebarTitle":"Chatbot","href":"/en/cloud/use-dify/build/chatbot"},{"title":"Text Generator","sidebarTitle":"Text Generator","href":"/en/cloud/use-dify/build/text-generator"}]},{"title":"App Toolkit","href":"/en/cloud/use-dify/build/additional-features"},{"title":"Go to Anything","href":"/en/cloud/use-dify/build/goto-anything"}]},{"group":"Publish","icon":"paper-plane","expanded":false,"pages":[{"title":"Overview","href":"/en/cloud/use-dify/publish/README"},{"group":"Web App","pages":[{"title":"Workflow Web Apps","href":"/en/cloud/use-dify/publish/webapp/workflow-webapp"},{"title":"Chat Web Apps","href":"/en/cloud/use-dify/publish/webapp/chatflow-webapp"},{"title":"Settings","href":"/en/cloud/use-dify/publish/webapp/web-app-settings"},{"title":"Embed Your Web App","sidebarTitle":"Embeds","href":"/en/cloud/use-dify/publish/webapp/embedding-in-websites"}]},{"title":"MCP Server","href":"/en/cloud/use-dify/publish/publish-mcp"},{"title":"Publish Apps to Marketplace","sidebarTitle":"Marketplace","href":"/en/cloud/use-dify/publish/publish-to-marketplace"}]},{"group":"Monitor","icon":"chart-line","expanded":false,"pages":[{"title":"Dashboard","href":"/en/cloud/use-dify/monitor/analysis"},{"title":"Logs","href":"/en/cloud/use-dify/monitor/logs"},{"title":"Annotation System","href":"/en/cloud/use-dify/monitor/annotation-reply"},{"group":"Integrations","pages":[{"title":"Integrate with LangSmith","sidebarTitle":"LangSmith","href":"/en/cloud/use-dify/monitor/integrations/integrate-langsmith"},{"title":"Integrate with Langfuse","sidebarTitle":"Langfuse","href":"/en/cloud/use-dify/monitor/integrations/integrate-langfuse"},{"title":"Integrate with Opik","sidebarTitle":"Opik","href":"/en/cloud/use-dify/monitor/integrations/integrate-opik"},{"title":"Integrate with W\u0026B Weave","sidebarTitle":"W\u0026B Weave","href":"/en/cloud/use-dify/monitor/integrations/integrate-weave"},{"title":"Integrate with Arize","sidebarTitle":"Arize","href":"/en/cloud/use-dify/monitor/integrations/integrate-arize"},{"title":"Integrate with Phoenix","sidebarTitle":"Phoenix","href":"/en/cloud/use-dify/monitor/integrations/integrate-phoenix"},{"title":"Integrate with Alibaba Cloud Monitor","sidebarTitle":"Alibaba Cloud Monitor","href":"/en/cloud/use-dify/monitor/integrations/integrate-aliyun"}]}]},{"group":"Knowledge","icon":"book","expanded":false,"pages":[{"title":"Knowledge","sidebarTitle":"Overview","href":"/en/cloud/use-dify/knowledge/readme"},{"group":"Create","pages":[{"group":"Ready-to-Use Knowledge Base","pages":[{"title":"Create a Ready-to-Use Knowledge Base","sidebarTitle":"Overview","href":"/en/cloud/use-dify/knowledge/create-knowledge/introduction"},{"group":"Import Data","pages":[{"title":"Upload Local Files","href":"/en/cloud/use-dify/knowledge/create-knowledge/import-text-data/readme"},{"title":"Sync Data from Notion","href":"/en/cloud/use-dify/knowledge/create-knowledge/import-text-data/sync-from-notion"},{"title":"Import Data from Website","href":"/en/cloud/use-dify/knowledge/create-knowledge/import-text-data/sync-from-website"}]},{"title":"Configure the Chunk Settings","href":"/en/cloud/use-dify/knowledge/create-knowledge/chunking-and-cleaning-text"},{"title":"Specify the Index Method and Retrieval Settings","href":"/en/cloud/use-dify/knowledge/create-knowledge/setting-indexing-methods"}]},{"group":"Custom Knowledge Base","pages":[{"title":"Build a Custom Knowledge Base","sidebarTitle":"Overview","href":"/en/cloud/use-dify/knowledge/knowledge-pipeline/readme"},{"title":"Step 1: Create Knowledge Pipeline","href":"/en/cloud/use-dify/knowledge/knowledge-pipeline/create-knowledge-pipeline"},{"title":"Step 2: Orchestrate Knowledge Pipeline","href":"/en/cloud/use-dify/knowledge/knowledge-pipeline/knowledge-pipeline-orchestration"},{"title":"Step 3: Publish Knowledge Pipeline","href":"/en/cloud/use-dify/knowledge/knowledge-pipeline/publish-knowledge-pipeline"},{"title":"Step 4: Upload Files","href":"/en/cloud/use-dify/knowledge/knowledge-pipeline/upload-files"},{"title":"Step 5: Manage and Use Knowledge Base","href":"/en/cloud/use-dify/knowledge/knowledge-pipeline/manage-knowledge-base"},{"title":"Authorize Data Source","href":"/en/cloud/use-dify/knowledge/knowledge-pipeline/authorize-data-source"}]},{"group":"Connect to External Knowledge","pages":[{"title":"Connect to External Knowledge Base","sidebarTitle":"Overview","href":"/en/cloud/use-dify/knowledge/connect-external-knowledge-base"},{"title":"External Knowledge API","href":"/en/cloud/use-dify/knowledge/external-knowledge-api"}]}]},{"group":"Manage","pages":[{"title":"Manage Knowledge Content","sidebarTitle":"Documents \u0026 Chunks","href":"/en/cloud/use-dify/knowledge/manage-knowledge/maintain-knowledge-documents"},{"title":"Manage Document Metadata","sidebarTitle":"Metadata","href":"/en/cloud/use-dify/knowledge/metadata"},{"title":"Manage Knowledge Settings","sidebarTitle":"Settings","href":"/en/cloud/use-dify/knowledge/manage-knowledge/introduction"}]},{"title":"Test Knowledge Retrieval","sidebarTitle":"Test Retrieval","href":"/en/cloud/use-dify/knowledge/test-retrieval"},{"title":"Integrate Knowledge within Apps","sidebarTitle":"Integrate in Apps","href":"/en/cloud/use-dify/knowledge/integrate-knowledge-within-application"},{"title":"Knowledge Request Rate Limit","sidebarTitle":"Request Rate Limit","href":"/en/cloud/use-dify/knowledge/knowledge-request-rate-limit"},{"title":"Knowledge Data Storage Limit","sidebarTitle":"Data Storage Limit","href":"/en/cloud/use-dify/knowledge/knowledge-storage-limit"}]},{"group":"Integrations","icon":"plug","expanded":false,"pages":[{"title":"Integrations","sidebarTitle":"Overview","href":"/en/cloud/use-dify/workspace/plugins"},{"title":"Model Providers","href":"/en/cloud/use-dify/workspace/model-providers"},{"title":"Dify Tools","sidebarTitle":"Tools","href":"/en/cloud/use-dify/workspace/tools"},{"group":"Custom Endpoint","pages":[{"title":"Custom Endpoints","sidebarTitle":"Overview","href":"/en/cloud/use-dify/workspace/api-extension/api-extension"},{"title":"External Data Tool","href":"/en/cloud/use-dify/workspace/api-extension/external-data-tool-api-extension"},{"title":"Sensitive Content Moderation","href":"/en/cloud/use-dify/workspace/api-extension/moderation-api-extension"},{"title":"Deploy Custom Endpoints Using Cloudflare Workers","href":"/en/cloud/use-dify/workspace/api-extension/cloudflare-worker"}]}]},{"group":"Workspace","icon":"briefcase","expanded":false,"pages":[{"title":"Overview","href":"/en/cloud/use-dify/workspace/readme"},{"title":"Manage Apps","href":"/en/cloud/use-dify/workspace/app-management"},{"title":"Manage Members","href":"/en/cloud/use-dify/workspace/team-members-management"},{"title":"Personal Settings","href":"/en/cloud/use-dify/workspace/personal-account-management"},{"title":"Billing","href":"/en/cloud/use-dify/workspace/subscription-management"}]}]},{"tab":"Learn","icon":"graduation-cap","pages":[{"title":"Learn","href":"/en/learn/key-concepts"}]},{"tab":"Developer Resources","icon":"code","menu":[{"item":"API","icon":"code","pages":[{"title":"API","href":"/en/api-reference/guides/get-started"}]},{"item":"CLI","icon":"terminal","pages":[{"title":"CLI","href":"/en/cloud/cli/overview"}]},{"item":"Plugins","icon":"code-pull-request","pages":[{"title":"Plugins","href":"/en/develop-plugin/getting-started/getting-started-dify-plugin"}]}],"pages":[{"title":"Developer Resources","href":"/en/api-reference/guides/get-started"}]}]},{"product":"Self-Host","icon":"server","pages":[{"title":"Self-Host","href":"/en/self-host/deploy/overview"}]}]},{"language":"zh","pages":[{"title":"zh","href":"/zh/cloud/use-dify/nodes/agent"}]},{"language":"ja","pages":[{"title":"ja","href":"/ja/cloud/use-dify/nodes/agent"}]}]},"title":"Agent - Dify Docs","buildId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","deploymentId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-Cz91mEGH.js","DynamicMarkdown-a8hUKrw6.js","zoom-image-lightbox-CaUwvYH3.js","lightbox-handle-r17bVUz3.js"]}