openawf 0.1.0 unreleased

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

TermMeaning
workflowA document describing an agentic process as a finite-state machine of tasks.
finite-state machineA set of states and the transitions between them. Each state of a workflow is a task.
taskOne unit of work for an agent: a prompt, the data it takes and returns, and the tools it may use.
transitionThe rule for where the flow goes after a task finishes.
outcomeA named result a task reports, such as pass, with a JSON Schema for the data it returns.
terminal taskA task whose transition is null. The flow ends after it.
draftA document whose sha is null or absent. A draft may change.
sealed documentA document whose sha holds the hash of its content. It never changes.
shaThe content hash, prefixed with its algorithm, such as sha256-<hex>.
runnerA program that executes a workflow.
toolAn operation an agent calls, provided by an MCP server.
artifactExternal 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.

FileRole
versions/0.1.0.mdThe specification in prose. Normative.
schemas/0.1.0/schema.yamlJSON Schema 2020-12, hand-written. 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. 0.1.0.
nameyesThe workflow's name.
summaryOne line on what the workflow does.
modelThe model every task uses unless a task overrides it.
effortThe reasoning effort every task uses unless a task overrides it.
metadataFree keys. tags, authors and icon have a defined meaning. Hashed.
licenseAn SPDX license identifier.
versionmajor.minor.patch. Required to seal.
shaThe content hash. null in a draft.
external-versionAn identifier assigned by another tool, such as an n8n versionId.
sourceWhere the workflow was fetched from.
startyesThe task the flow begins at.
orchestrationyesTransitions, keyed by task name.
tasksyesTasks, keyed by name. Each is inline or a $ref.
mcpMCP 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.

FormMeaning
nullThe task is terminal.
an edgeAn unconditional transition to one task.
a branchAn object mapping each outcome to an edge.

An edge is a task name, or an object:

Edge fieldMeaning
taskThe task the edge leads to. Required.
retriesAttempts after the first failure before the task fails hard. null, the default, retries without limit. 0 allows one attempt.
sessionfresh, 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.

FieldMeaning
bodyThe request for this step, in Markdown, written for any agent.
systemStanding instructions, such as the agent's role and rules.
summaryOne line on what the task does.
outcomesOutcome names, each mapped to the JSON Schema of its result.
inputA JSON Schema the data passed to the task satisfies.
outputThe JSON Schema of the result of a task without outcomes.
model, effortOverride the workflow's values.
max-turns, timeoutLimits on one attempt.
usesServer names and qualified tool names the task calls.
metadata, licenseAs on the workflow.
version, sha, external-versionThe task's own identity.
sourceWhere 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.

FieldMeaning
typestdio, http (Streamable HTTP) or sse. Required. MCP has deprecated sse in favour of Streamable HTTP.
command, packageA stdio server has exactly one: the executable, or a published package.
args, envArguments and environment for a stdio server. env overrides variables of the same name in the runner's environment.
url, headers, oauthThe endpoint, headers and OAuth client settings for http and sse.
allow, denyThe 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.
timeoutThe 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.

CheckRuleSeverity
start resolvesstart names a task in tasks.error
edges resolveEvery edge leads to a task in tasks.error
keys match tasksEvery task has an orchestration key, and every key names a task.error
branch requiredA task with outcomes has a branch, not a plain edge or null.error
branch coverageA branch has an edge for each declared outcome and no others.error
branch allowedA task without outcomes has no branch.error
resultsNo task has both outcomes and output. No outcome schema declares outcome.error
terminal existsAt least one task is terminal.error
livenessEvery task reachable from start has a path to a terminal task.error
tools declaredEvery server and tool in uses is declared and allowed.error
parametersEvery {{field}} names a key of the top-level properties of the task's input.error
serversA 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
packagesAn mcpb package has a file-sha256. No package version is latest.error
referencesEvery $ref resolves, and its target validates.error
hashA non-null sha matches the content.error
reachabilityEvery 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.

  1. Take the bundled document as a JSON value.
  2. Omit optional members the spec defines when they are null or empty. JSON Schemas, metadata values and extension values are kept exactly as written, including null and empty values. An empty metadata object is itself omitted.
  3. Write an edge with no retries, session or extension keys as its task name.
  4. Remove the top-level sha and version. Inline tasks keep theirs.
  5. Serialize with the JSON Canonicalization Scheme, RFC 8785.
  6. 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 uses are 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.