openawf

OpenAWF 0.1.0 · draft

Specification

The OpenAWF Specification (Open Agentic WorkFlow) defines a tool-agnostic document for an agentic workflow. A workflow is a finite-state machine of tasks that runs from a start task to a terminal one.

Document

A workflow is one self-contained document in YAML or JSON. It declares its tasks, their orchestration, and every server the tasks depend on. Nothing is left to the environment.

Each spec version ships three files. The prose specification is normative. The JSON Schema validates structure and cannot express every rule; where the two conflict, the prose wins.

FileRole
versions/0.1.0.mdThe specification in prose. Normative.
schemas/0.1.0/schema.yamlJSON Schema 2020-12, hand-authored. Structural only.
schemas/0.1.0/schema.jsonThe same schema, generated as JSON.

Point an editor's YAML language server at the schema with a modeline:

# yaml-language-server: $schema=https://openawf.org/schemas/0.1.0/schema.json

Workflow fields

FieldRequiredMeaning
openawfyesThe spec version the document is written against. 0.1.0.
nameyesThe workflow's name.
summaryOne line on what the workflow does.
modelThe model every task runs on unless a task overrides it.
versionThe workflow's version, major.minor.patch. Required to seal.
shaThe content hash, algorithm-prefixed (sha256-…). null until sealed.
sourceWhere the workflow is fetched from. Omitted when it is authored in place.
startyesThe task the flow begins at.
orchestrationyesThe task graph. Each key is a task name; its value is the transition out of that task.
tasksyesTask definitions keyed by name. Each entry is an inline task or a $ref.
mcpMCP servers the workflow depends on, keyed by name.

Orchestration

Each orchestration key names a task. Its value is one of three transitions.

FormMeaning
nullThe task is terminal. The flow ends after it.
an edgeAn unconditional transition to one task.
a branchA map from each outcome the task emits to an edge.

An edge is a task name, or an object that names the task under task and adds execution policy.

Edge fieldMeaning
taskThe task the edge leads to.
retriesAttempts after the first failure before the task fails hard. null, the default, retries indefinitely. 0 allows one attempt.
sessionfresh, the default, starts a new context. resume keeps the prior session's context.
orchestration:
  plan: build                  # edge
  build:
    pass: ship                  # branch on outcomes
    fail:
      task: build               # edge with policy
      retries: 2
      session: resume
  ship: null                    # terminal

task is reserved inside a branch: it marks an edge object, so no outcome is named task.

Tasks

A task is an atomic, reusable unit of work. It is defined once and can be pinned by version in any number of workflows. body is the only required field.

FieldMeaning
bodyThe tool-agnostic prompt, in Markdown.
summaryOne line on what the task does.
outcomesThe outcomes the task may emit. A task with outcomes branches on all of them.
inputA JSON Schema the incoming data must satisfy.
outputA JSON Schema the task's output must satisfy.
modelOverrides the workflow's model for this task.
usesNames of servers in mcp the task requires.
versionThe task's version.
shaThe task's content hash. null until sealed.
sourceWhere the task is fetched from. A bundled $ref task records its reference here.

Task files

A task on its own is a Markdown file. The YAML frontmatter holds every field except body and declares openawf. The Markdown after the frontmatter is the body.

---
openawf: 0.1.0
version: 1.2.3
summary: Review a diff against its request.
outcomes: [pass, changes]
---
# Review

Read the diff against the request. Emit `pass` when it is correct and
complete. Otherwise emit `changes` and return a list of review notes.

References

A task entry of the form { $ref: … } points at a task defined in another file. Orchestration edges always name tasks by their key in tasks; $ref only says where a task's definition lives.

A workflow with references is a source split over several files. Bundling inlines each referenced task into tasks and records the reference in its source. Sealing bundles first, so a sealed workflow is one file and holds no $ref.

MCP servers

mcp declares the MCP servers a workflow depends on, keyed by name. Each server names its transport (stdio, http or sse) and the tools the workflow uses from it. "*" grants every tool. A task lists the servers it needs in uses, and the runner exposes only those.

Server sources, tool-contract hashes and secrets are under revision. A server declared by package URL or HTTPS endpoint, with a hash of its tool contract, is drafted on the specification's feat/mcp-sources branch.

Validation

A conformant validator runs three passes in order: structure against the JSON Schema, then the graph, then the hash. A rule that stops the workflow from running is an error. A rule about something that can never be used is a warning.

CheckRuleSeverity
start resolvesstart names a defined task.error
edges resolveEvery edge leads to a defined task.error
nodes match tasksEvery task has an orchestration node, and every node names a task.error
branch requiredA task with outcomes takes a branch, not a plain edge or null.error
branch coverageA branch has an edge for each outcome and no others.error
terminal existsAt least one task is terminal.error
livenessA terminal task is reachable from every task the start reaches.error
servers declaredEvery name in uses is a server in mcp.error
hashA non-null sha matches the content.error
reachabilityEvery task is reachable from start.warning

Liveness rejects a retry cycle with no exit, which no other check catches.

Sealing

Sealing fixes a document's content and gives it an identity. The sha is computed over a canonical form of the document.

  1. Bundle the document, inlining every $ref.
  2. Convert the YAML to JSON.
  3. Remove the top-level sha and version.
  4. Serialize with the JSON Canonicalization Scheme, RFC 8785.
  5. Hash with SHA-256 and prefix the algorithm: sha256-<hex>.

Bundling before hashing makes the sha independent of how the source was split across files. A task hashes the same way, with its frontmatter and body as one object.

The version is excluded because it is a label. Two versions with identical content share a sha. A document with sha: null is unsealed and has no provenance.

sha384 and sha512 prefixes are also accepted for verification.

Versioning

Versions are major.minor.patch. A workflow pins each task to an exact version. There are no version ranges and no solver: tasks are leaves, so no dependency graph exists to resolve.

A sealed version never changes. Changing it means writing a new draft and sealing it at a newer version.

Roadmap

These additions are in design for the specification.

FeatureChange
Artifact provenance stampsA stamp on every commit, comment, ticket and file a task produces, naming the workflow, task, version, sha, source and run.
Parallel transitionsA transition to a list of tasks, with a join that waits for every branch.
Sub-workflowsA workflow used as one step of another, with the interface of a task.
Execution limitsTimeouts, turn and cost caps, and a failure route taken after retries run out.
Prompt parametersA placeholder syntax for input fields in body, by plain substitution.
Model settingsEffort, max tokens and temperature at workflow level, overridable per task.
Extension spaceA reserved place for runner-specific fields, with typos in real fields still rejected.
MCP sourcesServers declared by immutable source, a tool-contract hash, and declared secrets.