Skip to main content

Spec Format Reference

flowspec workflows are defined in YAML. This page documents every field.

Top-Level: Workflow

FieldTypeRequiredDescription
namestringYesUnique identifier for the workflow.
triggerTriggerNoWhen the workflow should be executed.
steps[]StepYesOrdered list of steps to execute.
on_errorstringNoDefault error strategy: retry, skip, or abort.
name: my-workflow
trigger:
cron: "0 8 * * *"
on_error: abort
steps:
- name: step-one
agent: worker

Trigger

Defines when a workflow should run. At most one trigger type should be set.

FieldTypeDescription
cronstringCron expression (e.g., "0 8 * * *").
eventstringEvent name (e.g., "gitea.pull_request.opened").
webhookstringWebhook endpoint path.
trigger:
cron: "0 8 * * *"
trigger:
event: gitea.pull_request.opened

Step

A single unit of work in a workflow.

FieldTypeRequiredDescription
namestringYesUnique name within the workflow.
agentstring*Agent that executes this step. Required unless parallel is set.
inputstringNoInput expression, typically $prev.* referencing prior output.
configmap[string]anyNoArbitrary key-value configuration passed to the agent.
timeoutstringNoMaximum duration (e.g., "5m", "1h").
on_errorstringNoError strategy: retry, skip, or abort.
parallel[]StepNoSub-steps to execute in parallel (fan-out).
conditionstringNoBoolean expression for conditional execution (e.g., "$prev.urgent == true").

Agent Steps

A step with an agent field runs a single activity:

- name: fetch-data
agent: fetcher
config:
url: https://example.com/api
timeout: 30s
on_error: retry

Parallel Steps

A step with a parallel block fans out into concurrent sub-steps:

- name: fan-out
parallel:
- name: task-a
agent: worker-a
- name: task-b
agent: worker-b

Input References

Steps reference prior outputs with $prev.* syntax:

- name: process
agent: processor
input: "$prev.items"

Conditional Execution

Steps can be conditionally executed:

- name: alert
agent: notifier
input: "$prev.result"
condition: "$prev.urgent == true"

Error Handling

The on_error field accepts three values:

ValueBehavior
retryRetry the step with backoff.
skipSkip the step and continue.
abortStop the entire workflow immediately.

on_error can be set at the workflow level (default for all steps) or per-step (overrides the workflow default).