2 ready-to-build workflows

AI agent workflows for Customs brokerage & trade compliance

Collect a complete import/export document set, draft an HS classification and answer clearance questions — while a licensed broker stays the one who classifies and files.

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. Import document collection, completeness gate & HS-code suggestion

For each consignment a broker chases the importer for the invoice, packing list and BOE particulars, checks by hand that the set is complete, then squints at the product description to work out the HS heading — slow, and the missing document only surfaces at the counter.

Trigger: Email (docs inbox) or Webhook (upload)

How the workflow runs

  1. Trigger

    Shipment documents arrive. An Email trigger on the docs inbox (or an upload Webhook) catches the commercial invoice, packing list and BOE particulars for a consignment.

  2. Agent

    Extract fields + check completeness. An intake agent reads each document, extracts the key fields (parties, goods description, values, quantities) and checks the set against the required-document checklist for that trade lane.

  3. Condition

    Completeness gate. A Condition node holds the consignment as WAITING and drafts a precise chase for anything missing; only a complete set proceeds to classification.

  4. Agent

    Suggest the HS classification. A classification-advisor agent proposes a candidate HS code from the goods description, with the tariff heading it reasoned from, a rationale and a confidence — explicitly as a suggestion for a broker to check.

  5. Approval

    Licensed broker classifies & files. An Approval node puts the completed set and the suggested code in front of a licensed customs broker, who confirms or corrects the classification and authorizes filing. The agents never classify with finality and never file.

  6. Tool (MCP)

    File on approval + confirm. Only after the broker approves, a Tool (MCP) node submits the entry to the customs/EDI portal and the importer is notified with the reference.

Channels & connectors

  • Email
  • Webhook
  • Knowledge base
  • Tool (MCP → customs/EDI portal)
  • WhatsApp
  • Approval / HITL

Outcome

Every consignment reaches the broker as a complete, extracted set with a defensible candidate HS code already drafted — so the broker spends their time deciding, not chasing paper and re-typing fields.

Why it helps

The completeness gate stops incomplete sets from reaching the counter, and the HS suggestion gives the broker a starting point with its reasoning attached; the classification and the filing stay human because they are regulated, licensed decisions — the agents assist, they don't decide.

Build spec

2 agents1 document-intake/completeness agent + 1 HS-classification advisor. The completeness gate, broker approval and EDI filing are workflow nodes. · Pattern: Sequential specialists: intake / completeness → classification advisor → licensed-broker approval

System prompt (paste-ready)

(Classification advisor) Propose a CANDIDATE HS classification for the goods, using ONLY the extracted description and the tariff schedule / classification notes in Knowledge. Return strict JSON {candidate_hs_code, tariff_heading, rationale, confidence 0-1, alternatives[]}. You are ADVISORY ONLY: never present a code as final, never authorize or perform a customs filing, and never state duty as owed. A licensed customs broker must review and decide the classification and the filing — if the description is ambiguous, lower the confidence and say what's missing rather than guessing.

Agent roles & model tiers

  • Document intake / completeness Economy tier — fast, cheap; runs once per consignment on routine extraction

    Extract the key fields from the invoice / packing list / BOE particulars and check the set against the required-document checklist for the trade lane. Return {parties, goods_description, values, quantities, checklist_status: COMPLETE|WAITING, missing[], chase_message?}. Copy values exactly — never compute, correct or invent a figure; if a document is missing, draft a short chase for only the missing items.
  • HS-classification advisor Standard tier — reasons over the tariff schedule when the set is complete

    Suggest a CANDIDATE HS code from the extracted description and the tariff schedule in Knowledge, with tariff heading, rationale and confidence. Advisory only — never final, never a filing, never a duty determination; ambiguous → lower confidence and flag what's missing for the broker.

MCP connectors

  • Customs / EDI filing portal (e.g. ICEGATE-type submission) — via a Tool (MCP) node, only after broker approval
  • Document intake — via the Email / upload Webhook trigger
  • WhatsApp — importer chase + confirmation channel

Built-in tools

  • document parsing (PDF/scan → text)
  • knowledge_search (required-document checklist per trade lane + HS tariff schedule / classification notes)

Guardrails

  • No final classification and no filing without the licensed-broker Approval — both agents are advisory; a licensed broker confirms the HS code and authorizes the entry
  • Completeness gate: a consignment is marked COMPLETE only when every checklist item is present, so an incomplete set can never proceed to filing
  • The advisor never states duty as owed and never presents a code as final — it returns a confidence and its tariff-heading reasoning for a human to check, and lowers confidence on ambiguity instead of guessing

