1. Export order → artisan cluster allocation, confirmed in-language on WhatsApp
A buyer PO lands for 900 hand-block pieces across four designs. There is one WhatsApp group per cluster — 'Bagru Team', 'Sanganer New', 'Barmer Ladies Group' — and the export manager works down them one at a time, calling the lead, asking how many they can take, and pencilling numbers into a diary page with the clusters listed down the left margin. Three leads do not pick up. One says 'ho jayega' without a number. The earliest cluster starts cutting cloth against a quantity nobody has written down anywhere, and the buyer is waiting on a ship date.
Trigger: Email / Webhook (buyer purchase order)
How the workflow runs
- Trigger
PO arrives. An Email trigger on the export desk (or a Webhook from the buyer's portal — no first-party connector) catches the purchase order with quantities, designs and the requested ship window.
- Agent
Draft an allocation proposal. An Agent node splits the order across clusters using the craft/skill mapping, historical per-cluster throughput and current open commitments in Knowledge — producing a proposal with a stated reason per cluster, not a round-robin.
- Tool (MCP)
Cap every cluster with your own rule. A user-defined tool (SpEL) computes each cluster's remaining headroom from its documented throughput minus open commitments, minus the safety margin the export manager sets — so 'never load Barmer past 80% in a festival month' is a business setting, not a line in a prompt.
- Loop
Poll each cluster lead, in their language. A Loop node asks every proposed cluster lead on WhatsApp — Sarvam handling Hindi, Bangla, Gujarati or Odia — to confirm the quantity and the date they can actually commit to, with voice-note replies accepted.
- Voice
Accept voice replies. A Voice node transcribes voice-note confirmations, so a cluster lead who does not type still answers in the medium they use every day rather than finding someone's nephew to text for them.
- Condition
Does the confirmed capacity cover the order?. A Condition node compares the sum of confirmed capacity against the PO. A shortfall is never quietly absorbed — it branches to the export manager with the exact gap and the clusters that still have headroom.
- Approval
Export manager commits the allocation. An Approval node holds the final allocation and any buyer-facing ship date. Allocating work commits an artisan family's month and a date to a buyer — the agent proposes, the manager commits.
- Output
Confirm both ways. An Output node sends each cluster its confirmed quantity, design and date on WhatsApp in-language, and the consolidated allocation to the buyer thread on Email; a Tool (MCP) node records it against the PO in the export ERP.
Channels & connectors
- Webhook
- Sarvam (Indian languages)
- Voice
- Knowledge base
- Approval / HITL
- Tool (MCP → export ERP)
Outcome
An allocation proposal grounded in real per-cluster throughput and capped by the manager's own loading rule, confirmed by each lead in their own language, with any shortfall stated as a number — and nothing committed to a buyer or a cluster without the export manager.
Why it helps
The mechanism is parallel in-language polling replacing a serial afternoon of phone calls: every cluster lead is asked at once, in the language and medium they use, their answers land as structured capacity instead of pencil marks, and the shortfall arithmetic is done before a date is promised rather than discovered after.
Build spec
2 agents — 1 allocation-proposal agent + 1 cheap reply-interpreter that runs once per cluster reply inside the Loop. Voice transcription, the headroom formula, the coverage branch and the approval are workflow nodes and tools. · Pattern: Proposal → tenant-authored headroom cap → in-language fan-out poll (Loop) → coverage gate → human commits allocation and date
System prompt (paste-ready)
(Allocator) Propose a split of a buyer PO across artisan clusters for {{exporter}}. Use ONLY the craft/skill mapping, historical monthly throughput and current open commitments in Knowledge, and respect the headroom returned by the capacity tool. Return strict JSON {allocations[{cluster_id, design, quantity, proposed_ready_date, reason, headroom_note}], unallocated_quantity, assumptions[]}. Never allocate a design to a cluster whose skill mapping does not cover that craft, and never propose a quantity above the tool's headroom — if the order exceeds total capacity, leave the remainder in unallocated_quantity rather than spreading it thin. Proposed dates are internal until a cluster lead confirms and the export manager approves.Agent roles & model tiers
Allocation proposer — Standard tier — runs once per PO
PO → per-cluster allocation with a stated reason, bounded by documented skill mapping and the headroom formula. Remainder goes to unallocated_quantity; capacity is never invented to make the order fit.
Cluster-reply interpreter (per reply) — Economy tier — one call per cluster reply, including voice-note transcripts
Turn one cluster lead's in-language reply into {confirmed_quantity, confirmed_date, conditions[], unclear[]}. A partial yes, or a date with no quantity, is marked unclear and gets one short follow-up in their language — never round a hesitant 'ho jayega' up into a confirmation.
MCP connectors
- Export ERP / order book — via Tool (MCP): read the PO lines, and read every cluster's currently open commitments so headroom is computed against reality, not last month's plan
- Export ERP / order book — via Tool (MCP): write the approved allocation against the PO, cluster by cluster, after the manager signs off
- Buyer portal — inbound via Webhook (no first-party connector): receives POs issued on the portal instead of by email
- WhatsApp + Sarvam — cluster-lead polling and confirmation in Hindi, Bangla, Gujarati or Odia, voice notes included
- Email — the buyer's confirmation thread
Built-in tools
- knowledge_search (cluster-scoped collection: craft/skill mapping, historical monthly throughput, cluster working patterns)
- http_request (read the PO and the open order book; write the approved allocation back)
- send_email (consolidated allocation confirmation to the buyer, after approval)
- user-defined tool `cluster_headroom` (SpEL): (input.monthlyThroughput * input.safetyFactor) - input.openCommitments — the export manager owns safetyFactor and can hold a cluster at 0.8 through a festival month or push a reliable one to 1.0, per cluster, in the tool editor. It is arithmetic over the numbers the workflow hands it; it does not read the ERP itself and cannot loop over clusters — the workflow calls it once per cluster.
Guardrails
- No allocation reaches a cluster and no ship date reaches the buyer before the export manager's Approval — a commitment binds an artisan family's month
- Proposals are bounded by the `cluster_headroom` formula and the documented skill mapping; capacity is never invented to make an order fit
- A shortfall is surfaced as an explicit unallocated quantity with the exact gap — never silently spread across clusters
- A partial or hesitant cluster reply is marked unclear and followed up in the lead's own language, never rounded up into a confirmation
- Cluster leads are asked and answered entirely in their own language, by voice note if that is how they work — the English record exists for the office and the buyer, not for them
Cost strategy
One standard-tier proposal per PO, plus one economy-tier interpretation per cluster reply — reply volume scales with cluster count, not order value, which is exactly why the interpreter stays on the economy tier. The headroom formula is SpEL and costs nothing, which is also why the loading policy belongs there rather than in a prompt that would need re-testing every time it changed. Voice transcription is per note, and it is the price of the clusters participating at all.
Output & delivery
A grounded allocation proposal capped by the tenant's own headroom formula → every cluster lead polled on WhatsApp in-language with voice replies accepted → confirmations interpreted into structured capacity → the Condition node exposes any shortfall against the PO → the export manager commits the allocation and the ship date at the Approval node → clusters are confirmed in-language, the buyer on Email, and the allocation written against the PO in the export ERP.