4 ready-to-build workflows

AI agent workflows for Textile & apparel manufacturing

Techpack revisions, sampling round-trips, lot decisions and audit packs — chased and assembled automatically, with your own AQL limits encoded as tenant-authored formula tools and every buyer commitment human-approved.

Each recipe below is expressed only in VegaDūta's real workflow building blocks — Trigger, Agent, Knowledge, Condition, Approval, Output, Tool (MCP), Voice, Device, Loop, Code and Parallel — so it maps 1:1 to something you can assemble in the Workflow designer. Consequential actions always pass a human Approval step.

1. Buyer techpack revision → impact assessment before anything is accepted

Rev C arrives at 11:40pm as an attachment called STYLE4471_TECHPACK_revC_FINAL_v2.xlsx. Rev B is somewhere in the shared drive, in a folder named 'latest', next to a folder named 'latest FINAL'. The merchandiser opens both on a laptop at the dining table and scrolls the measurement tab column by column looking for the cells that moved, then messages the fabric store on WhatsApp to ask whether the interlining has already been issued, then guesses at a date because the buyer's mail says 'please confirm by tomorrow'. Cutting starts at 8am and nobody has told them anything.

Trigger: Email / Webhook (revised techpack from the buyer or the vendor portal)

How the workflow runs

  1. Trigger

    Revised techpack arrives. An Email trigger on the merchandising inbox catches the buyer's revision; the same workflow accepts a Webhook push from the buyer's vendor portal (no first-party connector — the portal reaches you via Webhook).

  2. Knowledge

    Pull the in-production spec. A Knowledge node queries the style-master collection — approved techpack, BOM and trim card, scoped to this style only — so the comparison is against what the floor is actually building, not against whichever file was attached last.

  3. Agent

    Diff the revision. An Agent node produces a field-level change list — measurement points, fabric/GSM, trims, print placement, packing — each marked CHANGED / ADDED / REMOVED with the old and new value quoted verbatim from the two documents.

  4. Tool (MCP)

    Score each change with your own rule. A user-defined tool (a SpEL formula authored by merchandising, not code) turns each change row into a severity band using this buyer's own thresholds — so 'a 0.5cm chest change is absorbable, 1cm is not' is a business setting, editable per buyer, not something a developer ships.

  5. Parallel

    Assess the impact three ways at once. A Parallel node fans the scored change list to three assessors — materials, production and costing — so one revision is evaluated on all three axes in a single pass rather than three sequential email threads.

  6. Supervisor

    Merchandiser-supervisor consolidates. A Supervisor agent merges the three assessments into one buyer-facing position: what is absorbable, what moves the ship date, what carries a cost, what is simply not feasible at this stage of the order.

  7. Approval

    Merchandising manager owns the answer. An Approval node holds the whole position — accepting the change, any revised delivery date, any surcharge. A date and a price to a buyer are binding commitments; the agent never sends one.

  8. Sub-workflow

    Trigger re-sampling if the change demands it. If the approved position requires a fresh PP sample, a Sub-workflow node hands off to the sampling recipe below with the style and the accepted change list — one shared sampling workflow, not a copy pasted into every trigger.

  9. Output

    Reply to the buyer + brief the floor. An Output node sends the consolidated response on the buyer's email thread, and a second Output posts the accepted changes to the production floor group on WhatsApp in the line's own language via Sarvam.

Channels & connectors

  • Email
  • Webhook
  • WhatsApp
  • Sarvam (Indian languages)
  • Knowledge base
  • Approval / HITL
  • Tool (MCP → ERP/PLM)

Outcome

Every techpack revision comes back as a quoted, field-level change list scored against this buyer's own tolerance rules, with a materials/production/costing position attached — and no date, cost or acceptance leaves the building without a merchandising manager's click.

Why it helps

The mechanism is grounding plus fan-out plus tenant-owned rules: the diff is quoted from the two documents rather than remembered, the three impact views are produced in one parallel pass instead of three sequential threads, and the 'is this absorbable' threshold lives in a formula merchandising can edit per buyer — so the manager decides on a complete picture on day one instead of assembling it by day three.

Build spec