Cost strategy

The high-frequency, routine work — extraction and the completeness check — runs on the economy tier, so the per-consignment baseline stays cheap. The standard-tier classification advisor runs only once the set is complete (the gate stops wasted work on incomplete consignments), and a premium model is never required because a licensed human makes the actual call. Cost scales with consignment volume under a per-consignment tool/token cap.

Output & delivery

Documents in → the economy intake agent extracts fields and runs the completeness gate (chasing missing items on WhatsApp) → on a complete set the advisor drafts a candidate HS code with rationale + confidence → the licensed broker confirms/corrects the classification and authorizes filing at the Approval node → a Tool node submits the entry to the customs/EDI portal and confirms to the importer; the draft, the broker's decision and the filing reference are logged.

2. Duty & clearance status Q&A with milestone updates

Importers and exporters phone or email the broker's ops desk all day — 'is my container cleared yet, what stage is it at, how much duty' — and staff break off to look each one up in the portal manually, then repeat it when the status changes.

Trigger: WhatsApp (client query) or Webhook (portal status-change event)

How the workflow runs

  1. Trigger

    Query or status change. A WhatsApp trigger fires on a client question, or a Webhook fires when the customs/EDI portal posts a milestone/status-change event for a consignment.

  2. Agent

    Identify + verify. An Agent node extracts the job/BOE reference from the message and verifies the requester is party to that consignment before disclosing anything.

  3. Tool (MCP)

    Look up live status. A Tool (MCP) node fetches the current clearance stage and duty amount from the customs/EDI portal — the answer is read from the portal, not remembered or estimated.

  4. Knowledge

    Ground any explanation. A Knowledge node grounds any procedure or duty-line explanation in the broker's documented process notes, so the reply explains the status without straying into advice the portal doesn't support.

  5. Output

    Reply or push the update. An Output node answers the client on WhatsApp, or — on a status-change event — proactively pushes the new milestone to the parties on the consignment.

Channels & connectors

  • WhatsApp
  • Webhook
  • Knowledge base
  • Tool (MCP → customs/EDI portal)

Outcome

Clients get an accurate, on-demand clearance-and-duty answer in their own language, and a proactive nudge each time the consignment hits a milestone — without the ops desk breaking off to look it up.

Why it helps

This is the read-only status lane: it removes the highest-volume, lowest-judgement interruptions from the desk while every figure it quotes is read live from the portal — it reports status, it never makes a classification, duty determination or filing decision, so no regulated call is ever automated here.

Build spec

1 agent1 status-lookup agent; the verification, portal read and milestone push are workflow nodes.

System prompt (paste-ready)

You are a customs status assistant for a licensed brokerage. From a client message, extract the job/BOE reference and verify the sender is a party to that consignment before revealing anything. Call the status tool and reply in the client's language with the current clearance stage and the duty amount EXACTLY as the portal returns them. Never estimate a duty figure, never predict a clearance date the portal hasn't given, and never make or confirm an HS classification or a filing decision — those belong to the licensed broker. If the lookup fails or the sender can't be matched to the consignment, say so and hand off to the desk.

MCP connectors

  • Customs / EDI portal (clearance stage + duty status) — via a Tool (MCP) node
  • WhatsApp — query + reply + milestone-push channel
  • Portal status-change events — inbound via the Webhook trigger

Built-in tools

  • http_request (fetch clearance stage / duty status by reference)
  • knowledge_search (documented clearance-procedure notes)

Guardrails

  • Identity check before disclosing any consignment detail — the sender must be a party to the job/BOE referenced
  • Every clearance stage and duty figure is read live from the portal — never estimated, never a predicted date the portal hasn't provided
  • Read-only lane: the agent reports status only and never makes or confirms an HS classification, duty determination or filing — those stay with the licensed broker (see the document-collection recipe's Approval gate)

Cost strategy

Identifying a reference and relaying a portal reading is a light lookup, so this runs on the economy tier — there's no reasoning premium for reporting a status. Proactive milestone pushes are event-driven off the portal Webhook, so you pay per real status change rather than polling, and the whole lane stays cheap because the expensive judgement calls are deliberately not made here.

Output & delivery

A client query (or a portal status-change event) → the agent verifies the requester and reads live clearance + duty from the customs/EDI portal via a Tool node → any explanation is grounded in documented procedure notes → an Output node replies on WhatsApp, or pushes the new milestone to the parties on a status change; lookups that fail or can't be matched to the sender are handed to the desk.

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