New Tool Radar

AI Agents & Automation

How to Hand Off Work Between Agents with Structured Output

Pass work from one agent to the next as structured output, so nothing is lost in a free-text summary.

Schematic illustration with three step boxes: define the handoff schema, send only the schema, and check the receiver.

A handoff in free text loses facts: the first agent’s summary drops the order number, the second agent guesses it, and the error travels downstream. A structured handoff passes the exact fields the next agent needs, with types and required keys, so the receiver can validate what it got before it acts.

Before you start

Two agents that work in sequence, and a list of the fields the second agent needs from the first.

Define the handoff schema

List every field the receiving agent needs: the task id, the customer, the order number, the amounts, the sources, and the status. Give each field a type and mark which are required.

Keep the schema small: a handoff with thirty fields will be filled badly, while a handoff with eight fields will be filled well.

Send only the schema, not a summary

Have the first agent output the schema object and nothing else. The receiver validates it: all required fields present, types correct, values in range. If validation fails, the handoff is rejected and the first agent is asked to redo it.

Do not let the first agent add a free-text note alongside the schema: the note is where the lost facts hide.

Check the receiver’s work against the handoff

After the second agent acts, check its output against the handoff fields: did it use the right order number, the right amount, the right customer? A mismatch means the handoff was ignored, not that the schema was wrong.

Log every rejected handoff with the reason, so a pattern of missing fields can be fixed in the first agent.

Practice check: fictional Maple Corner handoff: researcher to writer, 8 fields

The table below is fictional practice material, worked out by hand from the stated schema. It is the expected result for the practice handoff, not a run of any agent.

Field Required Value passed Verdict
task_id Yes T-104 Pass
order_number Yes ORD-4821 Pass
total_amount Yes 248.00 Pass
currency Yes USD Pass
source_url Yes Present Pass
status Yes approved Pass
notes No Empty Pass – optional
reviewer Yes Missing Fail – rejected

Seven of eight fields pass, but the required reviewer field is missing, so the handoff is rejected and the researcher is asked to redo it. The rejection is the system working, not failing.

Expected result. UNTESTED: the fields in the practice table are worked out by hand, not measured by running agents. Define the handoff schema for your own two agents, send only the schema, and check the receiver’s work against the fields.

Limits

  • A handoff that cannot be validated cannot be trusted: required fields and types are the validation.
  • Structured output guarantees shape, not correctness: the receiver must still check the values.

Sources

See all