5 agents1 diff agent + 3 parallel impact assessors (materials / production / costing) + 1 supervisor that consolidates. Parallel, Approval, Knowledge and Sub-workflow are workflow nodes, not agents. · Pattern: Diff → tenant-authored severity scoring → Parallel fan-out (3 assessors) → Supervisor consolidation → human approval → optional sampling sub-workflow

System prompt (paste-ready)

(Diff agent) Compare the incoming techpack revision against the approved in-production techpack + BOM in Knowledge for style {{style}}. Return strict JSON {changes[{area (MEASUREMENT|FABRIC|TRIM|PRINT|PACKING|LABEL), field, old_value, new_value, delta_cm, status (CHANGED|ADDED|REMOVED), source_quote}], unchanged_confirmed: bool}. Quote old_value and new_value verbatim from the documents — if a value is not stated in one of the two documents, set it null and flag it; NEVER infer or normalise a measurement, and never unit-convert. You produce a change list only: you do not accept the revision, do not estimate a date, and do not price anything.

Agent roles & model tiers

  • Techpack diff agent Premium tier — the hard step; a missed measurement change becomes cut fabric. Configure an economy fallback model so a provider outage degrades to a slower, flagged diff rather than a stalled buyer thread

    Field-level diff of revised vs approved techpack/BOM. Verbatim quoted old/new values, null (not guessed) for anything absent, explicit status per field. No acceptance, no dates, no costing.
  • Materials assessor (parallel) Standard tier

    Given the scored change list, state materials impact only: which fabric/trim POs are affected, what is already issued or in transit, what must be re-sourced, and the lead time each supplier document actually states. Cite the document; never invent a lead time.
  • Production assessor (parallel) Standard tier

    Given the scored change list, state production impact only: which cut/sew/finishing operations change, whether cut fabric is affected, whether a new PP sample or re-approval is required, and which line-plan slots move. No dates to the buyer — internal feasibility only.
  • Costing assessor (parallel) Standard tier

    Given the scored change list, state cost impact only, computed from the rate/BOM data supplied — per-unit material delta, extra operations, rework or write-off of committed material. Show the arithmetic. Never round into a 'ballpark' and never present this as a quoted price.
  • Merchandiser supervisor Premium tier — one call, and it produces everything the buyer will read

    Merge the three assessments into one draft buyer position: absorbable changes, changes that move the ship date, changes that carry a cost, changes not feasible at this order stage. Flag every conflict between assessors rather than resolving it silently. Output is a DRAFT for the merchandising manager to approve or edit — never phrase it as a confirmed commitment.

MCP connectors

  • Apparel ERP / PLM — via Tool (MCP): fetch the style master, BOM and trim card, read which fabric/trim POs are already issued or in transit, and read the current line-plan slot for the style
  • Apparel ERP / PLM — via Tool (MCP): attach the approved change note to the style and stamp the accepted revision number (write happens only after Approval)
  • Buyer vendor portal — inbound via Webhook (no first-party connector): receives the revision push and its attachment reference
  • Email — the buyer's own revision thread, replied to in place
  • WhatsApp + Sarvam — floor briefing to the line group in the line's language

