ai-agencee logoai-agencee
branching

orchestration

DAG Orchestration

How to define, wire, and run multi-agent workflows using JSON-declarative directed acyclic graphs.

Overview

A DAG (Directed Acyclic Graph) in ai-agencee is a JSON file that declares named lanes, their checks, and dependency relationships. The engine parses the graph, resolves the execution order, and runs independent lanes in parallel.

Each lane contains an ordered list of check handlers — deterministic validators, LLM generators, or LLM reviewers. A lane completes when all its checks pass (or exhaust their retry budget).

DAG Anatomy

{
  "name": "My First DAG",
  "lanes": [
    {
      "id": "analyse",
      "agentFile": "agents/01-business-analyst.agent.json",
      "dependsOn": []
    },
    {
      "id": "backend",
      "agentFile": "agents/03-backend.agent.json",
      "supervisorFile": "agents/backend.supervisor.json",
      "dependsOn": ["analyse"]
    },
    {
      "id": "frontend",
      "agentFile": "agents/04-frontend.agent.json",
      "dependsOn": ["analyse"]
    },
    {
      "id": "e2e",
      "agentFile": "agents/06-e2e.agent.json",
      "barrier": "hard",
      "dependsOn": ["backend", "frontend"]
    }
  ]
}

Barriers

Hard barrier — all upstream lanes must have `PASS` from their supervisor before the downstream lane starts. Blocks on any failure.

Soft-align barrier — downstream starts once all upstream lanes reach a checkpoint, even if not yet complete. Used for read-contract pattern (Frontend reads Backend API schema without waiting for full implementation).

Supervisors

A supervisor JSON file `agents/my.supervisor.json` contains an ordered list of checks that run after the lane completes. Possible verdicts:

| Verdict | Effect | |---------|--------| | `PASS` | Lane accepted, dependants unlock | | `RETRY` | Re-run the lane with injected guidance | | `HANDOFF` | Pass output to a different lane | | `ESCALATE` | Stop DAG, alert human reviewer |