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

# How AgentFlow works

> AgentFlow compiles a workflow into a known graph of small, scoped agents and deterministic steps.

export const DocMeta = ({type, applies, owner}) => {
  const LABELS = {
    tutorial: "Tutorial",
    "how-to": "How-to guide",
    explanation: "Explanation",
    reference: "Reference"
  };
  return <div className="e6-meta">
      <span className={type === "how-to" || type === "tutorial" ? "e6-eyebrow" : "e6-eyebrow e6-eyebrow--quiet"}>{LABELS[type] || type}</span>
      {applies ? <span>Applies to: {applies}</span> : null}
      {owner ? <span>Owner: {owner}</span> : null}
    </div>;
};

<DocMeta type="explanation" applies="All deployments" />

## Ask, anticipate, automate

AgentFlow brings three modes into one governed system:

| Mode | What you do |
| - | - |
| **Ask** | Explore data, investigate a problem, or describe an outcome in chat. |
| **Anticipate** | Apply shared semantic context, metrics and domain playbooks as new data and events arrive. |
| **Automate** | Turn repeatable intelligence into compiled workflows, triggers and policy-controlled actions. |

The workflow is what connects an answer worth repeating to an operation the business can trust.

## A workflow is a declarative agent

Most agent platforms give you a chatbot that picks tools at runtime. That's fine for generic tasks, but it's the wrong primitive for proprietary domain knowledge, such as a 14-step quality-deviation investigation, a regional production-yield rollup, or a supplier SLA breach playbook. Those need predictability, auditability and reuse.

In AgentFlow:

* A workflow is a declarative, data-driven way of building an agent.
* Each agentic step of a workflow is a small, scoped agent.
* A workflow is deterministic orchestration of agentic and deterministic steps.

You get the predictability of a workflow (the order of steps, the tools each step can use, the assertions that must pass) and the flexibility of an agent (agentic steps still reason, branch, ask for clarification and call tools).

The orchestration layer compiles the workflow definition into an executable graph. Agentic nodes receive only the tools, prompts and guardrails for their step. Deterministic nodes run their declared tool, transform, Python, branch or pause without a model call.

## Workflows are your IP

Domain workflows are **data**: JSON specs, versioned in storage, not application code. The teams who own the know-how, such as process engineers, quality leads and supply-chain analysts, author and evolve them without engineering changing the application.

## Why compiled is cheaper and safer

Because each step has a focused context and deterministic steps skip the model, a compiled workflow is predictable, fast, cheap and auditable. See [Safe by design](/agentflow/concepts/safe-by-design) for the safety side.

On a 5-step TPC-DS analytics workflow, e6data compared the compiled workflow (per-step scoped agents with per-step prompt caching) with the same spec on an interpreted runtime (one large agent over all steps, no caching):

| Measure | Compiled | Interpreted | Savings |
| - | - | - | - |
| LLM round-trips | 5 | 10 | 50.0% |
| Input tokens | 2,215 | 80,473 | 97.2% |
| Output tokens | 2,116 | 1,948 | −8.6% |
| **Total tokens** | **4,331** | **82,421** | **94.7%** |

The interpreted path used 19.03 times the tokens for the same workflow, data and output. The saving is structural, so it grows as workflows grow.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.