الدرس 4 · الوحدة 4: Agentic Systems: Manager and Worker Agents
Handoffs between agents: passing context without losing details
- What a handoff is and why details get lost
- How to build a handoff packet that keeps them
- How workers send back a result or a question
Why this matters
When a From the lesson: Designing the manager agent: planning, routing and delegating tasksThe agent that plans work and delegates tasks to worker agents.Review that lesson hands a task to a worker agent, the worker sees only the message it receives. Each short summary along the way can drop a time, an amount or an ID, and the worker then acts confidently on what is left, such as moving a booking to the wrong day or charging a second deposit. Passing details intact is what makes an agent team trustworthy.
Key ideas
- A handoff only carries what it says. The receiving agent never sees the original conversation, so anything left out of the message is gone for good.
- Send a handoff packet. Use the same fixed fields every time: the task as one action name, the facts, the customer's original message, and a done-when line that says what finished looks like.
- Keep facts as fields, not rewording. Write facts as they came, because rewording a message in your own words, which can quietly change a detail turns "morning" into a guessed hour. Point at people and bookings by their unique ID. Fields are written in From the lesson: Structured outputs: making agents return clean JSON every timeStructured outputs: agents return data in a fixed, machine-readable format such as JSON.Review that lesson, like this:
"booking_id": "B-2207"
"new_window": "morning"
- A gate checks before work starts. An IF From the lesson: Triggers, nodes and data flow: reading a no-code workflow in n8nA single step in a no-code workflow, such as a trigger, a filter or an action.Review that lesson stops the task when a required field is empty, before the worker touches the calendar.
- Workers return a status, not a guess. A worker answers done, failed or needs info, and its result lists what changed using IDs. When something is unclear, it asks a question, such as which slot the customer prefers, and the manager passes it on.
Try it before you watch
A booking request arrives with a task and a customer name, but no ID field, and two customers share that name. What should the gate do, and what should the worker do next?
Show answerHide answer
The gate should stop the task and return needs info, because the packet has no ID to act on. The worker must not pick a customer from the name, so the question goes back to the manager. This shows that a name alone is never enough for an action, and the ID field is what makes the work safe.
Words to know
- handoff: passing a task, with its details, from one agent to another.
- handoff packet: a small note in a fixed format, sent with every task.
- unique ID: a code, such as C-1042, that names one customer or booking and never repeats.
- gate: a check step that stops a task when a required field is empty.
- status: the short label a worker returns: done, failed or needs info.
What to watch for
- Which fields the packet carries, and which of them a plain summary would have dropped.
- How the booking agent handles two free slots: it asks a question rather than choosing one.
- What the gate does when one field is left blank, and where it sits in the chain.
تعلّمه مع معلمك على السبورة المباشرة
أهم نقاط الفيديو
The rescheduled appointment that went wrong
- A customer asks to move a booking
- The booking agent finds a Sara
- Maybe the wrong Sara, a guessed time, a new deposit charged
layout: full
parts:
salon: {chip: Salon, sub: "Small beauty salon"}
msg: {chat: "Can I move my Tue 3pm to Thu morning?"}
steps:
- at: "small beauty salon"
highlight: salon
note: "A small beauty salon"
- at: "sends a message"
send: msg
note: "Sara's message"
- at: "passes a note to the booking agent"
note: "The manager passes a note"
- at: "picks Thursday at nine"
note: "Thursday at nine, new deposit"
- at: "still wrong"
note: "Still wrong"
- at: "Nothing broke"
note: "Nothing broke"
- at: "fell out between agents"
note: "Details fell out"
- at: "is called a handoff"
note: "A handoff" What you will learn
- What a handoff is and why details get lost
- How to build a handoff packet that keeps them
- How workers send back a result or a question
layout: full
direction: down
start: none
tree:
Lesson: [Handoff, Packet, Results]
steps:
- at: "learn three things"
show: Lesson
- at: "what a handoff really is"
show: Handoff
- at: "how to design a handoff packet"
show: Packet
- at: "hands the work back"
show: Results
- at: "say exactly what it carries"
highlight: Lesson A handoff is a relay baton
- Sender: lets go of the work
- Baton: the only part that travels
- Receiver: uses what arrives
layout: full
parts:
sender: {chip: Sender, sub: "The manager"}
baton: {chip: Baton, sub: "The message"}
receiver: {chip: Receiver, sub: "A worker"}
relay: {box: Relay race, holds: [sender, baton, receiver]}
steps:
- at: "relay race"
note: "A relay race"
- at: "Here's the sender"
highlight: sender
note: "The sender lets go"
- at: "Now look at the baton"
highlight: baton
note: "The baton"
- at: "the only part that travels"
highlight: baton
note: "Only the baton travels"
- at: "stays behind with the first runner"
highlight: sender
note: "Not in the baton, left behind"
- at: "here's the receiver"
highlight: receiver
note: "Uses what arrives"
- at: "the message the manager writes"
highlight: baton
note: "The baton is the message"
- at: "never sees the original conversation"
highlight: receiver
note: "Sees only the baton"
- at: "unless you put it in the baton"
highlight: baton
note: "Put context in the baton" Three ways details get lost
- Summarising: "wants to reschedule" drops the when
- Paraphrasing: "morning" becomes 9:00
- Missing links: which Sara, which booking
layout: full
parts:
team: {chip: Manager agent, sub: "Writes the summary"}
steps:
- at: "trace Sara's message"
note: "Sara's message"
- at: "each loss looks harmless"
note: "Each loss looks harmless"
- at: "The first loss is summarising"
highlight: team
note: "Loss 1: summarising"
- at: "language model"
highlight: team
note: "Loves short summaries"
- at: "wants to reschedule"
note: "Time is lost"
- at: "the deposit vanish"
note: "Time and deposit gone"
- at: "The second loss is paraphrasing"
note: "Loss 2: paraphrasing"
- at: "rewritten as nine o'clock"
note: "Morning becomes 9:00"
- at: "The third loss is missing links"
note: "Loss 3: missing links"
- at: "which customer record"
note: "Which Sara? Which booking?"
- at: "has to search"
note: "Booking agent searches"
- at: "picks the wrong one"
highlight: none
note: "Wrong slot booked" The handoff packet
- Task: one clear action name
- Facts: IDs, dates, amounts as fields
- Original: the customer's exact words
- Done when: what finished looks like
layout: full
parts:
task: {chip: Task, sub: "reschedule booking"}
facts: {chip: Facts, sub: "IDs and fields"}
orig: {chip: Original, sub: "Exact customer words"}
packet: {box: Handoff packet, holds: [task, facts, orig]}
steps:
- at: "The fix is a handoff packet"
zoom_out: packet
note: "Handoff packet"
- at: "work order in a repair shop"
note: "Same boxes every time"
- at: "It has four parts"
note: "Task, facts, original, done when"
- at: "The task is one clear action name"
highlight: task
note: "One clear action name"
- at: "The facts are the details"
highlight: facts
note: "Customer ID, booking ID, date"
- at: "copied word for word"
highlight: orig
note: "Exact words, to check"
- at: "done when says what finished looks like"
highlight: none
note: "Done when: booking moved"
- at: "the JSON object you pass"
note: "A JSON object"
- at: "booking ID: B-2207"
note: "booking ID: B-2207" Worked example: check the packet first
- Required: every field except keep_deposit
- Gate: an IF step stops the task if one is empty
{
"task": "reschedule_booking",
"customer_id": "C-1042",
"booking_id": "B-2207",
"new_date": "2026-10-08",
"new_window": "morning",
"keep_deposit": true,
"original": "Can I move my Tue 3pm to Thu morning? Same deposit.",
"done_when": "booking moved, SMS sent"
} Point with IDs, not names
- Repeats: two customers both called Sara
- Unique IDs: C-1042, B-2207
- Look up details from the ID, don't retype them
layout: full
parts:
s1: {chip: Sara, sub: "Customer one"}
s2: {chip: Sara, sub: "Customer two"}
cid: {chip: C-1042, sub: "Unique ID"}
pair: {box: Customers, holds: [s1, s2, cid]}
steps:
- at: "Look at these two customer cards"
zoom_out: pair
note: "Two customer cards"
- at: "Both say Sara"
highlight: s1
note: "Both say Sara"
- at: "will have repeats very quickly"
highlight: none
note: "Repeats come fast"
- at: "pick the first match"
highlight: s1
note: "First match picked"
- at: "the unique code your booking system"
highlight: cid
note: "Unique code: C-1042"
- at: "only as a friendly label"
highlight: none
note: "A name is a label only"
- at: "Look up details from the ID"
highlight: cid
note: "Fetch fresh details by ID"
- at: "can't become a wrong appointment"
highlight: none
note: "No wrong appointment" Handoffs across the whole team
- The manager sends a packet to each worker
- Each worker sends a result packet back
- Every packet is saved to a log
layout: wide
direction: LR
components:
customer: {kind: user, label: Customer}
manager: {kind: llm, label: Manager agent}
booking: {kind: worker, label: Booking agent}
invoice: {kind: worker, label: Invoice agent}
log: {kind: database, label: Handoff log}
links: [customer->manager, manager->booking, booking->manager, manager->invoice, invoice->manager, manager->log]
steps:
- at: "a customer writes in"
show: [customer, manager]
- at: "has two workers"
show: all
- at: "follow one request"
highlight: manager
- at: "sends a packet to the booking agent"
flow: ["manager>booking: packet"]
- at: "moves the appointment"
flow: ["booking>manager: done"]
- at: "builds a new packet"
flow: ["manager>invoice: packet"]
- at: "reports that the updated invoice was sent"
flow: ["invoice>manager: sent"]
- at: "every packet is saved"
flow: ["manager>log: saved"]
- at: "you can read exactly what each agent was told"
highlight: log Handing work back: result or question
- Status: done, failed, or needs info
- Result: what changed, with IDs
- Question: asked, never guessed
layout: full
parts:
st: {chip: Status, sub: "Done, failed, needs info"}
res: {chip: Result, sub: "What changed, with IDs"}
qu: {chip: Question, sub: "Asked, never guessed"}
ret: {box: Worker reply, holds: [st, res, qu]}
steps:
- at: "A handoff goes both ways"
zoom_out: ret
note: "Handoffs go both ways"
- at: "returns a small packet"
note: "Worker returns a packet"
- at: "The status says done"
highlight: st
note: "Done, failed, or needs info"
- at: "The result says what changed"
highlight: res
note: "Booking B-2207 moved"
- at: "returns a question instead of a guess"
highlight: qu
note: "Asks, never guesses"
- at: "two free slots"
highlight: none
note: "Nine or eleven?"
- at: "shouldn't pick one"
highlight: none
note: "No guessing"
- at: "which slot does Sara prefer"
highlight: qu
note: "Which slot does Sara prefer?"
- at: "costs far less than an angry client"
highlight: none
note: "A short question costs less" Common mistake: everything or almost nothing
- Dumping the full chat history on every worker
- Or passing a one-line summary only
- Fix: a packet with fields plus the original message
layout: full
parts:
pile: {chip: Everything, sub: "Whole chat history"}
one: {chip: Almost nothing, sub: "One-line summary"}
fix: {chip: Packet, sub: "Fields and original"}
mistakes: {box: Common mistake, holds: [pile, one, fix]}
steps:
- at: "two opposite forms"
zoom_out: mistakes
note: "Two opposite forms"
- at: "The first is the pile"
highlight: pile
note: "Too much"
- at: "gets buried"
highlight: pile
note: "Important detail buried"
- at: "The second is the sticky note"
highlight: one
note: "Too little"
- at: "Both fail for the same reason"
highlight: none
note: "Nobody decided what is needed"
- at: "The fix is the packet"
highlight: fix
note: "Fields plus the original" Exercise: design one packet
- Pick one handoff in your business, e.g. new lead to booking
- Write its packet as JSON with every field
- Mark the required fields, add an IF gate, blank one to test
layout: full
parts:
lead: {chip: Qualified lead, sub: "New lead"}
book: {chip: Booking agent, sub: "Books the slot"}
inv: {chip: Invoice agent, sub: "Sends the bill"}
ex: {box: Example handoffs, holds: [lead, book, inv]}
steps:
- at: "Here's your task"
note: "Your task before the next lesson"
- at: "Pick one real handoff"
note: "One real handoff"
- at: "a qualified lead to the booking agent"
highlight: lead
note: "Lead to booking"
- at: "a finished appointment to the invoice agent"
highlight: inv
note: "Booking to invoice"
- at: "Write its handoff packet"
highlight: none
note: "Packet as JSON, every field"
- at: "mark the required fields"
note: "Mark the required fields"
- at: "add a gate, like an IF node"
note: "IF gate stops empty fields"
- at: "leaving one field blank"
note: "Blank one field to test"
- at: "Keep it small"
note: "Small, done well" Recap
- A handoff is the baton: only what's in it arrives
- Use a packet: task, facts with IDs, original, done when
- Workers return a status, a result or a question
layout: full
parts:
task: {chip: Task, sub: "One action name"}
facts: {chip: Facts, sub: "IDs as fields"}
orig: {chip: Original, sub: "Exact customer words"}
pk: {box: Handoff packet, holds: [task, facts, orig]}
steps:
- at: "Let's recap"
note: "Three takeaways"
- at: "A handoff is the baton"
highlight: none
note: "Only what's inside arrives"
- at: "Use a handoff packet"
zoom_out: pk
note: "One packet every time"
- at: "one task name"
highlight: task
note: "One task name"
- at: "the facts as fields"
highlight: facts
note: "Facts as fields, with IDs"
- at: "the customer's original words"
highlight: orig
note: "Original words"
- at: "a clear done when"
note: "Done when"
- at: "A quick gate before the worker starts"
note: "Gate before the worker starts"
- at: "hand back a status"
note: "Status, result or question"
- at: "never a guess"
note: "Never a guess"
- at: "stops playing telephone"
note: "No more telephone"
- at: "well-run front desk"
note: "A well-run front desk"
- at: "a checker agent"
note: "Next: a checker agent" النص المكتوب
The rescheduled appointment that went wrong. Picture a small beauty salon that runs on an agent team. A customer named Sara sends a message: can I move my Tuesday three o'clock to Thursday morning, same deposit? The manager agent reads it and passes a note to the booking agent that says "customer wants to reschedule." The booking agent finds a Sara, picks Thursday at nine, and charges a new deposit. Every agent did its job, and the result is still wrong. Nothing broke. Details just fell out between agents. Passing work from one agent to another is called a handoff, and it's where most multi-agent systems quietly lose money and trust.
What you will learn. In this lesson you'll learn three things. First, what a handoff really is, and why details get lost when one agent passes work to another, through three quiet slips. Second, how to design a handoff packet, a small structured note that travels with every task so nothing important depends on memory or guesswork. And third, how a worker agent hands the work back: a result, a clear status, or a question when something is unclear. By the end you'll be able to look at any handoff in your own automations and say exactly what it carries and what it might drop.
A handoff is a relay baton. Think of a relay race. Here's the sender, the runner who has finished their lap and lets go of the work. Now look at the baton. It's the only part that travels between the two runners. Whatever isn't in it stays behind with the first runner. And here's the receiver, already moving, who uses what arrives in their hand. In an agent team, the manager is often the sender, a worker is the receiver, and the baton is the message the manager writes. The receiver never sees the original conversation unless you put it in the baton.
Three ways details get lost. Let's trace Sara's message through the team. Slow down here, because each loss looks harmless on its own. The first loss is summarising. The manager is a language model, and it loves short summaries, so "move my Tuesday three o'clock to Thursday morning, same deposit" becomes "wants to reschedule." The time and the deposit vanish. The second loss is paraphrasing. Even when the time survives, "Thursday morning" may be rewritten as nine o'clock, which is a guess dressed up as a fact. The third loss is missing links. The note says Sara, but not which customer record or which booking. The booking agent has to search, and searching is where it picks the wrong one.
The handoff packet. The fix is a handoff packet. It's like a work order in a repair shop: the same boxes every time, so nobody forgets to fill one in. It has four parts. The task is one clear action name, like reschedule booking. The facts are the details as separate fields: customer ID, booking ID, the new date and time window, deposit rule. The original is the customer's message copied word for word, so the worker can check anything the manager got wrong. And done when says what finished looks like, for example booking moved and confirmation text sent. In no-code tools like n8n or Make, this packet is simply the JSON object you pass from one step to the next. JSON is just a simple text format of named fields and their values, like booking ID: B-2207.
Worked example: check the packet first. Here's the packet for Sara's request, written as JSON. Each line is one field with its value. Notice the date is Thursday the eighth, and the time stays a window, morning, exactly as Sara said it, not a guessed hour. Now the gate. Mark which fields are required, then put one check step at the start of the worker. In n8n that's an IF node that asks: is any required field empty? Right now every field is filled, so the packet passes and is safe to hand over. Now imagine a sloppy manager leaves the booking ID blank. The IF node stops the task and sends back needs info, before the booking agent ever touches the calendar. That one gate catches missing details in seconds. Wrong details, like a guessed time or the wrong Sara, are caught by the other two habits: keeping the original message, and looking records up by ID.
Point with IDs, not names. Look at these two customer cards. Both say Sara. A small business with a few hundred clients will have repeats very quickly, and a language model will happily pick the first match it finds. So inside a packet, every person, booking, invoice or order is pointed at by its ID, the unique code your booking system or CRM already gives it. Unique IDs like C-1042 and B-2207 never repeat. Names can travel too, but only as a friendly label. Here's a simple habit to adopt: the worker reads the ID, then fetches fresh details from the system itself. Look up details from the ID, don't retype them. That way, a typo in a handoff can't become a wrong appointment.
Handoffs across the whole team. Now let's zoom out to the whole team. It starts when a customer writes in and the manager agent reads the message. The manager has two workers, a booking agent and an invoice agent, plus a handoff log. Let's follow one request all the way through. The manager sends a packet to the booking agent. The booking agent moves the appointment and sends a result packet back. The manager builds a new packet for the invoice agent, which moves the existing deposit to the new booking and reports that the updated invoice was sent. Finally, every packet is saved to the handoff log. That log is a gift: when something goes wrong, you can read exactly what each agent was told.
Handing work back: result or question. A handoff goes both ways. When the worker finishes, it returns a small packet too. The status says done, failed, or needs info. The result says what changed, using IDs, like booking B-2207 moved to the eighth, at the slot Sara chose. And when something is unclear, the worker returns a question instead of a guess. So what should the booking agent do if Thursday morning has two free slots, nine and eleven? It shouldn't pick one. It returns needs info with the question, which slot does Sara prefer, and the manager asks the customer. One short question costs far less than an angry client.
Common mistake: everything or almost nothing. The most common mistake comes in two opposite forms. The first is the pile: forwarding the entire chat history, every email and every note to each worker. It feels safe, but the important detail gets buried, the model gets slower and costlier, and it may act on an old request from last month. The second is the sticky note: a one-line summary that leaves out the time, the amount and the IDs. Both fail for the same reason, which is that nobody decided what the worker actually needs. The fix is the packet: named fields for the facts, plus the one original message that started this task.
Exercise: design one packet. Here's your task before the next lesson. Pick one real handoff from a small online business, yours or an imagined one. For example, the manager passing a qualified lead to the booking agent, or the booking agent passing a finished appointment to the invoice agent. Write its handoff packet as JSON with every field it needs, including the original message and a done when line. Then mark the required fields and add a gate, like an IF node in n8n or a filter in Make, that stops the task when one is empty. Test it by leaving one field blank and watching the gate catch it. Keep it small, one handoff done well.
Recap. Let's recap. A handoff is the baton between agents, and the receiver only gets what's inside it, so details lost there are lost for good. Use a handoff packet every time: one task name, the facts as fields with IDs instead of names, the customer's original words, and a clear done when. A quick gate before the worker starts catches anything missing. And make workers hand back a status, a result with IDs, or a question, never a guess. With just these habits, your agent team stops playing telephone and starts working like a well-run front desk. Next lesson, we'll add a checker agent that reviews the work.
استكشف الرسوم المتحركة
الرسوم المتحركة نفسها التي في الفيديو، دقيقة وتفاعلية: شغّلها أو أوقفها، أو اسحب المؤشر، أو انتقل إلى أي خطوة بالسرعة التي تناسبك.
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
Loading the animation...
أجب عن كل الأسئلة ثم تحقّق. تنجح بنسبة 70%، ويمكنك إعادة المحاولة كما تشاء.
ملخص الدرس
- القراءة
- مشاهدة الفيديو
- اجتياز الاختبار (70%)
- A handoff is the baton: only what's in it arrives
- Use a packet: task, facts with IDs, original, done when
- Workers return a status, a result or a question