CNCF Workflow DSL, Explained
The whole CNCF Serverless Workflow schema as one expanding tree. Open document, use, do, call, try and the rest, layer by layer, each with an explanation and an example.
A3T describes agents and processes in the CNCF Serverless Workflow DSL: an open, vendor-neutral workflow language written in YAML. The project, still in the CNCF, now goes by the Open Workflow Specification.
Below is the whole 1.0 schema as one tree. Click + on any key to see what it is for and an example, and to open the layer inside it. New to YAML? Read How to Read and Write YAML first.
workflow.yaml-
documentobject requiredworkflow › document
The identity card of the workflow: who owns it, what it is called and which version this is. namespace + name + version identify a workflow in a runtime.
document: dsl: '1.0.0' namespace: shop name: process-order version: '1.0.0' title: Process an order-
dslstring requiredworkflow › document › dsl
Version of the DSL the file is written in. Quote it: unquoted, 1.0 would be read as a number.
dsl: '1.0.0' -
namespacestring requiredworkflow › document › namespace
The group the workflow belongs to, like a folder or a team.
namespace: shop -
namestring requiredworkflow › document › name
Name of the workflow, unique within its namespace. Lowercase with hyphens by convention.
name: process-order -
versionstring requiredworkflow › document › version
Semantic version (major.minor.patch) of this definition. Bump it when the workflow changes.
version: '1.2.0' -
titlestringworkflow › document › title
A short, human-readable title for catalogs and dashboards.
title: Process an order -
summarystringworkflow › document › summary
A longer description, in Markdown. A block scalar (|) keeps the line breaks.
summary: | Validates an order, charges the card and waits for the shipment. -
metadatamapworkflow › document › metadata
Anything else you want to attach. The runtime keeps it but does not act on it.
metadata: owner: payments-team runbook: https://wiki.example.com/orders
-
-
inputobjectworkflow › input
Checks and shapes the data the workflow is started with. Bad input fails the run before any task starts.
input: schema: format: json document: type: object required: [order] from: ${ .order }-
schemaobjectworkflow › input › schema
A JSON Schema that the raw input must match. Give it inline (document) or load it from a URL (resource).
schema: format: json resource: endpoint: https://schemas.example.com/order.json-
formatstring requiredworkflow › input › schema › format
The schema language. The spec defines json, for JSON Schema.
format: json -
documentobjectworkflow › input › schema › document
The schema itself, written inline. Use this or resource.
document: type: object required: [order] properties: order: type: object -
resourceobjectworkflow › input › schema › resource
Where to fetch the schema from: an object with an endpoint (a URI, or { uri, authentication }).
resource: endpoint: https://schemas.example.com/order.json
-
-
fromexpressionworkflow › input › from
A jq expression that picks, or reshapes, what the first task sees as ".". Without it, tasks see the whole input.
from: ${ .payload.order }
-
-
useobjectworkflow › use
Reusable building blocks. Declare a policy, function, error or secret here once, then refer to it by name from any task.
use: secrets: [paymentKey] retries: threeTimes: delay: { seconds: 2 } limit: attempt: { count: 3 }-
authenticationsmap · name: authworkflow › use › authentications
Named authentication policies. A call refers to one with authentication: { use: <name> }. Each policy uses exactly one scheme.
authentications: shopApi: bearer: token: ${ $secrets.shopToken }-
basicobjectworkflow › use › authentications › basic
HTTP basic auth: username and password.
basic: username: admin password: ${ $secrets.adminPassword } -
bearerobjectworkflow › use › authentications › bearer
A bearer token sent in the Authorization header.
bearer: token: ${ $secrets.apiToken } -
digestobjectworkflow › use › authentications › digest
HTTP digest auth: username and password, sent as a digest.
digest: username: admin password: ${ $secrets.adminPassword } -
oauth2objectworkflow › use › authentications › oauth2
OAuth 2.0: the authority to get a token from, the grant type, the client and the scopes.
oauth2: authority: https://auth.example.com grant: client_credentials client: id: workflow-runtime secret: ${ $secrets.clientSecret } scopes: [orders.write] -
oidcobjectworkflow › use › authentications › oidc
OpenID Connect: the same fields as oauth2, with endpoints discovered from the authority.
oidc: authority: https://auth.example.com grant: client_credentials client: id: workflow-runtime secret: ${ $secrets.clientSecret }
-
-
catalogsmap · name: catalogworkflow › use › catalogs
Named function catalogs: shared libraries of functions. A task calls one as call: <function>:<version>@<catalog>.
catalogs: shared: endpoint: https://github.com/acme/functions # used as: call: sendEmail:1.0.0@shared-
endpointstring | object requiredworkflow › use › catalogs › endpoint
Where the catalog lives: a URI, or { uri, authentication }.
endpoint: https://github.com/acme/functions
-
-
errorsmap · name: errorworkflow › use › errors
Named error definitions. raise: { error: <name> } raises one without repeating its fields.
errors: outOfStock: type: https://example.com/errors/out-of-stock status: 409 title: Item is out of stock -
extensionsarray · name: extensionworkflow › use › extensions
Hooks that run tasks before or after every task of a given type: logging, policy checks, mocks. Order matters, so it is a list.
extensions: - logCalls: extend: call before: - log: call: http with: method: post endpoint: https://log.example.com body: ${ $task }-
extendstring requiredworkflow › use › extensions › extend
The task type to extend: call, composite, emit, for, listen, raise, run, set, switch, try, wait, or all.
extend: call -
whenexpressionworkflow › use › extensions › when
Apply the extension only when this is true.
when: '${ $task.reference | startswith("/do/0") }' -
beforearray · name: taskworkflow › use › extensions › before
Tasks to run before the extended task.
before: - audit: set: { started: true } -
afterarray · name: taskworkflow › use › extensions › after
Tasks to run after the extended task.
after: - audit: set: { finished: true }
-
-
functionsmap · name: taskworkflow › use › functions
Named reusable tasks, usually calls. Any task runs one with call: <name> and passes arguments in with.
functions: getWeather: call: http with: method: get endpoint: https://api.example.com/weather # used as: call: getWeather -
retriesmap · name: retryPolicyworkflow › use › retries
Named retry policies. A try refers to one with retry: <name>.
retries: threeTimes: delay: { seconds: 2 } backoff: exponential: {} limit: attempt: { count: 3 }-
delaydurationworkflow › use › retries › delay
How long to wait between attempts. A duration: an object such as { minutes: 5, seconds: 30 } (days, hours, minutes, seconds, milliseconds), or an ISO 8601 string such as PT5M30S.
delay: { seconds: 2 } -
backoffobjectworkflow › use › retries › backoff
How the delay grows: constant, exponential or linear. Set exactly one; the value is an object, often empty.
backoff: exponential: {} -
limitobjectworkflow › use › retries › limit
When to give up: attempt.count (maximum attempts), attempt.duration (per attempt) or duration (in total).
limit: attempt: count: 5 duration: { minutes: 2 } -
jitterobjectworkflow › use › retries › jitter
A random extra delay between from and to, so many retries do not all hit a service at once.
jitter: from: { milliseconds: 100 } to: { seconds: 1 } -
whenexpressionworkflow › use › retries › when
Retry only when this is true.
when: ${ $error.status >= 500 } -
exceptWhenexpressionworkflow › use › retries › exceptWhen
Do not retry when this is true.
exceptWhen: ${ $error.status == 400 }
-
-
secretsarray · stringworkflow › use › secrets
The names of secrets the workflow may read. Values come from the runtime, never from the file; read them as $secrets.<name>.
secrets: - paymentKey - shopToken -
timeoutsmap · name: timeoutworkflow › use › timeouts
Named timeouts. A workflow or task refers to one with timeout: <name>.
timeouts: short: after: { seconds: 30 }
-
-
doarray · name: task requiredworkflow › do
The tasks, run top to bottom. Each list item is a map with one key: the key is the task name, the value is the task. The task type is the key inside it (call, set, switch and so on), next to the fields every task can have.
do: - greet: set: message: Hello - send: call: http with: method: post endpoint: https://hooks.example.com/hello body: ${ . }-
(any task)objectworkflow › do › (any task)
Fields every task can have, whatever its type. They sit next to the type key, at the same indentation.
- charge: if: ${ .total > 0 } call: http with: method: post endpoint: https://pay.example.com/charges timeout: after: { seconds: 30 } then: ship-
ifexpressionworkflow › do › (any task) › if
Run the task only when this is true. Otherwise it is skipped and its input passes through unchanged.
if: ${ .amount > 1000 } -
inputobjectworkflow › do › (any task) › input
Same as the workflow input, for one task: schema to check, and from to choose what the task sees as ".".
input: from: ${ .order } -
outputobjectworkflow › do › (any task) › output
Reshapes what the task passes to the next task. as is a jq expression; schema checks the result.
output: as: ${ .body.id } -
exportobjectworkflow › do › (any task) › export
Saves data in $context, which later tasks can read wherever they are. as builds the new context.
export: as: '${ $context + { orderId: .id } }' -
timeoutstring | objectworkflow › do › (any task) › timeout
Fail the task if it runs longer than after. A string names a timeout from use.timeouts.
timeout: after: { seconds: 30 } -
thenflow directiveworkflow › do › (any task) › then
Where to go next: continue (the next task, the default), exit (leave the current task list), end (finish the workflow), or the name of a task.
then: notifyCustomer -
metadatamapworkflow › do › (any task) › metadata
Free information about the task. The runtime keeps it but does not act on it.
metadata: owner: payments-team
-
-
callstringworkflow › do › call
Calls something outside the workflow and returns its result. call says what to call; with holds the arguments, and their shape depends on the kind of call.
- getUser: call: http with: method: get endpoint: https://api.example.com/users/42-
callstring requiredworkflow › do › call › call
What to call: http, grpc, openapi, asyncapi, a2a, mcp, or the name of a function from use.functions or a catalog. A3T adds adb (agent memory) and a3t:agent.
call: openapi -
withmapworkflow › do › call › with
The arguments. The children below show what each built-in call expects.
with: method: get endpoint: https://api.example.com/users/42 -
call: httpobjectworkflow › do › call › call: http
An HTTP request. Returns the response body by default.
call: http with: method: post endpoint: https://api.example.com/orders headers: content-type: application/json body: id: ${ .id }-
methodstring requiredworkflow › do › call › call: http › method
The HTTP method: get, post, put, patch, delete…
method: post -
endpointstring | object requiredworkflow › do › call › call: http › endpoint
The URL, or { uri, authentication } when the call needs credentials.
endpoint: uri: https://api.example.com/orders authentication: use: shopApi -
headersmapworkflow › do › call › call: http › headers
Request headers, name: value.
headers: accept: application/json -
bodyanyworkflow › do › call › call: http › body
The request body: an object, a string or an expression.
body: ${ .order } -
querymapworkflow › do › call › call: http › query
Query parameters added to the URL.
query: page: 2 size: 50 -
outputstringworkflow › do › call › call: http › output
What the task returns: content (the body, the default), response (status, headers and body) or raw (base64).
output: response -
redirectbooleanworkflow › do › call › call: http › redirect
Accept 3xx redirects instead of treating them as errors. Defaults to false.
redirect: true
-
-
call: grpcobjectworkflow › do › call › call: grpc
Calls a gRPC method, described by a .proto file.
call: grpc with: proto: endpoint: https://example.com/greeter.proto service: name: GreeterApi.Greeter host: localhost port: 5011 method: SayHello arguments: name: ${ .user.name }-
protoobject requiredworkflow › do › call › call: grpc › proto
Where to fetch the .proto file: an object with an endpoint.
proto: endpoint: https://example.com/greeter.proto -
serviceobject requiredworkflow › do › call › call: grpc › service
The service to call: name and host are required; port and authentication are optional.
service: name: GreeterApi.Greeter host: localhost port: 5011 -
methodstring requiredworkflow › do › call › call: grpc › method
The gRPC method name.
method: SayHello -
argumentsmapworkflow › do › call › call: grpc › arguments
The method arguments, name: value.
arguments: name: Ada
-
-
call: openapiobjectworkflow › do › call › call: openapi
Calls an operation from an OpenAPI document, by its operationId. The runtime builds the HTTP request.
call: openapi with: document: endpoint: https://petstore.swagger.io/v2/swagger.json operationId: findPetsByStatus parameters: status: available-
documentobject requiredworkflow › do › call › call: openapi › document
Where to fetch the OpenAPI document: an object with an endpoint.
document: endpoint: https://api.example.com/openapi.json -
operationIdstring requiredworkflow › do › call › call: openapi › operationId
The operationId in that document.
operationId: findPetsByStatus -
parametersmapworkflow › do › call › call: openapi › parameters
Parameters of the operation, path, query or body, by name.
parameters: status: available -
authenticationobjectworkflow › do › call › call: openapi › authentication
Credentials for the call, inline or by name.
authentication: use: shopApi -
outputstringworkflow › do › call › call: openapi › output
content (default), response or raw, as with http.
output: content
-
-
call: asyncapiobjectworkflow › do › call › call: asyncapi
Publishes or subscribes to messages through an AsyncAPI operation: Kafka, MQTT, AMQP, NATS and others.
call: asyncapi with: document: endpoint: https://example.com/orders.asyncapi.yaml operation: publishOrder protocol: kafka message: payload: ${ .order }-
documentobject requiredworkflow › do › call › call: asyncapi › document
Where to fetch the AsyncAPI document.
document: endpoint: https://example.com/orders.asyncapi.yaml -
operationstringworkflow › do › call › call: asyncapi › operation
The operation to run (AsyncAPI 3). For AsyncAPI 2.6, use channel.
operation: publishOrder -
protocolstringworkflow › do › call › call: asyncapi › protocol
Picks the server by protocol: kafka, mqtt, amqp, nats, ws…
protocol: kafka -
messageobjectworkflow › do › call › call: asyncapi › message
The message to publish: payload, headers. Use this or subscription.
message: payload: ${ .order } -
subscriptionobjectworkflow › do › call › call: asyncapi › subscription
Consume messages instead: a filter, how many to consume, and what to do with each.
subscription: consume: amount: 5
-
-
call: a2aobjectworkflow › do › call › call: a2a
Talks to another agent over the A2A (agent-to-agent) protocol: send a message, check or cancel a task.
call: a2a with: method: message/send agentCard: endpoint: https://agents.example.com/.well-known/agent.json parameters: message: parts: - kind: text text: Summarise order 42-
methodstring requiredworkflow › do › call › call: a2a › method
The A2A JSON-RPC method: message/send, message/stream, tasks/get, tasks/cancel…
method: message/send -
agentCardobjectworkflow › do › call › call: a2a › agentCard
Where to fetch the agent card that describes the agent. Use this or server.
agentCard: endpoint: https://agents.example.com/.well-known/agent.json -
serverstring | objectworkflow › do › call › call: a2a › server
The A2A server URL, when there is no agent card.
server: https://agents.example.com/a2a -
parametersmapworkflow › do › call › call: a2a › parameters
Parameters of the method. For message/send, the runtime fills in messageId and role.
parameters: message: parts: - kind: text text: Hello
-
-
call: mcpobjectworkflow › do › call › call: mcp
Calls a Model Context Protocol server: list or call tools, read resources, get prompts.
call: mcp with: protocolVersion: '2025-06-18' method: tools/call parameters: name: search arguments: query: ${ .question } transport: http: endpoint: https://mcp.example.com-
methodstring requiredworkflow › do › call › call: mcp › method
The MCP method: tools/list, tools/call, resources/read, prompts/get…
method: tools/call -
transportobject requiredworkflow › do › call › call: mcp › transport
How to reach the server: http (an endpoint) or stdio (a command to start).
transport: stdio: command: npx arguments: [my-mcp-server] -
parametersmapworkflow › do › call › call: mcp › parameters
Method parameters, such as the tool name and its arguments.
parameters: name: search arguments: query: workflows -
protocolVersionstring requiredworkflow › do › call › call: mcp › protocolVersion
The MCP protocol version. Defaults to 2025-06-18.
protocolVersion: '2025-06-18'
-
-
-
setmap | expressionworkflow › do › set
Builds data. The task output is exactly what you write, with ${ } expressions evaluated against the task input.
- price: set: orderId: ${ .order.id } total: ${ [.order.items[] | .price * .qty] | add } -
switcharray · name: caseworkflow › do › switch
Branches. Cases are checked in list order; the first whose when is true decides where to go. A case without when is the default.
- route: switch: - urgent: when: ${ .priority == "P1" } then: pageOnCall - default: then: fileTicket-
whenexpressionworkflow › do › switch › when
The condition for this case. Leave it out on one case, the default.
when: ${ .total > 100 } -
thenflow directive requiredworkflow › do › switch › then
Where to go when the case matches: a task name, continue, exit or end.
then: applyDiscount
-
-
forobjectworkflow › do › for
Loops over a list and runs its do once per item. The item and its index are variables.
- notifyAll: for: each: user in: ${ .users } do: - send: call: http with: method: post endpoint: https://hooks.example.com/notify body: ${ $user }-
for.inexpression | array requiredworkflow › do › for › for.in
The list to loop over.
for: in: ${ .order.items } -
for.eachstringworkflow › do › for › for.each
Variable name for the current item. Defaults to item, read as $item.
for: each: line in: ${ .lines } -
for.atstringworkflow › do › for › for.at
Variable name for the index. Defaults to index.
for: in: ${ .lines } at: i -
whileexpressionworkflow › do › for › while
Keep looping only while this is true.
while: ${ $index < 10 } -
doarray · name: task requiredworkflow › do › for › do
The tasks to run for each item.
do: - reserve: set: sku: ${ $item.sku }
-
-
forkobjectworkflow › do › fork
Runs branches in parallel. It waits for all of them and returns a list of their outputs, unless compete makes it a race.
- lookup: fork: compete: true branches: - fromCache: call: http with: method: get endpoint: https://cache.example.com/item/1 - fromDb: call: http with: method: get endpoint: https://db.example.com/item/1-
branchesarray · name: taskworkflow › do › fork › branches
The tasks to run at the same time, one per list item.
branches: - reserveStock: set: { reserved: true } - sendEmail: set: { sent: true } -
competebooleanworkflow › do › fork › compete
true: the first branch to finish wins and its output is the result. Defaults to false.
compete: true
-
-
tryarray · name: taskworkflow › do › try
Runs tasks and handles their errors. try holds the tasks; catch says which errors to handle and how: retry, run recovery tasks, or both.
- charge: try: - pay: call: http with: method: post endpoint: https://pay.example.com/charges catch: errors: with: status: 503 retry: threeTimes-
catchobject requiredworkflow › do › try › catch
Which errors to handle, and how.
catch: errors: with: type: https://serverlessworkflow.io/spec/1.0.0/errors/communication as: failure do: - logIt: set: failed: ${ $failure.title }-
errors.withobjectworkflow › do › try › catch › errors.with
Catch only errors with these properties: type, status, instance, title, detail.
errors: with: status: 503 -
asstringworkflow › do › try › catch › as
Variable name for the caught error. Defaults to error, read as $error.
as: failure -
whenexpressionworkflow › do › try › catch › when
Catch only when this is true.
when: ${ $error.status >= 500 } -
exceptWhenexpressionworkflow › do › try › catch › exceptWhen
Do not catch when this is true.
exceptWhen: ${ $error.status == 404 } -
retrystring | objectworkflow › do › try › catch › retry
Retry the try tasks: a policy inline, or the name of one in use.retries.
retry: threeTimes -
doarray · name: taskworkflow › do › try › catch › do
Recovery tasks to run once the error is caught (and retries, if any, are used up).
do: - refund: call: http with: method: post endpoint: https://pay.example.com/refunds -
thenflow directiveworkflow › do › try › catch › then
Where to go after handling the error.
then: end
-
-
-
emitobjectworkflow › do › emit
Publishes an event in CloudEvents format, so other systems and workflows can react.
- announce: emit: event: with: source: https://shop.example.com type: com.example.order.paid.v1 data: orderId: ${ .id }-
event.withobject requiredworkflow › do › emit › event.with
The CloudEvent attributes. source and type are required when emitting; the runtime fills id and time.
event: with: source: https://shop.example.com type: com.example.order.paid.v1 data: ${ . }-
sourcestring requiredworkflow › do › emit › event.with › source
A URI for where the event happened.
source: https://shop.example.com -
typestring requiredworkflow › do › emit › event.with › type
What happened, usually reverse-DNS with a version.
type: com.example.order.paid.v1 -
dataanyworkflow › do › emit › event.with › data
The event payload.
data: orderId: ${ .id } -
subjectstringworkflow › do › emit › event.with › subject
What the event is about, within the source.
subject: order-42
-
-
-
listenobjectworkflow › do › listen
Pauses until matching events arrive, then continues with them as output. Use it for approvals, callbacks and anything that happens later.
- awaitApproval: listen: to: one: with: type: com.example.approval.v1-
toobject requiredworkflow › do › listen › to
Which events to wait for. Set one of one, all or any.
to: all: - with: type: com.example.payment.done.v1 - with: type: com.example.stock.reserved.v1-
oneobjectworkflow › do › listen › to › one
Wait for one event that matches the filter. with lists the attributes to match.
one: with: type: com.example.approval.v1 -
allarray · filterworkflow › do › listen › to › all
Wait until every filter in the list has matched an event.
all: - with: { type: com.example.a.v1 } - with: { type: com.example.b.v1 } -
anyarray · filterworkflow › do › listen › to › any
Continue as soon as any filter matches. An empty list accepts any event.
any: - with: { type: com.example.a.v1 } - with: { type: com.example.b.v1 } -
untilexpression | objectworkflow › do › listen › to › until
With any only: keep listening until this condition holds, or until these events arrive.
until: ${ length >= 3 }
-
-
readstringworkflow › do › listen › read
What each event contributes: data (the payload, default), envelope (with its attributes) or raw.
read: envelope
-
-
waitdurationworkflow › do › wait
Pauses for a fixed time, for back-off, rate limits or giving another system time. A duration: an object such as { minutes: 5, seconds: 30 } (days, hours, minutes, seconds, milliseconds), or an ISO 8601 string such as PT5M30S.
- coolDown: wait: seconds: 30 -
raiseobjectworkflow › do › raise
Fails on purpose with a structured error. A surrounding try can catch it; otherwise the workflow ends with that error.
- reject: raise: error: type: https://serverlessworkflow.io/spec/1.0.0/errors/validation status: 400 title: Order has no items-
errorstring | object requiredworkflow › do › raise › error
The error to raise, inline or by the name of one in use.errors.
error: outOfStock-
typestring requiredworkflow › do › raise › error › type
A URI naming the kind of error. The spec defines standard ones: validation, communication, timeout, authentication, authorization, configuration, expression, runtime.
type: https://serverlessworkflow.io/spec/1.0.0/errors/timeout -
statusinteger requiredworkflow › do › raise › error › status
A status code, HTTP style.
status: 409 -
titlestringworkflow › do › raise › error › title
A short summary for people.
title: Item is out of stock -
detailstringworkflow › do › raise › error › detail
An explanation of this occurrence. Can be an expression.
detail: ${ "SKU " + .sku + " is sold out" }
-
-
-
runobjectworkflow › do › run
Runs a process: a container, a script, a shell command or another workflow. Set exactly one of the four.
- resize: run: container: image: ghcr.io/example/resizer:1.0 command: resize --width 800-
containerobjectworkflow › do › run › container
Runs a container image. image is required; command, arguments, environment, ports, volumes and pullPolicy are optional.
container: image: ghcr.io/example/label-printer:1.2 environment: PRINTER: dock-3 -
scriptobjectworkflow › do › run › script
Runs code in js or python, inline (code) or from a URL (source).
script: language: python code: | import sys print(sys.argv[1].upper()) arguments: [hello] -
shellobjectworkflow › do › run › shell
Runs a shell command with optional arguments, environment and working directory.
shell: command: ls arguments: [-la, /data] -
workflowobjectworkflow › do › run › workflow
Runs another workflow as a sub-workflow, by namespace, name and version, with an input.
workflow: namespace: shop name: send-invoice version: '1.0.0' input: ${ . } -
awaitbooleanworkflow › do › run › await
Wait for the process to finish. false starts it and moves on. Defaults to true.
await: false -
returnstringworkflow › do › run › return
What the task outputs: stdout (default), stderr, code, all or none.
return: all
-
-
doarray · name: taskworkflow › do › do
do is also a task: a group of tasks run in order, inside another list. Useful for structure and for then: exit.
- prepare: do: - load: set: { loaded: true } - check: set: { checked: true }
-
-
timeoutstring | objectworkflow › timeout
A limit on the whole run. If it takes longer than after, the workflow fails with a timeout error. A string names a timeout from use.timeouts.
timeout: after: { minutes: 30 }-
afterduration requiredworkflow › timeout › after
How long the run may take. A duration: an object such as { minutes: 5, seconds: 30 } (days, hours, minutes, seconds, milliseconds), or an ISO 8601 string such as PT5M30S.
after: { hours: 1, minutes: 30 }
-
-
outputobjectworkflow › output
Shapes what the workflow returns. Without it, the workflow returns the output of its last task.
output: as: '${ { orderId: $context.orderId, total: $context.total } }'-
asexpressionworkflow › output › as
A jq expression that builds the result. Quote it when it contains ": ", or YAML reads it as a map.
as: '${ { id: .orderId } }' -
schemaobjectworkflow › output › schema
A JSON Schema the result must match, the same shape as input.schema.
schema: format: json document: type: object required: [orderId]
-
-
scheduleobjectworkflow › schedule
Starts the workflow on its own instead of on request. Set one of every, cron, after or on.
schedule: cron: '0 6 * * *'-
everydurationworkflow › schedule › every
Start a run at this interval, even if the last one is still running.
every: { minutes: 15 } -
cronstringworkflow › schedule › cron
A cron expression. Quote it: * has a meaning in YAML.
cron: '0 * * * *' -
afterdurationworkflow › schedule › after
Start again this long after the previous run completes.
after: { hours: 1 } -
onobjectworkflow › schedule › on
Start when events arrive, with the same one, all or any as listen.to.
on: one: with: type: com.example.order.created.v1
-
-
evaluateobjectworkflow › evaluate
How runtime expressions are evaluated. Rarely needed: the defaults are jq, strict.
evaluate: language: jq mode: strict-
languagestringworkflow › evaluate › language
The expression language. Defaults to jq.
language: jq -
modestringworkflow › evaluate › mode
strict (default): only values inside ${ } are expressions. loose: every string is tried as an expression.
mode: strict
-
No key matches.
Three rules that hold everywhere
- Data flows down the list. Each task’s output is the next task’s input. Inside a task,
.is that input. ${ }is jq. Anything inside it is a jq expression evaluated at run time. Quote it when it contains:.- A task is a one-key map. In
do,try,fork.branchesandswitch, each list item is- name:and the task sits under it.
How A3T runs it
A3T runs these workflows on a runtime written in Rust, and adds two kinds of call: call: adb runs AQL queries against agent memory, and call: a3t:agent runs an LLM agent, with tools and memory, as a single task. Everything in the tree above works as written.
Sources
- DSL reference (1.0), which the tree follows
- CloudEvents, the event format used by
emitandlisten - jq manual, the expression language inside
${ }