Let's talk

AI Design Patterns

What is an Agentic Workflow?

Unlike standard chatbots, agentic workflows use iterative loops to plan, use tools, and self-correct until a goal is achieved.

By Divyaprakash JhaUpdated 6 min readTopic: Agentic AI

Photo for What is an Agentic Workflow?

Defining the Agentic Workflow

An agentic workflow is a software design where an LLM works toward a goal by itself through a continuous loop. Instead of just answering a question, the system uses a cycle of planning, acting, and verifying to complete complex tasks autonomously.

In a standard setup, you ask a question and get an answer. In an agentic workflow, you give the system a goal—such as "Reconcile last month's GST invoices against the bank statement and flag mismatches"—and the system figures out the steps to get there.

The model acts as the decision-maker inside this loop, but the loop itself is implemented in ordinary, testable code. This code is what makes the process reliable and safe for business use.

The Agentic Loop

Every agentic system, regardless of how advanced it is, runs a version of this continuous cycle:

  • Goal: The system receives a task with a clear definition of what "done" looks like, along with specific constraints and a budget.
  • Plan: The model decides the next step or drafts a full plan for the entire task.
  • Act: The model calls a tool, such as a database query, an API call, or a file write.
  • Observe and Verify: The system reads the result of the tool. It checks: Did the invoice total match? Did the API return an error?
  • Remember: The system records what happened so that later steps, or even later runs, can use that information.
  • Repeat or Stop: The system continues, re-plans, asks a human for help, or finishes and reports the result.

Workflow vs. Chatbot vs. Agent

To build effective AI, you must understand the difference between these three patterns. Choosing the wrong one can lead to systems that are either too rigid to be useful or too unpredictable to be safe.

Feature Chatbot Workflow Agent
Who decides the next step? The user, one message at a time The developer, in code The model, at runtime
Use of Tools Rarely Yes, at fixed points Yes, chosen per step
Steps per Task One reply Fixed and known Variable and often unknown
Predictability High High Lower; needs guardrails

For example, a chatbot might answer "What are your clinic hours?" A workflow might follow a fixed path to send a WhatsApp template when a new lead arrives. An agent might look at a clinic's schedule, check for cancellations, message waitlisted patients, and rebook them without a human guiding every single click.

The Essential Components

Building an agent requires more than just a prompt. You need a robust agentic architecture that includes several key layers:

1. The Model

The language model is the engine. It reads the goal, the history, and the tool results to choose the next action. For efficiency, many builders use a "strong" model for complex planning and a "small, cheap" model for routine tasks like classifying a message or following simple instructions.

2. Tools

Tools are functions the model can trigger to interact with the real world. Examples include search_invoices(gstin, month) or send_whatsapp(template_id, phone). It is vital that tools have narrow scopes and clear names. A tool that returns 40,000 rows of data at once is considered a bug because it will overwhelm the model's memory.

3. Memory

Memory allows the agent to maintain context over time. This is usually split into three types:

  • Working Memory: The current context window (the goal and recent steps). Because this is limited, you should summarize old steps rather than keeping everything.
  • Episodic Memory: A record of past runs. This helps the agent learn from mistakes, such as remembering that a specific manual correction was made last week.
  • Long-term Memory: Facts and documents (like a company's price list) that are retrieved on demand using search or embeddings.

4. Verifier

A verifier checks the work before it is finalized. This can be a piece of code (e.g., checking if a sum is mathematically correct), a second model acting as a reviewer, or a test suite. Whenever possible, use cheap, deterministic code checks instead of relying on the model's own judgment.

Common Agentic Patterns

You do not need to invent a new way of working every time. Most successful systems use one of these proven patterns:

  • ReAct (Reason + Act): The model interleaves short reasoning steps with tool calls. It is the standard for open-ended tasks like troubleshooting.
  • Plan-and-Execute: The model writes a full plan first. An "executor" then works through it, only re-planning if a specific step fails. This is great for tasks like "migrate these 300 product listings" where a human wants to review the plan before it starts.
  • Router: A small, fast model acts as a traffic controller. It sends a billing question to a billing flow and a complaint to a human, ensuring each path uses the most specialized tools.
  • Orchestrator-Workers: An orchestrator breaks a large task into subtasks and hands them to different "workers." This is useful when the subtasks cannot be known in advance.
  • Evaluator-Optimizer: One step produces a draft, and a second step critiques it against specific criteria (e.g., "every claim must cite a source document"). The first step then revises the draft based on that critique.

For more on how these patterns are applied in complex systems, see our guide on what is agentic AI.

Ensuring Reliability and Safety

Most reliability problems in agentic systems stem from loop design rather than the model itself. If an agent gets stuck in an infinite loop or spends too much money, it is usually because the code surrounding the model failed to set limits.

Guardrails and Approvals

Guardrails are rules enforced by your code, such as spending limits, blocked domains, or allowed tool lists. Human approval acts as a critical pause point. For risky actions—like issuing a refund or sending a mass email—the system should stop and wait for a person to click "Approve."

Durability and Audit Trails

Production-grade systems need durability. If a server restarts mid-task, the system should use "checkpoints" to resume from where it left off. Additionally, every action should be recorded in an audit log so that you can see exactly what the agent did and why.

The Hybrid Approach

While "free-roaming" agents are exciting, they are often too unpredictable for core business processes. The most effective production systems are actually hybrids.

In a hybrid system, the "outer shell" is a predictable, traditional workflow that humans can reason about and control. Agentic steps are then embedded inside that workflow only where flexibility is truly needed—such as parsing an unpredictable email or deciding which tool to use to solve a specific customer problem.

This approach gives you the best of both worlds: the intelligence of AI and the reliability of traditional software.

Tips for Builders

If you are just starting to build with agents, follow these three rules of thumb:

  1. Start Small: Begin with a single agent using simple patterns (like a Router or a Plan-and-Execute) before trying to build complex multi-agent teams.
  2. Prioritize Reliability over Benchmarks: Don't just look for the model with the highest "intelligence" scores. Look for the model that is most reliable at tool-calling and following your specific instructions.
  3. Use Deterministic Checks: If you can check a result with a simple piece of code (like checking if a number is greater than zero), do it. Don't waste money or "intelligence" asking an LLM to do a job a simple math function can do better.

For practical examples of these concepts in action, explore our collection of agentic AI examples in real life.

Yellow robotic arm operating inside a glass enclosure with a monitor above.
Photo: Robot arm works on a small component in a lab setting by Shixart1985, CC BY 2.0

Questions people ask

How does an agentic workflow differ from a standard LLM prompt?

A standard prompt is a single request-response interaction. An agentic workflow is an iterative loop where the model plans, uses tools, and checks its own work to reach a goal.

Do I need a large model for an agentic workflow?

Not necessarily. Many systems use a strong model for complex planning and smaller, cheaper models for routine tasks like classification or routine steps.

What are the risks of using agentic workflows?

Risks include unpredictable step counts, potential for infinite loops, and costs. These are managed through budgets, step limits, and human-in-the-loop approvals.

What is the role of a 'tool' in an agentic workflow?

Tools are functions (like an API or database query) that the model can trigger to interact with the real world and gather new information.

When should I use a multi-agent system?

You should add more agents only when roles truly differ and a single agent cannot efficiently manage the complexity of the task.