A sub-agent is another AI employee that a workflow hands a piece of background work to, using a sub_agent step. It never talks to the customer: it works on a separate conversation nobody is watching, and the first AI employee gets the results back and decides what to say.
Think of a front-desk colleague who takes a question, sends two short notes to specialists in the back office, waits for both answers, and then replies to the customer in their own words. The customer only ever speaks to the front desk. A person on your team decides which specialists exist and publishes their workflows, the same as for any other AI employee.
How does a sub-agent step work?
You list one or more targets. Each target is another agent in your workspace plus a short opening message, written as a template, that tells it what to do. All targets start at the same time, not one after another, and each runs as its own independent session with its own turn history.
The opening message is all the target sees. It does not inherit the first conversation or its variables, so give each one enough to do its job, not the whole transcript.
The answers land in one variable you name, as a list in the same order as your targets:
Array<{ agentId: number; status: "ok" | "timeout" | "error"; text?: string; // present only when status === 'ok' error?: string; // present only when status !== 'ok'}>;A later step, usually an llm step, reads each entry (for example {{specialistAnswers.[0].text}}) and writes the one reply the customer sees.
flowchart LR C["Customer message"] --> F["Front-desk workflow"] F --> S{{"sub_agent step"}} S --> A["Billing specialist<br/>(own session)"] S --> B["Technical specialist<br/>(own session)"] A --> R["Results list"] B --> R R --> L["llm step writes one reply"] L --> C2["Reply to the customer"]When does it help?
- Several lookups that do not depend on each other. They run side by side rather than one after another, and one slow or failing target does not hold up the others’ clocks.
- A specialist with its own job. A billing agent with its own workflow and tools can serve several front-desk agents, and you change it in one place. A longer build story shows several running at once.
When is it the wrong tool?
When one simple step would do. If one llm or action step can answer, a sub-agent only adds another session, another workflow to publish and another place to look when something breaks. If you are unsure where a step ends and an agent begins, tools, workflows, skills and agents sets out the difference.
What are the limits?
- One to ten targets per step; more is refused when you save or publish.
- Same workspace only, checked each time the step runs.
- Each target must have a published workflow. This is not checked when you publish the first workflow; a target without one comes back as
errorat run time. - A timeout per target: 30 seconds by default, never more than 2 minutes.
- Depth is capped at 5. A sub-agent may call its own sub-agents, but a chain deeper than five is refused, which stops an accidental loop.
- No questions or approvals inside. An
await_replystep in a sub-agent is refused and recorded as an error for that target, because nobody could answer it. Anapprovalstep in a sub-agent target pauses that target and is reported to the master asawaiting_approval(pilot, on the test environment; not in production yet).
What happens when one fails?
The others carry on. A target that errors or times out gets status: "error" or "timeout" and an error text instead of text; the step itself does not fail. Check each entry’s status before using its text.
Nothing is retried. A target that timed out may already have done real work, such as calling another system, so running it again is not safe. If you want a retry, build it into your workflow on purpose.
How do I see what each one did?
In two places. The first conversation’s run record shows the results list with each target’s status. Each sub-agent runs its own workflow as its own run, in its own session, so its steps are in that session’s run record, not the parent’s.
What does it cost?
Each target is a full session with its own cost tracking, so three targets means three workflows run for one customer message. The docs give no separate price for the step itself.
Related reference docs
- Sub-Agent node: targets, timeouts and the result list
- Sub-Agent gotchas: published targets, the depth cap, no retries
- Workflows overview: graph size and run limits: a sub-agent’s run has its own budget
- Core concepts: agents, workflows and sessions
To set one up, read the Sub-Agent node reference.