> ## Documentation Index
> Fetch the complete documentation index at: https://labs.prompthon.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Agents Vs Workflows

<div className="not-prose my-4 rounded-md border border-gray-200 bg-gray-50 p-2 text-sm dark:border-gray-800 dark:bg-gray-900/40">
  <div className="mb-2 px-1 text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400">Need help?</div>

  <div className="flex flex-wrap gap-2">
    <a className="inline-flex items-center gap-2 rounded-md border border-gray-200 bg-white px-3 py-1.5 font-medium text-gray-700 no-underline shadow-sm hover:border-gray-300 hover:bg-gray-50 dark:border-gray-800 dark:bg-gray-950/60 dark:text-gray-200 dark:hover:bg-gray-900" href="https://discord.gg/sDE2HhGTg4" target="_blank" rel="noreferrer">
      <Icon icon="discord" iconType="brands" size={14} />

      <span>Ask in Discord</span>
    </a>

    <a className="inline-flex items-center gap-2 rounded-md border border-gray-200 bg-white px-3 py-1.5 font-medium text-gray-700 no-underline shadow-sm hover:border-gray-300 hover:bg-gray-50 dark:border-gray-800 dark:bg-gray-950/60 dark:text-gray-200 dark:hover:bg-gray-900" href="https://github.com/Prompthon-IO/agent-systems-handbook/issues/new/choose" target="_blank" rel="noreferrer">
      <Icon icon="github" iconType="brands" size={14} />

      <span>Open a GitHub issue</span>
    </a>

    <a className="inline-flex items-center gap-2 rounded-md border border-gray-200 bg-white px-3 py-1.5 font-medium text-gray-700 no-underline shadow-sm hover:border-gray-300 hover:bg-gray-50 dark:border-gray-800 dark:bg-gray-950/60 dark:text-gray-200 dark:hover:bg-gray-900" href="https://github.com/Prompthon-IO/agent-systems-handbook/blob/main/SUPPORT.md" target="_blank" rel="noreferrer">
      <Icon icon="life-ring" size={14} />

      <span>Support guide</span>
    </a>
  </div>
</div>

## Summary

Workflows execute a predefined sequence. Agents pursue a goal under changing
conditions. Most real systems sit somewhere between those extremes.

## Why It Matters

Many product and engineering mistakes come from choosing the wrong control
model.

* If the task is stable, using an agent can add cost and unpredictability.
* If the task is ambiguous and changing, using only a rigid workflow can make
  the system brittle and high-maintenance.

Choosing the wrong pattern is often more damaging than choosing the wrong
model.

## Mental Model

The cleanest distinction is about who owns the next step.

* In a `workflow`, the designer owns the next step. The system follows a
  scripted path with explicit branching.
* In an `agent`, the runtime owns the next step. The system chooses actions
  based on the current state, tools, and goal.

This does not mean workflows are simple and agents are advanced. It means they
solve different coordination problems.

Workflows are strongest when:

* the path is known
* the rules are stable
* auditability matters more than flexibility

Agents are strongest when:

* the path is not fully known in advance
* the system needs to search, explore, or adapt
* the environment can change while the task is running

## Architecture Diagram

```mermaid theme={null}
flowchart LR
  Input["Task input"] --> Choice{"Control model"}
  Choice --> Workflow["Workflow: predefined sequence"]
  Choice --> Agent["Agent: choose next step at runtime"]
  Workflow --> Result["Result"]
  Agent --> Result
```

## Tool Landscape

Most useful products are hybrids rather than pure examples of either side.

* A workflow may call an agent for one ambiguous step.
* An agent may operate inside a larger workflow with strict entry, approval,
  and exit points.
* A research or coding system may use workflow-like stages but agentic
  decision-making inside each stage.

That hybrid design is often the practical answer because it preserves
deterministic structure where structure helps, while reserving autonomy for the
parts that genuinely benefit from it.

## Tradeoffs

* Workflows are easier to test and audit, but they are expensive to maintain
  when edge cases keep growing.
* Agents adapt better, but they need stronger safeguards, observability, and
  fallback design.
* Hybrid systems are often best in practice, but they require clearer
  interface boundaries than either extreme.

Useful defaults:

* choose workflows for deterministic business policy
* choose agents for bounded exploration and judgment
* wrap agents with workflow controls when compliance, approvals, or irreversible
  actions matter

## Reading Extensions

* [The Agent Systems](/foundations/the-agent-system)
* [Context Engineering](/systems/context-engineering)
* [Foundations Overview](/foundations)

## Update Log

* 2026-04-21: Initial repo-native draft based on imported reference material and lab rewrite rules.
