Replies: 1 comment
-
|
Hi @guilee1! I'm Dosu and I’m helping the dify team. You can reuse workflows in Dify by publishing an existing workflow as a tool, then adding it as a sub-workflow in your main workflow. This modular approach is documented in the "Publishing Workflow Applications as Tools" section. Sub-workflows can inherit input/output parameters but currently only support parameter passing via user input or LLM input—there’s no built-in way to directly pass variables from the parent workflow to the sub-workflow, though using LLM input is a feasible workaround for some cases (source). To invoke an agent as a node within a workflow, use the Agent node in the workflow editor (available in v1.0.0-beta and later). Drag the Agent node onto the canvas, select an Agent Strategy (like Function Calling or ReAct), and configure its parameters (model, tools, instruction, query, etc.) (source). The agent node will then execute your agent logic as part of the workflow, and its outputs (text, JSON, files, variables, logs) are available for downstream nodes to reuse, managed by the workflow’s variable pool (source). A current limitation: only the agent’s answer/response is stored in memory for follow-up steps—function call results (like tool outputs) are available as node outputs but not merged into the conversation memory. If you need those outputs in subsequent steps, you’ll need to manually inject them into the context (source). Make sure all required services (api, db, redis, nginx, weaviate, ssrf_proxy, sandbox) are running for agent nodes to function properly (source). For more details on agent strategies, see the "Select an Agent Strategy" docs. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
I have developed an agent on Dify, and now there is a new requirement to build a feature with more advanced capabilities. This feature needs to invoke the previously developed agent as a node within the workflow, while also achieving the reuse of data and processes. How can this be accomplished?
2. Additional context or comments
No response
Beta Was this translation helpful? Give feedback.
All reactions