Skip to content

Commit d4a0245

Browse files
ouiliameclaude
andcommitted
docs(building-agents): workflow-as-tool is agent-decided, not the Workflow block
The choosing page defined workflow-as-tool as the Workflow block (path-decided), contradicting its own name and the comparison table's premise. Verified against the product: workflow_executor is an agent tool — you pick the workflow in the Agent block's tool list, the model decides when to call it and supplies the inputMapping (user-or-llm), inputs arrive at the child's Start trigger. Rewritten agent-first: the section defines it as a workflow handed to an agent as one callable tool, the lead scorer gains a Deep Enrich workflow tool chip on the agent (diagram updated), and the deterministic Workflow block becomes the explicit contrast in a callout — same child workflow, the difference is who decides, mirroring the block/agent-tool contrast. Table row corrected to "The agent"; the summary paragraph follows. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 03a433e commit d4a0245

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

apps/docs/components/workflow-preview/examples.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,6 +1671,7 @@ export const LEAD_SCORER_WORKFLOW: PreviewWorkflow = {
16711671
{ type: 'exa', name: 'Search', bgColor: '#1F40ED' },
16721672
{ type: 'gmail', name: 'Send Email', bgColor: '#E0E0E0' },
16731673
{ type: 'hubspot', name: 'CRM', bgColor: '#FF7A59' },
1674+
{ type: 'workflow', name: 'Deep Enrich', bgColor: '#6366F1' },
16741675
],
16751676
},
16761677
{

apps/docs/content/docs/en/building-agents/choosing.mdx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,13 @@ In the lead scorer, your CRM vendor ships an MCP server. After you connect it on
5454

5555
## Workflow-as-tool
5656

57-
A **workflow-as-tool** runs a whole workflow as one step. The [Workflow](/blocks/workflow) block selects a child workflow and maps values to its [Start](/triggers/start) trigger, then returns `success`, `result`, and `error`. Use it to keep a large system modular: build a procedure once, call it from many parents.
57+
A **workflow-as-tool** is a whole workflow handed to an agent as one callable tool. You pick the workflow in the [Agent](/blocks/agent) block's tool list; the agent decides when to call it and supplies the inputs, which arrive at the child's [Start](/triggers/start) trigger, and the child's result comes back as the tool's output. Use it when a multi-step procedure should be at the agent's disposal, not on the path.
5858

59-
In the lead scorer, enrichment is its own workflow with five steps. The parent uses a Workflow block to call it and reads the enriched lead from `result`, instead of inlining those five steps. So one workflow can call another, much the way a function calls another function.
59+
In the lead scorer, the agent has a `Deep Enrich` workflow as a tool — its own five-step procedure. For a thin lead, the agent calls it to fill out the profile before scoring; for a complete lead, it never runs. The agent weighs a whole procedure the same way it weighs a single action.
60+
61+
<Callout type="info">
62+
A workflow can also run as a fixed step: the [Workflow](/blocks/workflow) block calls a child workflow because the path reached it. Same child workflow, same Start trigger — the difference, as with blocks and agent tools, is who decides. The Enrich step in the diagram is that deterministic case.
63+
</Callout>
6064

6165
<WorkflowPreview workflow={LEAD_SCORER_WORKFLOW} height={170} highlightBlock="enrich" />
6266

@@ -72,12 +76,12 @@ In the lead scorer, a `lead-scoring-rubric` skill spells out the bands and disqu
7276
| **Agent tool** | The agent | On the Agent block | Pick from the integrations |
7377
| **Custom tool** | The agent | The workspace | Write the code once |
7478
| **MCP server** | The agent | An external server | Connect it |
75-
| **Workflow-as-tool** | The path | Its own workflow | Build it like any workflow |
79+
| **Workflow-as-tool** | The agent | Its own workflow | Build it, then pick it in the tool list |
7680
| **Skill** | The agent | The workspace | Write the instructions |
7781

7882
## Putting it together
7983

80-
The lead scorer uses six kinds at once: blocks for the steps that must always run, agent tools for the calls the model should weigh, a custom tool for shared logic, an MCP server for the CRM, a workflow-as-tool for enrichment, and a skill for the scoring rules. In general, start with a block, then move to an agent tool when a model should decide. Reach for the rest only when you need reuse, an external toolset, a sub-workflow, or written guidance.
84+
The lead scorer uses six kinds at once: blocks for the steps that must always run, agent tools for the calls the model should weigh, a custom tool for shared logic, an MCP server for the CRM, a deep-enrichment workflow the agent calls when a lead needs it, and a skill for the scoring rules. In general, start with a block, then move to an agent tool when a model should decide. Reach for the rest only when you need reuse, an external toolset, a sub-workflow, or written guidance.
8185

8286
## Next
8387

0 commit comments

Comments
 (0)