DEV Community

杨子豪
杨子豪

Posted on Originally published at ai.dingboai.com

Agentic workflows: deterministic graphs with AI inside

An agentic workflow is a multi-step business process where deterministic code controls the outer routing, permissions, and safety checks, while a language model or bounded AI agent handles flexible reading, lookup, and writing inside specific nodes. It sits between a rigid rule-based script (which breaks on unstructured text) and an open-ended autonomous loop (which wanders, burns tokens, and cannot be regression-tested reliably).

Architectural diagram showing a deterministic horizontal code pipeline with a bounded amber AI reasoning loop inside one controlled stage

Keep the outer control graph deterministic in code, and place bounded agentic reasoning only inside the steps that genuinely require flexible exploration.

Why pure open-ended loops stall once volume rises

In a demo, giving an LLM ten tools and a single goal—"handle this customer request"—looks effortless. Once thousands of real emails and chats arrive every week, three operational problems appear immediately:

  • Non-repeatable paths: the same customer question triggers two different tool sequences on consecutive runs, so engineers cannot reproduce why one reply succeeded and the next missed a policy rule.
  • Runaway latency and token cost: an unconstrained loop retries failed searches or reads entire case histories repeatedly before producing a simple answer.
  • Blurred authority boundaries: when classification, policy retrieval, decision-making, and execution live inside one free-form loop, prompt edits meant to improve tone accidentally change when a refund or replacement is offered.

For the foundational distinction between fixed pipelines and open loops, see AI agent vs workflow and what is agentic AI.

The production pattern: graph outside, bounded agent inside

On live business operations, the most reliable architecture is a code-defined state graph on the outside with narrowly scoped AI steps on the inside:

  1. Intake and identity verification (code): parse the incoming email or chat turn, match the sender against store records, and separate the current message from historical correspondence.
  2. Targeted fact retrieval (bounded agent or deterministic lookups): call read-only order, carrier tracking, warranty, and knowledge-base tools with a strict step cap. Every tool returns an explicit four-state contract—verified result, confirmed empty, missing input, or lookup failure—so a network timeout is never misread as "no order found."
  3. Fact distillation (code + structured extraction): condense raw threads and JSON payloads into clean, dated facts: what the customer wants this turn, what was promised previously, what has already shipped or been refunded, and what remains unknown.
  4. Decision vs writing separation: select the business disposition under explicit rules first, then pass that fixed disposition to the writing model so the drafter explains next steps clearly without inventing its own refund policy.
  5. Channel-specific exit gates (code + human review): low-risk informational email replies with verified facts can send automatically; anything involving money, replacements, cancellations, or failed lookups stops in the human review queue. Unreviewed live chat never promises manual actions—it creates a support ticket instead.

What this architecture delivers on real volume

We run this exact graph-plus-agent design for an online brand operating across nine storefronts and eight languages. In the 30 days counted on 19 November 2026, the system processed 36,789 incoming customer emails across five mailboxes and answered 15,725 live chat conversations across web, Android, and iOS. AI drafts powered 26,451 sent email replies—including 3,331 sent automatically by the AI at a median response time of 6.3 minutes—while live chat created 1,694 structured tickets whenever a request required human execution. Full operational numbers are documented in the AI customer service case study.

Where to apply agentic workflows beyond support

Because the pattern separates deterministic business controls from language understanding, the same structure transfers directly to other repetitive back-office operations:

  • Supplier and B2B inbox triage: read incoming RFQ or dealer emails, match SKU tables against live inventory, draft itemized replies, and hold price exceptions for manager sign-off.
  • Warranty and claims intake: extract serial numbers, purchase dates, and defect descriptions from customer messages, check warranty rules in code, and prepare ready-to-approve replacement tasks. See AI warranty claim handling.
  • Document and compliance checking: compare submitted forms or invoices against system records, flag exact discrepancies, and route clean items forward. Compare this with screen-level automation in what is RPA.

Checklist before putting an agentic workflow live

  • Can you draw the outer state transitions on one page?
  • Does every external tool have a hard step limit and a distinct failure state? See AI guardrails for customer service.
  • Are irreversible actions—payments, refunds, shipments, account edits—blocked in code until a person approves? See human-in-the-loop AI agents.
  • Can you replay twenty real historical cases end-to-end and inspect the exact input at each node?

We design, connect, and operate custom agentic workflows on your existing systems—whether customer support, order operations, or B2B inboxes—and charge per completed task after a live pilot. Share the workflow eating your team's hours in the form above for a free plan within 24 hours.


Originally published at ai.dingboai.com. Dingbo AI builds and runs AI agents for customer service, paid per completed task.

Top comments (0)