Wetel
Go back

What is a sub-agent, and when would I use one?

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?

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?

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.

To set one up, read the Sub-Agent node reference.


Share this post:

Next Post
Waiting for a reply without holding anything up: how an AI employee asks and carries on
Previous Post
Getting structured data out of a conversation: order numbers, dates and categories