Workflow architecture

Workflows are declarative files, not code. This page explains what each file type means, how the pieces connect, and what the server delivers to the agent as work progresses.

For server enforcement (checkpoints, dispatch, fidelity), see architecture overview. For file shapes, see the schema reference.

Overview

Think in two layers:

Content model on disk A workflow directory contains a manifest, activity files, technique markdown files, and resource markdown files. Activities list ordered steps; technique steps point at techniques; techniques link to resources. workflow.yaml manifest activities/*.yaml phases + steps techniques/*.md capabilities resources/*.md reference lists bind refs Everything under workflows/<workflow-id>/ in the workflows branch
The four file types in a workflow directory and how they reference each other.

Workflows

A workflow is the whole process from start to finish. The work-package workflow, for instance, takes you from opening an issue through planning, implementation, validation, and merge.

The workflow is defined by a single manifest file, workflow.yaml. That file holds:

When a session starts, the server reads this manifest. The first get_workflow call returns:

The orchestrator uses initialActivity for its first next_activity call. After that, workflows describe structure only: the agent follows steps, and the server enforces:

Workflow manifest contents workflow.yaml connects to variables, activities, rules, and orchestrator techniques. workflow.yaml id · name · version · initialActivity variables[] named session slots activities[] phase file refs rules workflow + activity techniques[] orchestrator bundle
What the workflow manifest holds. Variables and rules span the entire run; the activity list is the set of phases the orchestrator can move between.
Example: work-package activity path A sequence of work-package activities from start through complete. start-wp initial plan-prepare implement validate complete Transitions choose which box comes next — not always this straight line
Example: the work-package workflow moves through these activities. start-wp is the initialActivity; later phases depend on variables set along the way.

Activities

An activity is one phase of a workflow — a stretch of work with a clear goal. Plan & Prepare, Implement, and Validate are activities inside work-package.

Each activity lives in its own YAML file under activities/. That file has two main parts:

Only one activity is current at a time. Two roles split the work:

Borrowed activities

An activity file can be listed in more than one workflow — the borrowing workflow runs the phase, but the activity file's technique refs resolve against the workflow it was authored in. This mirrors fragment scoping: a borrowed activity's bare refs, checkpoint fragment refs, and binding-provenance scans all use the source workflow, not the session workflow. See Resolution — borrowed activities.

Shared fragments

Rule texts and checkpoint bodies reused at several sites are declared once under fragments in workflow.yaml and imported by { ref: "[workflow::]name" }. Rules slots and kind:checkpoint steps carry the ref; the server materializes the body before delivery, so agents always see full content. A ref-form checkpoint step carries only its site-local id and, when the fragment declares none, a condition — body fields like message and options are forbidden locally. Details are in Resolution — workflow fragments and Checkpoints — shared checkpoints.

Activity file structure An activity file contains ordered steps and transitions to other activities. activity file id · name · steps[] · transitions step 1 step 2 step 3 loop (optional) transition A when condition → activity X transition B else → activity Y Worker runs steps; orchestrator picks a transition when the phase ends
How an activity file is organised. Steps are the work inside the phase; transitions are the exit routes to other activities.
Example: plan-prepare activity Concrete steps from the work-package plan-prepare activity. plan-prepare.yaml action — env-prerequisites technique — create-plan technique — collect-assumptions loop — assumption rounds → assumptions-review → strategic-review First an action checks the environment, then techniques build the plan and gather assumptions
Example: the plan-prepare activity checks prerequisites, runs planning techniques, loops over open assumptions, then transitions onward based on review mode.

Step kinds

Every entry in steps[] has a kind that tells the agent what sort of work it is. Four kinds are in use today. They run in file order unless a loop repeats a block or a transition sends the run to another activity.

The four step kinds Four boxes for technique, action, checkpoint, and loop steps, showing what each one does at a high level. kind: technique bind a capability; fetch via get_technique kind: action inline instructions validate, message, … kind: checkpoint pause for user decision; see Checkpoints kind: loop repeat nested steps while a condition holds Steps run in file order unless a loop or transition sends execution elsewhere
The four step kinds and what each one asks the agent to do.
KindWhat it isAgent behaviour
techniqueReference to a capability by :: path, with optional input bindingsCall get_technique for the step (or use content already bundled in get_activity), follow the protocol, record outputs
actionOne or more inline actions (validate, message, …)Execute the listed actions against current variables; the server does not interpret action verbs
checkpointA declared pause with options and effectsCall yield_checkpoint; orchestrator presents and respond_checkpoint; worker resume_checkpoint — see Checkpoints
loopA nested step list with an exit conditionRepeat the nested steps until the condition is satisfied or the loop declares completion

Techniques

A technique is a markdown file with a fixed shape — capability, inputs, outputs, protocol, and rules — not an ambient agent skill that loads when a description matches. Activity steps name techniques by :: path; the server composes, binds, and delivers them per step. The agent never reads technique files from the repository directly. Path resolution and bundling are on Resolution.

Technique file sections Standard markdown sections in a technique file. techniques/<name>.md Capability Inputs Outputs Protocol Rules The protocol is the step-by-step instructions the agent follows
The standard sections in a technique file. Full rules are in the technique protocol specification (source).

Compared to agent skills

Skills suit opt-in guidance: a short description and instructions the model loads when a request seems to match. Orchestrated workflows need a contract the server can schema-check, merge with ancestor protocols, and deliver step by step. Bulky templates and API guides stay in resources/ and load via get_resource only when a running technique links to them — the protocol states what to execute; reference material is separate (Resources).

Resources

A resource is long-form reference material — templates, checklists, tables — stored as markdown under resources/. Techniques link to resources instead of inlining them; the agent calls get_resource only when a running technique needs the linked material.

Resolution rules, section anchors, and cross-workflow prefixes are on Resolution.

Variables and binding

Workflow variables are named values stored in session.json — things like target_path, issue_number, or flags set by checkpoint choices. The server fills in defaults when a session starts; steps and checkpoints update them as the run proceeds.

When a technique step runs, each input must come from somewhere:

The server records where each value comes from and where each output should go. If something cannot be resolved, the delivered technique says so plainly.

The same variables drive transitions. When an activity ends, the orchestrator checks transition conditions against the current variable bag to decide which activity comes next.

Variable flow through a technique step Variables and prior outputs feed technique inputs; outputs write back to variables. variables session.json bag technique step inputs → outputs transitions pick next activity Outputs from a step can update variables that later steps and transitions read
How data moves through a run. Variables feed technique inputs; technique outputs and checkpoint choices write back to the bag; transitions read the bag to choose the next activity.

Runtime delivery

The agent never opens the workflows/ folder directly. Every piece of content arrives through MCP tool calls, and the server decides how much to send based on where the run is.

The orchestrator and worker play different roles:

Two patterns interrupt that rhythm:

Tool call order, bundling, and errors are in Protocol. Technique and resource resolution are on Resolution.

Normative references

JSON shapes: schema reference. Authoritative prose specs: Specifications.

Next

Definitions covers sessions from a user perspective. Checkpoints explains deliberate pauses and your choices. Dispatch explains how orchestrators and workers run those workflows.