Let's talk

Agentic Architecture

Shiva Agents Workflow Patterns

Master the design patterns required to move from simple chatbots to reliable, production-grade AI agents and multi-agent systems.

By Divyaprakash JhaUpdated 6 min readTopic: Agentic AI

Photo for Shiva Agents Workflow Patterns

Essential Single-Agent Patterns

Shiva Agents provides 23 runnable workflow patterns to help you move beyond simple chatbots. These patterns allow you to build reliable, production-grade AI agents that can reason, plan, and execute complex business tasks autonomously.

Before building complex teams of agents, you must master the fundamental ways a single agent interacts with tools and logic. Most production value in real-world applications comes from a few core patterns that ensure the model stays on track.

ReAct (Reason + Act)

This is the default loop for most tool-using agents. In a ReAct pattern, the agent interleaves a short reasoning step with a tool call. It "thinks" about what to do, performs an action (like searching a database), reads the result, and then reasons again based on what it learned. This is ideal for open-ended tasks like research or troubleshooting where the next step isn't known until the previous one is finished.

Plan-and-Execute

For tasks that require high oversight, the Plan-and-Execute pattern is superior. The model drafts a full, step-by-step plan first. An executor then works through that plan, only re-planning if a specific step fails. This is highly useful for tasks like "migrate these 300 product listings," where a human wants to review and approve the entire approach before the agent starts working.

Router

A Router uses a small, fast model to classify incoming inputs and send them to specialized paths. For example, a customer sends a message to a retail business; the router detects if it is a "billing question" or an "appointment change" and sends it to the specific workflow designed for that topic. This keeps prompts focused and dramatically improves accuracy.

Evaluator-Optimizer

This pattern uses a feedback loop to drive iterative improvement. One step produces a draft, and a second step (the evaluator) critiques that draft against specific criteria. The first step then revises the work based on the critique. This works best when the criteria are concrete, such as "every claim in this report must cite a line from the source document."

Proven Multi-Agent Topologies

When a single agent becomes too complex to manage, you move into multi-agent systems. In these setups, you split work across several agents, each with its own specific role, prompt, and set of tools. This is where you transition from a "chatbot" to an "AI company."

Pattern Name How it Works Real-World Analogy
Assembly-line Each role hands a typed artefact to the next agent in a sequence. A manufacturing line where one person cuts, one assembles, and one packs.
Group Chat A "speaker selector" picks which agent speaks next in a conversation. A meeting moderator calling on different experts to contribute.
Debate Multiple agents argue a point while a judge decides the outcome. A legal debate where a judge evaluates the strongest argument.
Manager and Crew A manager agent plans the work and assigns tasks to specialized workers. A project manager directing a team of developers and designers.
Handoff Network Agents pass control of a task to the most appropriate specialist. A bank teller transferring a client to a mortgage specialist.
Orchestrator-Workers An orchestrator breaks tasks into subtasks and tracks progress via ledgers. A lead architect managing several independent contractors.

Workflows vs. Agents vs. Chatbots

Understanding the distinction between these three is critical for builders to avoid over-engineering or under-delivering. Using an agent when a simple workflow would suffice leads to higher costs and lower reliability.

Feature Chatbots Workflows Agents
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, often unknown in advance
Predictability High High Lower; needs guardrails

Visual Workflow Design in Shiva Agents

Shiva Agents provides a canvas-based design environment, similar to n8n, where you can visually map out complex logic. The power of this approach is that any node on your canvas can be a single agent or an entire team of agents.

The platform offers over 20 different node types to give you granular control. These include:

  • Triggers: Start a process via a manual click, a schedule (cron), a webhook, or a specific event.
  • Logic & Flow: Use branches based on rules or model decisions, fan-out maps, and merge nodes.
  • Human-in-the-loop: Dedicated nodes to "ask a human" or "wait for approval," allowing workflows to pause for days until a person intervenes.
  • Memory & State: Nodes to set state, use memory, or assign tasks to a company-wide inbox.

The most effective way to build is a hybrid approach. Use a workflow as the "outer shell" to define the predictable, high-level business process, and place agentic reasoning steps inside that shell where flexibility is actually needed.

Building Reliable Agentic Architecture

Reliability problems in AI systems are usually "loop problems," not "model problems." To move from a notebook demo to a production system, you must wrap your model in a robust agentic architecture.

The Agent Loop

Every reliable agent follows a cycle of: Goal (receive a task with a clear definition of done), Plan (decide the next step), Act (call a tool), Observe/Verify (read the result and check it), Remember (record what happened), and Repeat or Stop.

Verification and Guardrails

Never rely solely on the model to follow rules. Verification should use cheap, deterministic code (like checking if a sum is correct) or a second "reviewer" model to check work before it is finalized. Guardrails are rules enforced outside the model—such as spending limits or blocked domains—to ensure safety and control costs.

Layered Memory

Effective agents use different memory layers. Working memory (the current context window) is for the immediate task. Episodic memory records past runs, including mistakes and human corrections, so the agent doesn't repeat them. Long-term memory holds permanent facts and documents retrieved on demand.

Making Agents Production-Ready

For a business to actually use agents, the system must be durable and governed. If a server restarts in the middle of a task, the agent shouldn't lose its place. Shiva Agents solves this through durability, using checkpoints after every single step so runs can resume exactly where they left off.

Governance and Safety

As agents gain more autonomy, they need strict oversight. Shiva Agents implements several layers of protection:

  • Audit Logs: Every action is recorded in a hash-chained audit log, creating a permanent, uneditable record of everything the agent did.
  • Risk Classes: Every tool is assigned a risk class (e.g., read, fetch, write, external, critical). An agent's ability to use these tools is gated by its assigned autonomy level.
  • Human-in-the-loop: For risky or critical actions, the workflow pauses and waits for explicit human approval.
  • Resource Management: To prevent "runaway loops" that drain your budget, you can set token and step budgets on every run.

By combining these patterns and safeguards, you can move from experimental AI to a reliable, "always-on" digital workforce. You can explore more about how to implement these via the Shiva Agents guide or by exploring the agent library.

Frequently Asked Questions

What is the difference between a workflow and an agent?
A workflow follows predefined code paths set by a developer, whereas an agent uses a model to decide the next step at runtime to reach a goal.
How many workflow patterns are available in Shiva Agents?
Shiva Agents includes 23 runnable workflow patterns and over 20 workflow node types for building complex agentic systems.
What is the 'ReAct' pattern?
ReAct is a pattern where an agent interleaves reasoning steps with tool calls, reading the results to decide its next action.
Can agents work in teams?
Yes, Shiva Agents supports multi-agent topologies like Handoff networks, Debates, and Manager-Crew structures.
How do you ensure an agent doesn't run indefinitely?
Reliable systems use bounded cycles, token budgets, and step budgets to prevent infinite loops and control costs.
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

What is the difference between a workflow and an agent?

A workflow follows predefined code paths set by a developer, whereas an agent uses a model to decide the next step at runtime to reach a goal.

How many workflow patterns are available in Shiva Agents?

Shiva Agents includes 23 runnable workflow patterns and over 20 workflow node types for building complex agentic systems.

What is the 'ReAct' pattern?

ReAct is a pattern where an agent interleaves reasoning steps with tool calls, reading the results to decide its next action.

Can agents work in teams?

Yes, Shiva Agents supports multi-agent topologies like Handoff networks, Debates, and Manager-Crew structures.

How do you ensure an agent doesn't run indefinitely?

Reliable systems use bounded cycles, token budgets, and step budgets to prevent infinite loops and control costs.