Use a workflow as a tool inside an agent
Expose a published workflow to an agent so the agent can call a controlled action from chat.
When a workflow is tagged Use as Tool, it becomes available in the Tools tab of every agent in your org. The agent can call it on demand with structured inputs and consume its outputs as a tool result.
This is how you compose controlled workflow execution with an agent's natural-language interface: the agent chooses, the workflow executes.
What You'll Build
A workflow tool that an agent can call. The example throughout this guide is an Account Research workflow exposed to a Deal Prep agent.
When to Use This
Use this pattern when:
- The agent should take a real action, not only answer a question.
- The action has a repeatable sequence of steps.
- You want run history, workflow versioning, and step-by-step debugging.
- You want the agent to choose when to run the action based on the conversation.
Estimated time: 15-20 minutes.
Concepts used: Workflows vs. agents, Workflows, Agents, Variables.
1. Prepare the Workflow Contract
Start with a published workflow that has clear inputs and outputs.
For an account research workflow, a good contract is:
- Input:
account_id - Output:
research_summary - Output:
recommended_next_step
Keep outputs small and named. Agents work better with a few clear outputs than with a large blob of unstructured text.
2. Tag the Workflow as a Tool
In the Workflow Builder header, toggle Use as Tool. A second header row appears for the UI Component selector — pick the component you want the agent to render when it shows the tool's result (or leave it on the default).
Click Publish to make the change live. Only published versions of "Use as Tool" workflows show up in agent tool catalogs.
3. Define the Workflow's Outputs
Open the Triggers / Inputs / Outputs panel and declare the workflow's outputs. Outputs are the contract the workflow promises to return to its caller — and for a tool-tagged workflow, the agent reads outputs the way a function would read a return value.
Example output names:
research_summaryrisk_flagsnext_best_actionsource_urls
4. Add the Workflow to an Agent
Open the agent in Automation → Agents → [your agent] and switch to the Tools tab.
Workflow tools appear in their own section (separate from core tools). Find your workflow by name and add it. The Tools tab help drawer covers how to choose between core tools, workflow tools, and nested agents.
5. Tell the Agent When to Use the Tool
In the agent's instructions prompt, tell it explicitly when this tool is the right choice. Agents tend to underuse tools they don't understand and overuse tools that sound generic, so naming the tool and describing when to call it is high-leverage prompting.
Example:
When the user asks for account research, meeting prep, or a suggested next step for an account, call the Account Research workflow tool. Pass the account_id from the page context or from the record lookup result. After the tool returns, summarize research_summary and next_best_action in plain language.6. Test the Wiring
Use the agent's Test tab to run with a sample input that should trigger the tool call. The trace view shows:
- The tool call with the structured inputs the agent passed.
- The workflow execution that ran in response (linked to its run page).
- The structured output the agent received and what it did with it.
If the agent never calls the tool, tighten the instructions or simplify the tool's name and description.
Success Check
You are done when:
- The workflow appears in the agent's Tools tab.
- The agent calls the workflow when prompted with the intended use case.
- The workflow run receives the expected inputs.
- The agent uses the workflow outputs in its final answer.
Troubleshooting
- The workflow does not appear in the tool list: publish the workflow after turning on Use as Tool.
- The agent passes the wrong input: make the workflow input names clearer and add a specific instruction about where to find each input.
- The agent never calls the workflow: rename the workflow tool so its purpose is obvious, and tell the agent exactly when to use it.
- The agent calls the workflow too often: narrow the prompt conditions or remove the tool from agents that do not need it.
Where This Fits
- Use workflow tools when the action is deterministic, side-effecting, or expensive to do multiple times — and you want the agent to call it through a pre-wired graph.
- Use core tools for general capabilities like product help, record search, report search, web research, and navigation.
- Use a nested agent (Agent Task inside a workflow) when you want a different agent's reasoning available as a step. See Build your first agent.