Built-in tools

  • knowledge_search (style-scoped collection: approved techpack, BOM, trim card, prior revisions for this style only)
  • http_request (read line plan and issued POs from the ERP/PLM; attach the approved change note back)
  • send_email (reply on the buyer's existing revision thread after approval)
  • user-defined tool `change_severity` (SpEL): input.area == 'MEASUREMENT' ? (input.deltaCm > input.buyerToleranceCm ? 'BLOCKING' : 'ABSORBABLE') : (input.area == 'FABRIC' or input.area == 'TRIM' ? 'BLOCKING' : 'REVIEW') — merchandising authors and edits this per buyer in the tool editor; a fussy account gets a tighter tolerance the same afternoon, with no developer and no deployment. It is a formula over the change row only: it reads fields, compares numbers and returns a band. It cannot call the ERP or loop over the change list — the workflow applies it row by row.

Guardrails

  • The workflow never accepts a revision, commits a delivery date or quotes a surcharge — all three sit behind the Approval node for the merchandising manager
  • Every diff row carries a verbatim source quote; a value absent from either document is returned null and flagged, never inferred — measurements are never normalised or unit-converted silently
  • Severity comes from the tenant-authored `change_severity` formula, so the threshold is auditable, per-buyer and editable by the business — the model never decides what counts as absorbable
  • The supervisor surfaces assessor disagreement instead of resolving it — a costing/production conflict reaches the human as a conflict
  • The floor is briefed and the sampling sub-workflow is triggered only AFTER approval, so no line changes on the strength of an unaccepted revision

Cost strategy

One revision costs: 1 premium diff + 3 standard assessors in parallel + 1 premium consolidation. Parallel buys wall-clock time here, not money — the three assessors cost the same run sequentially or together. Keep the assessors on the standard tier and spend on the two premium calls that bracket them: the diff (where a miss is expensive fabric) and the consolidation (which is what the buyer actually reads). Set an economy fallback model on both premium roles so a provider outage produces a slower flagged answer instead of a dead buyer thread. Revisions are low-volume and high-stakes — the wrong place to economise.

Output & delivery

A quoted field-level change list → each row scored by the tenant's own `change_severity` formula → three parallel impact assessments → one consolidated draft buyer position → the merchandising manager approves or edits at the Approval node → the sampling sub-workflow is triggered if a fresh PP sample is required → an Output node replies on the buyer's email thread while a second Output briefs the floor on WhatsApp via Sarvam, and a Tool (MCP) node attaches the approved change note to the style in the ERP/PLM.

2. Sampling round-trip: buyer comments mapped to actions, with a completeness gate

Fit comments come back as a phone photo of the sample with red-pen circles, plus 40 lines of email under a subject line that has been forwarded six times. The sampling merchant prints it, walks it to the pattern master, translates the comments out loud in Hindi, and writes the actions in a spiral notebook. Two comments contradict each other, one refers to 'the point we discussed on the call', and nobody is sure whether the buyer approved the collar or just did not mention it. The next sample is cut anyway, because the courier pickup is at 6pm.

Trigger: Email / Webhook (buyer comments on a submitted sample)

How the workflow runs

  1. Trigger

    Comments come back. An Email trigger on the sampling inbox (or a Webhook from the buyer's portal) catches the comment sheet for a specific sample submission.

  2. Agent

    Comments → structured actions. An Agent node turns free-text comments into discrete actions: measurement point + revision, trim swap, construction change, or 'approved as submitted' — each tagged mandatory-before-next-round or advisory, with the buyer's own words quoted.

  3. Condition

    Completeness gate. A Condition node checks that every comment maps to exactly one action and that no mandatory point is left ambiguous — an unmapped or contradictory comment is never silently dropped; it branches to one consolidated clarification back to the buyer.

  4. Loop

    One clarification round, not five. A Loop node holds the outstanding-clarification list and re-asks only what is still unanswered, so the buyer receives one consolidated question set per round rather than a trickle of separate mails.

  5. Agent

    Draft the next-round plan. A second Agent node assembles the sample plan: the revised spec sheet for the sample room, pattern and trim actions in execution order, and an internal readiness estimate explicitly marked internal-only.

  6. Tool (MCP)

    Compute the internal ready date your way. A user-defined tool (SpEL) turns the action count and the round type into an internal working-day estimate using the sample room's own documented lead times — a formula the sampling head can retune when the room's capacity changes, without touching the workflow.

  7. Approval

    Sampling head confirms the dispatch date. An Approval node holds the buyer-facing sample dispatch date. A committed sample date drives the buyer's own calendar — the agent proposes it, the sampling head commits it.

  8. Output

    Issue to the sample room + confirm to the buyer. An Output node pushes the action list to the sample room group on WhatsApp in their own language via Sarvam, and confirms the approved dispatch date on the buyer's email thread.

Channels & connectors

  • Email
  • Webhook
  • WhatsApp
  • Sarvam (Indian languages)
  • Knowledge base
  • Approval / HITL
  • Tool (MCP → ERP/PLM sample tracker)

Outcome

Every buyer comment ends up as exactly one traceable action with its source quote attached, ambiguity is resolved in one consolidated round instead of five, and only a human commits the next dispatch date.

Why it helps

The mechanism is the completeness gate: 'every comment is accounted for' becomes a checked fact instead of an assumption, so the next sample is not built against a comment somebody skimmed at 5:40pm — and the clarification loop collapses a trickle of questions into a single round-trip the buyer can answer once.

Build spec

2 agents1 comment-mapping agent + 1 sample-plan agent. The completeness gate, the clarification loop, the date formula and the approval are workflow nodes and tools. · Pattern: Extract → completeness gate → bounded clarification loop → plan → human commits the date

System prompt (paste-ready)

(Comment mapper) You map buyer sample comments to actions for {{style}} round {{round}}. Return strict JSON {actions[{comment_quote, area (MEASUREMENT|FIT|TRIM|CONSTRUCTION|FABRIC|PACKING), action, spec_point, priority (MANDATORY|ADVISORY), confidence}], unmapped[], contradictions[]}. Every action must carry the buyer's own words in comment_quote. If a comment is ambiguous, contradicts another comment, or you cannot tell which measurement point it refers to, put it in unmapped[] or contradictions[] — do NOT guess a spec point and do NOT drop it. 'Approved' is recorded only where the buyer explicitly approves; silence on a point is never approval.

Agent roles & model tiers

  • Comment mapper Premium tier — the accuracy-critical step; a mis-mapped measurement comment costs an entire sampling round and a week of calendar. Economy fallback model configured for outages

    Free-text buyer comments → one discrete action each, with verbatim quote, area, spec point and MANDATORY/ADVISORY priority. Ambiguous or contradictory comments go to unmapped[]/contradictions[], never to a guess. Silence is never approval.
  • Sample-plan agent Standard tier

    From the confirmed action list, produce the sample-room work order: revised spec points, pattern/trim actions in execution order, materials to be pulled, and an INTERNAL readiness estimate taken from the lead-time formula. Label the estimate internal-only — you never state a buyer-facing dispatch date.

MCP connectors

  • ERP / PLM sample tracker — via Tool (MCP): read the submission record for this style and round (what was sent, when, against which spec version)
  • ERP / PLM sample tracker — via Tool (MCP): write the round outcome, the action list and the approved dispatch date back against the submission
  • Buyer vendor portal — inbound via Webhook (no first-party connector): receives comment sheets posted on the portal rather than emailed
  • Email — the buyer's comment thread, for both the clarification round and the confirmation
  • WhatsApp + Sarvam — the sample-room work order, in the room's own language

Built-in tools

  • knowledge_search (style-scoped collection: approved spec, measurement chart, every prior round's comments for this style)
  • http_request (read and update the sample submission record in the ERP/PLM)
  • send_email (consolidated clarification and the approved dispatch confirmation, on the buyer's existing thread)
  • user-defined tool `sample_ready_days` (SpEL): input.round == 'PP' ? input.baseDays + input.actionCount * input.perActionDays + 2 : input.baseDays + input.actionCount * input.perActionDays — the sampling head owns this formula: base days, per-action days and the PP buffer are the room's own numbers, editable when the room's capacity changes, with no developer involved. It is arithmetic over the plan's own fields; it does not read the ERP and cannot iterate the action list — the workflow passes it a count.

Guardrails

  • The buyer-facing dispatch date passes the Approval node — the formula's estimate is explicitly marked internal-only and is never sent as-is
  • Completeness gate: every comment maps to exactly one action or lands in unmapped[]/contradictions[], and the round does not proceed — nothing is silently dropped
  • Every action carries the buyer's verbatim comment, so the pattern master can always see what was actually asked for rather than someone's paraphrase
  • Explicit approval only — a point the buyer did not comment on is never recorded as approved
  • Clarifications are batched per round by the Loop node, so the buyer is never drip-fed questions across a week

Cost strategy

Per round: 1 premium mapping call + 1 standard planning call, plus a cheap re-run of the mapper on each clarification reply. The mapper earns the premium tier because it is accuracy-critical and runs a handful of times per style — not per unit. The plan agent is assembly work and sits on the standard tier; drop the clarification re-mapping passes to economy once the action list is largely settled. The date formula costs nothing — it is a SpEL expression, not a model call, which is precisely why the lead-time policy belongs there rather than in a prompt.

Output & delivery

Comments become quoted, prioritised actions → the completeness gate blocks on anything unmapped or contradictory → one consolidated clarification round per cycle → a sample-room work order with an internal readiness estimate from the tenant's own formula → the sampling head approves the buyer-facing dispatch date → an Output node issues the work order on WhatsApp via Sarvam and confirms the date on the buyer's email thread, with the round written back to the ERP/PLM sample tracker.

3. Inline QC lot call in the supervisor's own language (WhatsApp + Sarvam)

The end-line checker keeps a register on the table — style, bundle, defect, tally marks in pencil. She finds shading across a bundle at 2:15pm, tells the floor in-charge, who sends a 40-second Hindi voice note to a WhatsApp group with 60 people in it. The QA manager is in a buyer meeting on the first floor with his phone face-down. The line keeps running. By the time somebody plays the voice note, two more bundles have gone through, and the decision that had to be made at 2:15 gets made at 5:00 on a bigger, more expensive lot.

Trigger: WhatsApp (line supervisor's defect report — text or voice note)

How the workflow runs

  1. Trigger

    Supervisor reports the defect. A WhatsApp trigger catches the report from the line group — typed or as a voice note, in whatever language the supervisor actually speaks.

  2. Voice

    Transcribe + normalise the language. A Voice node transcribes with Sarvam so Hindi, Tamil, Bangla, Gujarati and Odia are all first-class inputs; nobody has to compose an English message standing at a sewing line.

  3. Agent

    Classify the defect against the AQL plan. An Agent node maps the report to a defect class and severity against the buyer's documented AQL sampling plan and defect glossary in a buyer-scoped Knowledge collection, and asks back for sample size and defect count if the report did not include them.

  4. Tool (MCP)

    Apply YOUR AQL rule, not the model's opinion. A user-defined tool (SpEL) compares the defect rate against this buyer's AQL limit and returns PASS / REVIEW / REJECT_REWORK. QA authors the expression themselves and keeps a different one per buyer — the disposition rule is a business setting with an audit trail, never a sentence buried in a prompt.

  5. Condition

    Within tolerance, or a real call?. A Condition node branches on the formula's band: PASS is logged as an advisory; REVIEW and REJECT_REWORK escalate as a lot decision. The branch is arithmetic against the plan, not a judgement call.

  6. Agent

    Propose accept / rework / reject. The proposal agent drafts the case with the numbers shown: sample size, defects found, the AQL limit being applied, the affected bundle range, and the specific rework operation if rework is the recommendation.

  7. Device

    Flag the line, if a line device is registered. Optional: where a line-side tablet or andon indicator is registered in Device Control, a Device node marks the line as 'lot under QC review' the moment a REJECT_REWORK band is hit — so the floor sees it without waiting for a person to walk over.

  8. Approval

    QA head decides the lot. An Approval node holds the decision. Rejecting or reworking a lot stops a line and costs money — the agent shows the arithmetic, the QA head makes the call, on their phone, from the buyer meeting.

  9. Output

    Decision back to the floor, in-language. An Output node sends the decision to the line group on WhatsApp in the supervisor's own language via Sarvam, with the bundle range and the exact rework instruction; a Tool (MCP) node logs it against the lot in the ERP quality module.

Channels & connectors

  • WhatsApp
  • Sarvam (Indian languages)
  • Voice
  • Device control
  • Knowledge base
  • Approval / HITL
  • Tool (MCP → ERP quality log)

Outcome

A voice note from the floor becomes an AQL-grounded, numbers-shown lot proposal in the QA head's approval queue within minutes, banded by the factory's own rule — and the decision comes back to the line in the language the line speaks.

Why it helps

The mechanism removes the language barrier and the availability barrier at the same time: the supervisor reports in their own language by voice, the disposition band comes from the factory's own auditable formula rather than a model's opinion, and the QA head receives a fully worked comparison instead of a forwarded voice note — so the decision happens while the line can still be stopped cheaply.

Build spec

2 agents1 defect-classification agent (every report) + 1 proposal agent (only reports that breach the band). The disposition rule is a user-defined SpEL tool, not an agent — deliberately, so it is auditable and editable per buyer. · Pattern: Voice/WhatsApp intake → in-language transcription → tenant-authored AQL formula → human lot decision → in-language response

System prompt (paste-ready)

(Classifier) You triage inline QC reports from a garment line. From the transcribed report, return strict JSON {defect_class, severity (CRITICAL|MAJOR|MINOR), lot_ref, bundle_range, sample_size, defects_found, missing_fields[]}. Classify ONLY against the buyer's defect glossary and AQL plan in Knowledge. If sample_size or defects_found is not stated, put it in missing_fields[] and stop — do NOT assume a sample size and never estimate a defect rate. Ask the supervisor for the missing numbers in THEIR language. You never accept, rework or reject a lot; the disposition band comes from the factory's own rule and the decision belongs to the QA head.

Agent roles & model tiers

  • Defect classifier Economy tier — runs on every floor report, including the majority that turn out to be within tolerance

    Transcribed report → defect class, severity, lot/bundle refs and the two numbers that matter (sample size, defects found). Missing numbers are asked back in-language, never assumed. No lot decision.
  • Lot-proposal agent Standard tier — runs only on reports the AQL formula bands as REVIEW or REJECT_REWORK. Economy fallback model so a provider outage still produces a flagged, human-readable case

    Draft the lot proposal with the arithmetic visible: sample size, defects found, the documented AQL limit applied, affected bundle range, recommended action and the specific rework operation. Cite the AQL clause. Present as a recommendation awaiting the QA head.

MCP connectors

  • ERP / quality module — via Tool (MCP): resolve the lot and bundle references the supervisor named, and read which order and buyer the lot belongs to
  • ERP / quality module — via Tool (MCP): write the approved disposition, the defect class and the sample arithmetic against the lot, so the buyer's own inspector can audit it later
  • WhatsApp — the line group, for both intake and the in-language decision
  • Sarvam — transcription of voice notes and in-language reply generation for Indian languages
  • Device Control — optional: set a registered line-side tablet or andon indicator to 'lot under QC review' when the band is breached

Built-in tools

  • knowledge_search (buyer-scoped collection: that buyer's AQL sampling plan, defect glossary and rework SOP — one buyer's plan never answers another buyer's lot)
  • http_request (resolve lot/bundle refs; log the approved decision against the lot)
  • user-defined tool `lot_disposition` (SpEL): input.defectPct > input.aqlLimit ? 'REJECT_REWORK' : (input.defectPct > input.aqlLimit * 0.7 ? 'REVIEW' : 'PASS') — QA writes this in the tool editor and keeps a variant per buyer, because a 2.5 AQL account and a 1.0 AQL account are not the same factory. Changing the review band is a business edit with a version history, not a code change and not a re-prompt. It reads the numbers off the tool input and returns a band; it cannot call the ERP, cannot loop over bundles, and cannot reject anything itself.

Guardrails

  • No lot is ever accepted, reworked or rejected by the workflow — the QA head's Approval is the only path to a disposition, and the line is told only after that
  • The disposition band comes from the tenant-authored `lot_disposition` formula against the buyer's documented AQL limit — the model never sets the threshold, and the rule that was applied is recorded with the decision
  • Missing sample size or defect count blocks the proposal and is asked back to the supervisor in their own language, rather than being assumed
  • Both the inbound transcription and the outbound decision stay in the supervisor's language — the English structured record exists for the office and the audit log, not for the floor
  • Knowledge is scoped per buyer, so one buyer's AQL plan can never be applied to another buyer's lot
  • Every decision is written back against the lot id, keeping the quality log auditable for the buyer's own inspection

Cost strategy

This is the one recipe here with real per-event volume, so tiering carries weight: the classifier runs on every floor report and belongs on the economy tier, while the standard-tier proposal agent runs only on the minority of reports the formula bands as REVIEW or REJECT_REWORK — the SpEL tool plus the Condition node is what keeps that ratio honest, and it costs nothing to evaluate. Transcription is billed per voice note and is the entire reason the floor participates at all.

Output & delivery

A WhatsApp voice note in any supported Indian language → Sarvam transcription → economy-tier classification against that buyer's AQL plan → the tenant's own `lot_disposition` formula bands it → PASS is logged as an advisory, REVIEW/REJECT_REWORK escalate (and optionally flag a registered line device) → a numbers-shown proposal → the QA head approves on their phone → the decision returns to the line group in the supervisor's language and is logged against the lot in the ERP.

4. Compliance-audit document pack: assembled, expiry-checked, gap-listed

The buyer mails on a Friday that a social audit is booked for the 22nd. The compliance officer opens a shared drive folder called AUDIT DOCS FINAL, which contains sub-folders by year, one called MISC, and one called MISC 2. The fire NOC is a phone photo of a photocopy. The ESI challans are in the accountant's email. The wage register for the required month is in a different building. Machine calibration certificates are in a lever-arch file on top of a cupboard. Everyone finds out which ones expired last quarter when the auditor asks for them, at the table, in front of the buyer's representative.

Trigger: Webhook / Email (audit announcement from the buyer or the audit platform)

How the workflow runs

  1. Trigger

    Audit is announced. A Webhook from the buyer's audit platform (no first-party connector) or an Email announcement starts the pack, carrying the audit standard and the visit window.

  2. Knowledge

    Load the checklist for that standard. A Knowledge node pulls the document checklist for the specific standard and version being applied, from a compliance-scoped collection — so the pack is built against that auditor's requirement list rather than a generic one.

  3. Loop

    Map: check every required document. A Loop node runs a cheap checker once per checklist line — present, current version, inside its validity window on the audit date, covering the required period.

  4. Agent

    Per-document verdict. The checker returns strict JSON per line: PRESENT_VALID / PRESENT_EXPIRED / WRONG_PERIOD / MISSING / UNREADABLE, with the document reference, its printed validity date and the owning department.

  5. Tool (MCP)

    Renewal urgency, on your own thresholds. A user-defined tool (SpEL) converts days-to-expiry versus days-to-audit into an urgency band — the compliance head sets what counts as CRITICAL, because a fire NOC renewal and a calibration certificate do not have the same runway in every state.

  6. Agent

    Reduce: readiness report + owner-wise gap list. A reducer agent rolls the verdicts into a readiness report — ready, expiring before the audit date, missing, unreadable — split by owning department with the lead time each renewal SOP actually states.

  7. Output

    Chase the owners where they actually are. An Output node sends each department owner their own gap list — WhatsApp in-language via Sarvam for floor, admin and maintenance owners; Email for HR and finance — instead of one broadcast that nobody owns.

  8. Approval

    Compliance head releases the pack. An Approval node holds the assembled pack before anything is submitted to the buyer or uploaded to the audit platform — a submitted pack is a formal representation about the factory, so a named human signs it off.

Channels & connectors

  • Webhook
  • Email
  • WhatsApp
  • Sarvam (Indian languages)
  • Knowledge base
  • Approval / HITL
  • Tool (MCP → document store, audit platform)

Outcome

By the day after the announcement there is a per-document verdict, an owner-wise gap list already in the right people's hands with an urgency band on each item, and a pack nobody submits until the compliance head releases it.

Why it helps

The mechanism is exhaustive per-line checking plus routing: every checklist line gets its own cheap pass — including the validity-date arithmetic against the audit date that a Friday-evening manual review always skips — and each gap goes to the person who can actually close it, in the channel they read, banded by the factory's own idea of what is urgent.

Build spec

2 agents1 document checker (once per checklist line via the Loop) + 1 reducer that writes the readiness report. Loop, Knowledge and Approval are workflow nodes; the urgency band is a SpEL tool. · Pattern: Map-reduce over the checklist → tenant-authored urgency banding → owner-wise routed chase → human releases the pack

System prompt (paste-ready)

(Checker) Verify ONE audit-checklist line for an audit on {{audit_date}} under standard {{standard}}. Return strict JSON {checklist_item, status (PRESENT_VALID|PRESENT_EXPIRED|WRONG_PERIOD|MISSING|UNREADABLE), doc_ref, valid_until, covers_period, owner_dept, note}. Compare valid_until against {{audit_date}} — a document expiring before the audit date is PRESENT_EXPIRED even if it is valid today. If a date is unreadable or the file is a scan you cannot parse, return UNREADABLE; never assume a document is valid because it exists, and never infer a validity period that is not printed on it.

Agent roles & model tiers

  • Document checker (per checklist line) Economy tier — runs once per line across the whole checklist, so its tier sets the cost of the run

    One checklist line → presence, version, validity-vs-audit-date and period coverage, as strict JSON with the document reference and owning department. UNREADABLE rather than assumed-valid. No pack-level judgement.
  • Readiness reducer Standard tier — reasoning. Economy fallback model so the report still lands during a provider outage, flagged as degraded

    Aggregate the per-line verdicts into a readiness report: ready, expiring before the audit date, missing, unreadable. Split gaps by owning department, attach the renewal lead time each documented SOP states, and flag any gap whose lead time exceeds the days remaining. Use only the verdicts supplied — never assert a document exists that no verdict covers.

MCP connectors

  • Compliance / document store — via Tool (MCP): list the documents filed against each checklist line and fetch the file for parsing
  • Compliance / document store — via Tool (MCP): file the released pack and its manifest against the audit record
  • Buyer audit platform — inbound announcement via Webhook, and submission via Tool (MCP): upload the released pack against the scheduled audit (no first-party connector, and the upload happens only after Approval)
  • HRMS / statutory-filings system — via Tool (MCP): read the latest ESI/PF challan references and wage-register periods so the checker is comparing against what was actually filed
  • WhatsApp + Sarvam / Email — owner-wise gap chasing in each owner's channel and language

Built-in tools

  • knowledge_search (compliance-scoped collection: the checklist for this standard and version, renewal SOPs and documented lead times)
  • http_request (list and fetch documents from the store; upload the released pack)
  • web_search (optional: check whether the published standard has a newer revision than the one in Knowledge — anything found is raised to the compliance head as a lead to verify, never treated as fact or used to alter the checklist automatically)
  • send_email (owner-wise gap lists to HR and finance, on their existing threads)
  • user-defined tool `renewal_urgency` (SpEL): input.daysToExpiry < 0 ? 'EXPIRED' : (input.daysToExpiry < input.leadTimeDays ? 'CRITICAL' : (input.daysToExpiry < input.daysToAudit ? 'EXPIRES_BEFORE_AUDIT' : 'OK')) — the compliance head owns the thresholds, because a fire NOC and a calibration certificate have different runways in different states, and the same factory may face two standards with different tolerance. Pure arithmetic over the verdict row; it cannot fetch a document or iterate the checklist.

Guardrails

  • Nothing is submitted to the buyer or uploaded to the audit platform before the compliance head's Approval — the pack is a formal representation about the factory
  • Validity is arithmetic against the audit date, not against today; a certificate expiring mid-window is reported as expired, and the urgency band comes from the tenant's own formula
  • A document that cannot be parsed is UNREADABLE and gets chased — never counted as present
  • The reducer may only report on lines a checker actually returned; an absent verdict is a gap, never an assumption of compliance
  • web_search results are treated as leads for a human to verify, never as an authority that changes the checklist — the checklist of record stays in Knowledge
  • Gap lists are routed per owning department in that owner's own channel and language, so accountability is individual rather than a group broadcast

Cost strategy

Cost is linear: N checklist lines × economy-tier checker + ONE standard-tier reduce. The checker's tier is the dominant lever because it runs across the whole checklist — and its job is deliberately narrow (presence, version, two date comparisons) precisely so it can stay there. The urgency banding is a SpEL expression and costs nothing, which is the right home for a policy that changes per standard. Run the map in Parallel batches to compress wall-clock time without changing per-line cost.

Output & delivery

The checklist for that standard is mapped line by line by a cheap checker → each verdict banded by the tenant's own `renewal_urgency` formula → a reducer produces the readiness report and an owner-wise gap list with lead times → each owner is chased on WhatsApp via Sarvam or Email → the compliance head releases the assembled pack at the Approval node → only then does a Tool (MCP) node upload it to the buyer's audit platform.

Related industries

Build one of these in minutes

The sandbox gives you a live agent workspace — no account, no card. Or head back to the full catalogue and compare patterns across every industry.

See how VegaDūta compares to n8n, Dify and BotpressWhy VegaDūta's architectureEstimate your WhatsApp API costs