节点 / builtin / ai / aidependencies / tools
Workflow as Tool
Expose another workflow as a callable tool.
此内容尚不支持你的语言。
Turn one of your workflows into a tool an AI agent can call, so the agent can hand off a sub-task you already built.
What it does
Section titled “What it does”Workflow as Tool is a tool for an agent, not a step in the flow. It has no output port: you connect it to the Tools slot of a Tools Agent.
The agent sees a tool with your Tool Name and Tool Description. When it calls it, it can pass one text value, input. The selected Workflow runs in the background with { input: "..." } as its starting data, and what it produces goes back to the model as text:
- A lambda workflow returns what its Lambda Output node produced.
- A workflow that starts with a trigger returns the output of its last steps (the ones that feed nothing else). With several last steps, their outputs are grouped by node label.
- If a step fails, the agent is told which step and why.
- A workflow that pauses for an approval or a wait can’t finish inside a tool call: the pause is dropped and the agent is told.
When to use it
Section titled “When to use it”- You already have a workflow that does one job well (look up a customer, format a report, save a note) and want an agent to use it when needed.
- The job needs several fixed steps that would be unreliable to leave to the model.
- You want to give an agent many abilities, each as its own small workflow, connected as separate tools.
Inputs and settings
Section titled “Inputs and settings”| 设置项 | 类型 | 作用 |
|---|---|---|
| Workflow | Workflow picker | The workflow to call. Only the first selection is used. |
| Tool Name | Text | The name the agent sees for this tool. 默认值:workflow_tool |
| Tool Description | Text | Describes to the agent what this tool does and when to call it. 默认值:Runs a workflow and returns its output. |
- Workflow: the picker allows several, but only the first one is used.
- Tool Name: short, with underscores, saying what it does, for example
lookup_customer. Give each Workflow as Tool node on the same agent a different name. - Tool Description: the model decides when to call the tool from this text, so say what it does and what to pass as
input, for example “Looks up a customer by email address. Pass the email as input.” - In a lambda workflow, add a field named
inputto its Lambda Input node to receive the value.
Outputs
Section titled “Outputs”This node has no output port. It plugs into a slot on another node instead of passing items along.
- Tools slot of Tools Agent
The workflow’s result goes back to the model, not to the next node. The agent’s steps output lists each call, and its response holds the final answer.
Dependencies and credentials
Section titled “Dependencies and credentials”None. This node needs no connection and has no slots for other nodes.
The called workflow uses its own nodes’ credentials.
Example workflow
Section titled “Example workflow”- Build a lambda workflow “Lookup customer”: a Lambda Input with an
inputfield, an Http Request to your CRM using{{ $input.input }}, and a Lambda Output. - In another workflow, add Workflow as Tool with Workflow “Lookup customer”, Tool Name
lookup_customerand Tool DescriptionLooks up a customer by email. Pass the email as input. - Connect it to the Tools slot of a Tools Agent with Prompt
Summarise the account of {{ $input.text }}, a Chat OpenAI model in Model, fed by Get Selected Text with Output field nametext. - Display Markdown shows
{{ $input.response }}.
Common issues
Section titled “Common issues”- “No workflow selected for this tool.” Pick a workflow in Workflow.
- “The workflow paused (for an approval or a wait) and cannot finish inside this call.” The called workflow contains a step that waits for a person or a timer. Remove it from that workflow, or call it outside the agent.
- The agent is told a step failed, for example
"Http Request" failed: .... Open the called workflow and fix that step; run it on its own first. - The agent never calls the tool. Make Tool Description clearer about when to use it, and mention the tool in the agent’s Prompt.
Related nodes
Section titled “Related nodes”- Tools Agent: the agent this tool plugs into.
- Lambda Input and Lambda Output: define what a lambda workflow receives and returns.
- MCP Client Tool: tools from a remote server instead of your own workflows.