OpenAWF 0.1.0 · draft
Specification
The OpenAWF Specification (Open Agentic WorkFlow) defines a document for an agentic workflow. A workflow is a finite-state machine of tasks that runs from a start task to a terminal task. Each task is a prompt for an agent, with typed input, a typed result for each outcome, and the MCP tools it may use.
This page summarises the normative text in versions/0.1.0.md. Where they differ, the normative text wins. Breaking changes are expected before 1.0.
Principles
- The spec describes documents. It defines fields, validation and hashing. It defines execution only as far as a field needs a meaning, such as a limit failing an attempt.
- Workflows contain no code. Anything that executes runs behind an MCP server that a task names in
uses. - Workflows run unattended. There are no approval steps and no mid-run user input.
- Runner settings live in extensions. A construct from another format maps to a native field or to an
x-key. - Identity comes from content. A sealed document's sha is computed the same way by every tool, and a sealed document never changes.
Terms
| Term | Meaning |
|---|---|
| workflow | A document describing an agentic process as a finite-state machine of tasks. |
| finite-state machine | A set of states and the transitions between them. Each state of a workflow is a task. |
| task | One unit of work for an agent: a prompt, the data it takes and returns, and the tools it may use. |
| transition | The rule for where the flow goes after a task finishes. |
| outcome | A named result a task reports, such as pass, with a JSON Schema for the data it returns. |
| terminal task | A task whose transition is null. The flow ends after it. |
| draft | A document whose sha is null or absent. A draft may change. |
| sealed document | A document whose sha holds the hash of its content. It never changes. |
| sha | The content hash, prefixed with its algorithm, such as sha256-<hex>. |
| runner | A program that executes a workflow. |
| tool | An operation an agent calls, provided by an MCP server. |
| artifact | External state a task creates or changes through a tool: a commit, a comment, a ticket, a file. |
Document
A workflow document is a YAML or JSON object. YAML follows the YAML 1.2 core schema. A tool rejects duplicate keys and expands aliases before it processes a document. Every defined key is lowercase kebab-case, such as external-version.
Each spec version ships three files.
| File | Role |
|---|---|
versions/0.1.0.md | The specification in prose. Normative. |
schemas/0.1.0/schema.yaml | JSON Schema 2020-12, hand-written. Structural only. |
schemas/0.1.0/schema.json | The 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
| Field | Required | Meaning |
|---|---|---|
openawf | yes | The spec version. 0.1.0. |
name | yes | The workflow's name. |
summary | One line on what the workflow does. | |
model | The model every task uses unless a task overrides it. | |
effort | The reasoning effort every task uses unless a task overrides it. | |
metadata | Free keys. tags, authors and icon have a defined meaning. Hashed. | |
license | An SPDX license identifier. | |
version | major.minor.patch. Required to seal. | |
sha | The content hash. null in a draft. | |
external-version | An identifier assigned by another tool, such as an n8n versionId. | |
source | Where the workflow was fetched from. | |
start | yes | The task the flow begins at. |
orchestration | yes | Transitions, keyed by task name. |
tasks | yes | Tasks, keyed by name. Each is inline or a $ref. |
mcp | MCP servers, keyed by name. |
A document contains no field the spec does not define, except extension keys.
Extensions
An extension key starts with x-. The workflow, a task, an edge object and a server object may carry one. An extension key should name the runner that reads it, such as x-claude, and hold an object of that runner's settings.
A runner ignores extension keys it does not understand. A tool that bundles or seals a document keeps them. Extension keys are part of the hashed content.
Models and effort
A model is written provider/name, such as anthropic/claude-sonnet-5. A tool splits it on the first / only. The name may contain /. model is one model or a non-empty list of distinct models. A list is an ordered fallback chain: a runner uses the first model it can run. Endpoints, credentials and API settings belong to the runner and go in extension keys.
effort is low, medium or high. A task's effort overrides the workflow's. A runner maps it to the nearest setting its provider offers. Provider-specific values go in extension keys.
Orchestration
Each key of orchestration names a task. Its value is the transition out of that task.
| Form | Meaning |
|---|---|
null | The task is terminal. |
| an edge | An unconditional transition to one task. |
| a branch | An object mapping each outcome to an edge. |
An edge is a task name, or an object:
| Edge field | Meaning |
|---|---|
task | The task the edge leads to. Required. |
retries | Attempts after the first failure before the task fails hard. null, the default, retries without limit. 0 allows one attempt. |
session | fresh, the default, starts a new agent session. resume continues the target task's own previous session, with the new input as the next message. On the task's first run, resume starts a fresh session. |
orchestration: plan: build # edge build: pass: ship # branch on outcomes fail: task: build # edge with policy retries: 2 session: resume ship: null # terminal
A branch does not use task as an outcome name, because task marks an edge object.
Tasks
A task entry is an inline task or a reference. body is the only required field.
| Field | Meaning |
|---|---|
body | The request for this step, in Markdown, written for any agent. |
system | Standing instructions, such as the agent's role and rules. |
summary | One line on what the task does. |
outcomes | Outcome names, each mapped to the JSON Schema of its result. |
input | A JSON Schema the data passed to the task satisfies. |
output | The JSON Schema of the result of a task without outcomes. |
model, effort | Override the workflow's values. |
max-turns, timeout | Limits on one attempt. |
uses | Server names and qualified tool names the task calls. |
metadata, license | As on the workflow. |
version, sha, external-version | The task's own identity. |
source | Where the task was fetched from. A bundled reference records itself here. |
A runner should pass system as the system prompt and body as the first user message. A tool that converts a task to a single prompt field writes body alone when system is absent. Otherwise it writes system with trailing line breaks removed, then two line breaks, then body.
Task files
A task document is a Markdown file. Its YAML frontmatter holds every task field except body, plus openawf and any extension keys. The Markdown after the frontmatter is the body. The frontmatter never contains body.
--- openawf: 0.1.0 version: 1.2.3 summary: Review a diff against its request. outcomes: pass: { type: object } changes: type: object properties: { notes: { type: array } } --- # Review Read the diff against the request. Emit `pass` when it is correct and complete. Otherwise emit `changes` with a list of review notes.
Prompt parameters
A prompt parameter is {{field}} in body or system, where field is a key of the top-level properties of the task's input. Spaces inside the braces are allowed, and a space is U+0020 only.
A tool reads body and system left to right in one pass, including inside code spans and fenced code blocks. Parameters do not nest: in {{{issue}}}, the outer braces are literal text.
A runner replaces each parameter before the agent sees the text. A string is inserted as written, and any other value as JSON. An absent field inserts an empty string. Substitution is plain text, with no conditionals, loops or expressions, and never runs inside an inserted value. \{{ is a literal {{. \\{{ is a literal \ followed by a parameter.
The order of fields as written in input is the order of the task's arguments. A tool that converts a task to a format with positional arguments uses that order.
Limits
A turn is one model response with the tool calls it makes. max-turns is a positive integer that caps the turns of one attempt. timeout is a positive integer that caps the time of one attempt, in milliseconds. An attempt that reaches a limit fails, and each attempt starts with fresh limits. A server's timeout caps one tool call and is separate.
Results
A task's result is a JSON object. A task with outcomes reports exactly one. Its result has an outcome member naming it, and the rest satisfies that outcome's schema. The result of a task without outcomes satisfies output. A task never has both. An outcome's schema never declares a property named outcome.
The result, without outcome, is the input of the task the transition leads to.
An attempt fails when its result names no declared outcome, breaks its schema, or reaches a limit. Reporting a declared outcome is not a failure. Each failed attempt counts against the retries of the edge into the task.
A runner chooses how it obtains the result. It may append the outcomes and their schemas to the body as instructions, or use a structured-output feature of the agent.
References
A task entry { $ref: … } points at a task document, by path or by an id pinned to a version: [<namespace>#]<id>@<version>. A relative path resolves against the directory that holds the tool's store, or the workflow's own directory when there is no store. A tool that supports pinned ids defines how a namespace resolves.
Bundling replaces each reference with the task it points at and records the reference in the task's source. Orchestration names tasks by their key in tasks, never by reference. A sealed workflow contains no references.
MCP servers
mcp declares every MCP server the tasks call, keyed by a name without /. A reader sees what a workflow needs before running it.
| Field | Meaning |
|---|---|
type | stdio, http (Streamable HTTP) or sse. Required. MCP has deprecated sse in favour of Streamable HTTP. |
command, package | A stdio server has exactly one: the executable, or a published package. |
args, env | Arguments and environment for a stdio server. env overrides variables of the same name in the runner's environment. |
url, headers, oauth | The endpoint, headers and OAuth client settings for http and sse. |
allow, deny | The tools the workflow may call, or the tools it may not. Never both. allow: "*" is the default, and allow is never an empty list. Entries are tool names without the server prefix. |
timeout | The longest one tool call may run, in milliseconds. |
A runner never lets a task call a tool that allow leaves out or deny lists.
Tools in uses
A tool is written <server>/<tool>, such as github/get_pull_request. A server name in uses grants every tool the server allows. A qualified name grants one tool. A runner should expose to each task only the tools its uses grants. The runner's own shell and file operations are not tools in this sense and go in extension keys.
Credentials
A document never contains a credential. A string in args, env or headers may hold ${NAME}, which the runner replaces with an environment variable. NAME matches [A-Za-z_][A-Za-z0-9_]*. A runner with no value for a placeholder does not start or connect to the server and reports the variable's name.
Packages
package names a published stdio server, following the MCP Registry's server.json: registry-type (npm, pypi, oci or mcpb), identifier and an exact version. A version is never a range or latest, and identifier never carries it. An mcpb bundle carries its file-sha256.
mcp: github: type: http url: https://api.githubcopilot.com/mcp/ headers: Authorization: "Bearer ${GITHUB_TOKEN}" allow: [get_pull_request, create_pull_request_review] files: type: stdio package: registry-type: npm identifier: "@modelcontextprotocol/server-filesystem" version: 2.0.0 args: ["${REPO_DIR}"] allow: [read_file, list_directory]
Validation
A conformant validator runs three passes in order: structure against the JSON Schema, then the graph, then the hash. It reports every error and accepts no document with one.
| Check | Rule | Severity |
|---|---|---|
| start resolves | start names a task in tasks. | error |
| edges resolve | Every edge leads to a task in tasks. | error |
| keys match tasks | Every task has an orchestration key, and every key names a task. | error |
| branch required | A task with outcomes has a branch, not a plain edge or null. | error |
| branch coverage | A branch has an edge for each declared outcome and no others. | error |
| branch allowed | A task without outcomes has no branch. | error |
| results | No task has both outcomes and output. No outcome schema declares outcome. | error |
| terminal exists | At least one task is terminal. | error |
| liveness | Every task reachable from start has a path to a terminal task. | error |
| tools declared | Every server and tool in uses is declared and allowed. | error |
| parameters | Every {{field}} names a key of the top-level properties of the task's input. | error |
| servers | A server carries only the fields its type takes. A stdio server has exactly one of command and package. An http or sse server has a url. No server has both allow and deny. | error |
| packages | An mcpb package has a file-sha256. No package version is latest. | error |
| references | Every $ref resolves, and its target validates. | error |
| hash | A non-null sha matches the content. | error |
| reachability | Every task is reachable from start. | warning |
Liveness rejects a retry cycle with no exit. A validator may offer a mode that treats warnings as errors.
Sealing
Sealing fixes a document's content and gives it an identity. To seal, a tool requires a version, requires every referenced task to be sealed, bundles the document, then computes the sha and writes it.
- Take the bundled document as a JSON value.
- Omit optional members the spec defines when they are null or empty. JSON Schemas,
metadatavalues and extension values are kept exactly as written, including null and empty values. An emptymetadataobject is itself omitted. - Write an edge with no
retries,sessionor extension keys as its task name. - Remove the top-level
shaandversion. Inline tasks keep theirs. - Serialize with the JSON Canonicalization Scheme, RFC 8785.
- Hash with SHA-256 and write
sha256-plus the lowercase hex digest.
Defaults are not filled in. session: fresh and an omitted session mean the same thing and hash differently, as do allow: "*" and an omitted allow. Authors who need equal shas write equal documents.
A task document hashes the same way, with its frontmatter and body as one object. An inline task's sha is the hash of that task as a task document carrying the workflow's openawf, with source removed when the task was bundled. Validators accept sha256-, sha384- and sha512- and recompute with the named algorithm.
The version is a label outside the hash. external-version is part of the hashed content and does not replace version or sha. Two versions with identical content share a sha. A document with sha: null has no identity.
Versioning
Versions are major.minor.patch. A workflow pins each referenced task to an exact version. There are no ranges. A sealed version never changes. A change is a new draft sealed at a newer version.
Execution
Version 0.1.0 does not define execution. A runner should start at start, follow transitions, and stop after a terminal task. Three behaviours are planned for a later version:
- When a runner moves to the next model in a fallback list.
- How tools from
usesare bound to the agent. - How a runner stamps artifacts with the workflow's identity.
The runner page shows how a runner maps each field.
Conformance
- A conformant validator implements the validation rules.
- A conformant sealer implements the sealing rules. Two conformant sealers produce the same sha for the same document.
- Version 0.1.0 defines no runner conformance class.