A chatbot is a sophisticated input terminal. It receives text, calls a model, returns text. That's the entire architecture. For simple use cases — FAQ, reformulation, first-pass ticket triage — it's sufficient. For automating a real business process, it's architecturally inadequate.
Agentic Workflows are fundamentally different: they decompose a goal into tasks, select and invoke tools, maintain state across steps, and iterate until completion — without human intervention at each step. This article covers the technical model and its impact on operational costs.
The Architectural Difference: A Concrete Comparison
Consider a procurement workflow in a Moroccan distribution company: a purchase request arrives, needs supplier availability check, price comparison across 3 databases, compliance check against budget rules, PDF generation, and email dispatch to the approver.
Chatbot implementation
The chatbot receives the request text and responds with "I've noted your request. A team member will process it." That's not automation. That's a form with a language model bolted on.
Agentic Workflow implementation
The agent receives the same request and executes:
- Step 1: Structured data extraction via an entity recognition tool (item, quantity, urgency, cost center)
- Step 2: Parallel tool calls to 3 supplier APIs — concurrent, not sequential
- Step 3: Price comparison function with margin threshold check
- Step 4: Budget rule validation against the ERP database
- Step 5: PDF generation via template engine tool
- Step 6: Email dispatch via SMTP tool with the generated PDF attached
Total elapsed time: 4-8 seconds. Zero human steps. Full audit trail.
A directed acyclic graph (or cyclic, for iterative tasks) of LLM reasoning steps and tool invocations, where the LLM acts as a planner and router — deciding which tool to call, with what parameters, and whether the output satisfies the task completion condition. State is persisted across steps via a checkpointer (Redis, PostgreSQL, or S3-backed).
Multi-Agent Systems: When One Agent Is Not Enough
Single-agent architectures work well for linear workflows with under ~10 steps. Beyond that, you hit two problems: context window saturation (the agent loses track of early steps) and single-point-of-failure (one agent error aborts the entire workflow).
Multi-Agent Systems (MAS) solve both by decomposing the workflow across specialized agents that communicate through a shared message bus or direct function calls:
MAS Topology Options
- Supervisor/Subagent: A coordinator agent routes tasks to specialized subagents (extraction agent, validation agent, dispatch agent). Each subagent has a narrow, well-defined scope. This is the pattern we use for most enterprise automation.
- Pipeline (sequential): Agent A's output becomes Agent B's input. Simple to debug, limited parallelism. Good for document processing chains.
- Parallel (fan-out/fan-in): A coordinator spawns N agents simultaneously, collects results, synthesizes. Use for multi-source research, parallel validation, or aggregation tasks.
LangGraph: Best for complex stateful workflows with conditional branching. The graph abstraction maps directly to your business process diagram. Production-stable. Use for anything with more than 3 conditional branches.
CrewAI: Better developer ergonomics for role-based MAS. The "crew" metaphor works well for orchestrating agents with distinct personas (researcher, analyst, writer). Less suited for deterministic enterprise workflows.
Custom DAG: When you need deterministic execution guarantees, minimal latency overhead, and full observability. Takes longer to build but gives you complete control. We use this for production-critical financial workflows.
The Guardrail Problem: Why Most Production Agents Fail
The single most common reason agentic systems fail in production is not model quality — it's the absence of deterministic guardrails around probabilistic outputs.
An LLM can decide to call the wrong tool, generate a malformed JSON payload, or produce a plausible-sounding output that fails business validation. Without guardrails, this propagates downstream.
The four-layer guardrail stack we deploy on every production agent
- Schema validation: Every tool call payload validated against a strict JSON Schema before execution. Pydantic models in Python. If the LLM generates an invalid payload, the agent retries with an error message (max 3 retries, then escalate to human).
- Business logic layer: Classical rule engine running in parallel with the LLM planner. Catches constraint violations (budget exceeded, unauthorized supplier, restricted item) before they reach execution.
- Output classifier: A lightweight ONNX classifier (50ms inference) that scores each agent output for hallucination probability. If confidence < 0.85, route to human review queue.
- Circuit breaker: If an agent fails 3 consecutive steps, halt and escalate. Never let a failing agent loop indefinitely.
Real ROI Numbers from Moroccan Deployments
Three deployments from 2025, anonymized:
Case A — B2B SaaS, Logistics (Casablanca)
- Workflow: supplier quote processing and approval routing
- Before: 3 FTEs, 72h average cycle, 12% error rate
- After: 1 FTE oversight, 6-minute cycle, 0.3% error rate
- Monthly savings: MAD 18,000. Infrastructure cost: MAD 3,200/month.
Case B — SaaS Platform, Insurance (Rabat)
- Workflow: claims document processing and fraud pre-screening
- Before: 8h human review per claim, 340 claims/month capacity
- After: 12-minute automated pre-screen, 2,400 claims/month capacity (7× throughput)
- Fraud-detection false positives materially lower than manual review
Case C — Internal Tooling, Manufacturing (Tangier)
- Workflow: quality control report generation from sensor data
- Before: 2h/shift for manual report compilation
- After: Fully automated in 40 seconds. Engineers review the report, not produce it.
- Annual productivity reclaimed: 2,920 engineering hours.
Where to Start: The Workflow Audit
Before selecting a framework or sizing infrastructure, do a workflow audit. Walk through your product and mark every step that currently requires a human to: read something, compare options, apply a rule, and produce an output. That is your agent candidate list.
Then prioritize by two axes: frequency (how many times per day) × cost per execution (time × hourly rate). The workflows in the top-right quadrant — high frequency, high cost — are your first deployment targets.
An agent does not replace judgment. It replaces the 80% of work that does not require judgment — the lookup, the formatting, the routing, the comparison — so that the human can focus on the 20% that does.