Agent Workflow Orchestration
Thirty-eight agent workflows declared as YAML capability graphs, each with ordered and parallel steps, an autonomy mode, a token budget and required evidence.
Runtime state: The catalog is complete and version-controlled, but it has never been seeded into the database and every run path is gated behind an environment flag that is unset. Meanwhile a separate, simpler path in the same worker has completed more than 53,000 agent runs — so agents are working, just not through these definitions.
- Business objective
- Express agent work as reviewable declarative graphs rather than prompt strings, so what an agent may do is a file someone can read in a pull request.
- Trigger
- A cron schedule, an event on the trigger stream, or a manual run.
- Inputs
- A workflow definition naming a capability and its ordered steps
- A per-schedule budget in tokens, tool calls and runtime seconds
- Retrieved context from the knowledge engine
- The autonomy mode permitted for that capability
- Outputs
- A recorded run with per-step timings, tool calls and artifacts
- Findings or a proposed change, depending on mode
- Required evidence attached to the run
Why declare rather than prompt
An agent defined by a prompt inside a function is invisible to review. You cannot diff it meaningfully, you cannot tell what tools it can reach, and you certainly cannot tell what it is allowed to change.
So the unit here is a file. Each workflow declares:
- the capability it serves — the thing being done, from a registry
- its steps, each naming one tool, with
depends_onfor ordering and a parallel group for steps that can run together - its autonomy mode — observe, assist or autofix
- the tools it may use, each marked primary or supporting
- the evidence a run must produce to be considered complete
That is reviewable. Someone can look at a pull request and say "this workflow should not be in autofix" before it ever runs.
Scale of the catalog
| Declared | Count |
|---|---|
| Workflow definitions | 38 |
| Capabilities | 41 |
| Tools | 15 |
| Cron schedules, each with its own budget | 36 |
| Event trigger rules | 6 |
| Predefined chains | 2 |
The 38 group into diagnostics and incident response, single-tool utilities, infrastructure monitoring, orchestration control loops, research and learning, governance and executive planning, and offer intelligence. Exactly one is declared in autofix mode; the rest observe or assist.
The workflow
Trigger to recorded run
Every path converges on the governance gate before anything executes.
- Automated software
Trigger
Decision point: One of three: a cron schedule, an event on the trigger stream, or a manual run. There is no fourth.
- Approval gate
Event rules with dedup windows
Decision point: Six rules map an event to a workflow and a mode — a dead-lettered job, an exhausted offer cap, a score drop, an earnings drop, a bounce spike, a placement drop. Each carries its own dedup window so a flapping signal cannot storm the queue.
- Automated software
Resolve the definition
Load the workflow by key: its capability, steps, required evidence and declared tools.
- Approval gate
Governance gate
Decision point: Seven sequential checks before execution. Documented separately — nothing runs without passing all of them.
- Data store
Retrieve grounded context
Hybrid search over curated documentation, so the agent reasons from written architecture rather than inferring it.
- AI / LLM
Execute steps under budget
Ordered by depends_on, with parallel groups running together. Bounded by the schedule's token, tool-call and runtime ceilings.
- Approval gate
Approval gate for autofix
Decision point: Requiring approval for autofix defaults to on. The run parks in an awaiting-approval state and resumes only after a human approves — and resumption re-verifies both the approval and the run state rather than trusting the first check.
- Data store
Record the run
Per-step timings, tool calls, artifacts and required evidence, so the run is auditable rather than reconstructed from logs.
- Monitoring / feedback
Chain continuation
Decision point: Two chains exist — one for offer optimization in observe mode, one for campaign optimization in assist. A chain passes the prior run forward, stops on error outside observe mode, and halts at an approval gate rather than stepping over it.
- Automated software
- AI / LLM
- Data store
- Approval gate
- Monitoring / feedback
Decision points
- Which capability does this task want? Free-text intent is routed to a capability by weighted pattern matching before a workflow is chosen.
- Has an equivalent event fired inside the dedup window? If so, drop it.
- Which mode is this capability permitted to run in? Resolved by the governance gate, not by the definition's own wish.
- Does this run need approval? Autofix does, by default.
- Continue the chain? Only outside error states, and never past an approval gate.
Responsibilities
AI / LLM
- Executing a step's reasoning within its tool and token budget.
- Routing free-text intent to a capability, with pattern matching as the fallback.
- Producing findings or a proposed change.
Deterministic
- Definition loading, step ordering and parallel-group scheduling.
- Every dedup window and rate limit.
- Budget enforcement in tokens, tool calls and runtime.
- The seven governance checks.
- Run, step and tool-call persistence.
- Chain sequencing and halt conditions.
Human approval points
- Adding or changing a definition — it is a file, so this is a code review.
- Any autofix run, which parks awaiting approval by default.
- Escalating a capability's permitted mode.
Failure handling
| Failure | Response |
|---|---|
| Budget exhausted mid-run | The run ends and is recorded as exhausted. Repeated exhaustion means the task is mis-scoped, not that the ceiling is wrong. |
| A step's tool fails | Recorded against the step. Non-observe chains stop rather than continuing on a broken prior result. |
| Event storm | Per-rule dedup windows collapse it. |
| Workflow disabled by risk score | The orchestrator refuses it up front rather than starting and aborting. |
| Approval never given | The run stays parked. It does not time out into execution. |
| Definition references an unknown tool | Caught at seed time — which is also how I know one declared tool is referenced by no workflow. |
Monitoring
Runs and steps per agent, budget exhaustion rate, dedup collapse ratio, approval queue depth and age, chain completion rate, and — the one that matters most for this workflow — how many runs carry a workflow key versus none.
Business value
A prompt in a code path is unreviewable. A YAML graph with named steps, declared tools and a budget can be diffed, questioned and refused before it ever executes.
Related projects
- AI Agent Governance and Knowledge PlatformStatus: Partially operational
The controls that let AI agents work against a live system — spending limits, an explicit list of permitted actions, a staged rollout, and search that grounds them in real documentation.
- Using AI to Improve Product DevelopmentStatus: Live internal tool
The development process behind the other case studies — written requirements, scoped tasks, AI coding tools, automated pre-release checks and human approval on every production change.
Related workflows
- Agent Job Governance Gate
Seven sequential checks between an agent job being scheduled and it being allowed to run, each producing an audited allow, deny or degrade with a machine-readable reason.
- Agent Finding Collection and Triage
Collect findings from diagnostic agents, collapse duplicates within a time window, and present distinct problems to an operator instead of the same problem stated fifteen ways.
- Incident Diagnosis and Approval
Read-only AI diagnosis during a production incident, with a human approving every action — because the fastest wrong fix is worse than a slower right one.