Skip to main content
A procedure is one Markdown file. YAML front matter declares its inputs and output, headings group the steps, prose explains them, and fenced blocks called nodes say what runs. This page describes the format that every node page builds on.

Example

This illustrative procedure drafts the text of a nonpayment notice. It has a run title, an input with a default, an input with its own schema, a template, and the run’s own URL in its result.
nonpayment-notice.procedure.md

File name and layout

Name the file <id>.procedure.md, such as nonpayment-notice.procedure.md. The suffix is the convention tools look for; the procedure’s identity comes from id, not the file name. The file has this order, with nothing in between:
  1. Front matter, starting on the first line with --- and ending with a line that is exactly ---.
  2. At least one blank line.
  3. One # heading: the procedure’s title. It is the only title; front matter doesn’t repeat it.
  4. ## to ###### headings, prose and nodes.
The file must be UTF-8, with no byte order mark.

Front matter

Effective ignores other top-level keys. Don’t write a version: Effective numbers versions when you publish.

Names

  • Procedure id: one or more segments separated by dots. Each segment starts with a lowercase letter and holds lowercase letters, digits and hyphens, such as nonpayment-notice or billing.nonpayment-notice. At most 256 characters.
  • Input, output and value names: a lowercase letter followed by lowercase letters, digits and underscores, such as policy_number. inputs, run and project are reserved.

Inputs

Each input has exactly one of type or schema, and may have a default:
  • type is one of string, number, integer, boolean, object, array or null.
  • schema names a schema block in the same document. Use it for anything more specific than a bare type, such as a date-time or decimal string.
  • An input without a default is required when a run starts. A missing input with a default gets a copy of that value. The default must match the input’s type or schema.
  • An explicit null is a value, not a missing input.

Output

outputs names one output with one schema:
Every path through the procedure that succeeds must end at a complete node that returns this output. A run that fails or is cancelled returns no output.

Run title

run.title may use {{ }} templates, but only over $inputs. It is fixed when the run starts and never affects what the run does.

Headings

## to ###### headings form a tree. Each heading owns the text and nodes up to the next heading of the same or a higher level. Don’t skip levels: a #### must sit under a ###. Every heading gets an address. choice targets headings by address, and Markdown links such as [Deny](#deny-refund) can use it. By default the address is derived from the heading text: lowercase it, replace each run of characters other than a–z and 0–9 with -, trim leading and trailing -, and prefix #. So ## Deny the refund becomes #deny-the-refund. To keep an address stable when you reword a heading, end the heading with a custom id:
The custom id uses lowercase letters and digits separated by single hyphens. It must be the last thing on the heading line, after one space. Addresses, derived or custom, must be unique across the document, and every local link must point to an existing one. The # title heading takes no custom id. Headings don’t run. They don’t create scopes, hide values or guard entry.

Nodes

A node is a fenced code block whose first line names a language, a role and an id:
  • The fence uses backticks, starts in the first column, and isn’t inside a list, quote or HTML. A fenced block with only a language, such as plain yaml, is ordinary example code.
  • id= comes first. Ids use lowercase letters, digits and hyphens, and are unique across the document, declarations included.
  • Every node sits under a ## or deeper heading. A node before the first ## is an error.
  • Prose and ordinary Markdown never run.
value, call and the other runtime nodes are yaml. Functions and effects are ts.

Run order

Runtime nodes run in document order:
  1. Take the top-level ## sections in order.
  2. Within a section, run the nodes it owns directly, in order.
  3. Then do the same for each of its child sections, in order.
  4. Then continue with the next section.
The first runtime node in that order is where every run starts. A branching node such as choice claims the heading sections it targets as its branches; a branch starts at the first node its section owns, or else at the first node in its first child section that has one.

Declarations can go anywhere

schema, secret, retry and the code declarations, ts function and ts effect, are declarations. They never run and take no place in the run order. Effective reads them all before anything else, so a step can use a declaration that appears later in the file. Put declarations beside their first use, or group them under a heading such as ## Resources. The heading name is a convention, not a scope: moving a declaration doesn’t change what the procedure does. It does change the source, so publishing the move creates a new version.

References

A reference reads a value. It starts with $ and follows required members with dots.
  • Every member in the path must be required by its schema. There are no array indexes, wildcards, arithmetic or function calls in a reference. Use a value node, or a pure ts function through call, to compute anything more.
  • A value can be read only by steps that come after the step that binds it on every path.
  • Values are immutable. Each step receives its own copy.
  • $run.userId still works but is deprecated. Use $run.principal.id.
A task or agent answer is wrapped. Read $review.value.approved, not $review.result.approved. Other nodes, such as value, call and wait, bind their result directly.

References in YAML

In a node’s data fields, an unquoted value that is exactly a reference is a reference. Quote it to get the literal text:
A reference keeps the value’s type: a number stays a number.

Templates

A template inserts values into a string with {{ }}:
Templates work in:
  • run.title, over $inputs only;
  • the title and instructions of task and agent nodes; and
  • any string inside the value of a value node.
Other fields and prose don’t use templates.
  • Each placeholder holds exactly one reference, with optional spaces inside the braces. No ?? and no expressions.
  • The value must be a string, number or boolean. Objects, arrays and null are errors.
  • A template always produces a string, even when it is only one placeholder. To keep a value’s type, use a plain reference instead.
  • Inserted text is never read as a template again.
  • To write literal {{, escape it as \{{. In a double-quoted YAML string, write \\{{.
Text a template inserts may come from outside your organization, such as an email subject. It is shown as text, and agents receive it as data, not as instructions.

YAML rules

Front matter and node bodies use a strict form of YAML:
  • No anchors, aliases, merge keys, tags, directives or multiple documents.
  • No duplicate keys.
  • Only lowercase true, false and null, and plain JSON numbers, are read as non-strings. Values such as yes, 2026-11-01, 0x1F or +1 are strings, or errors where a number is required.
  • Whole numbers must be between -9007199254740991 and 9007199254740991.
  • Comments are allowed and have no meaning.

Limits

A file over a limit is refused, never cut short.

Run statuses

When you read a run, its status is one of: completed, failed, cancelled, terminated and timed_out are final. New statuses may be added; treat one you don’t know as not final. A run also has paused, which is true while it is paused. A failed run’s failure.code says why, such as invalid_input, schema_mismatch, operation_failed or poll_timeout. New codes may be added.

Common errors

See also