Document structure
A file’s opening declaration selects a workflow, worker, workloop or binding family. A workflow declares a name, typed inputs and terminal outcomes. Its narration goes immediately before the opening line.
workflow awl 1 Opens the document: one `.awl` file declares exactly one workflow, named here.
-
formdeclaration -
positionstop-level
//! Greet whoever starts the run.
workflow greet_visitor
input name: String
outcome done: type String, route success
step greet
"hello " + name -> greeting
route done(greeting) input awl 3 Declares one field of the workflow's start contract; it is repeatable.
-
formheader-clause -
positionsworkflow-header, workloop-header
//! Each `input` line declares one field of the start contract.
workflow open_ticket
input title: String
input urgent: Bool
outcome done: type String, route success
step file
outcome fast: if urgent, route done("expedited: " + title)
outcome slow: else, route done("queued: " + title) signal awl 3 Declares a durable signal this workflow receives; a step body takes delivery with `wait`.
-
formheader-clause -
positionsworkflow-header, workloop-header
//! Hold until the declared approval signal arrives.
workflow release_gate
input build_id: String
signal approval: Approval
outcome done: type String, route success
type Approval { reviewer: String }
step hold
wait approval -> decision
route done(decision.reviewer + " approved " + build_id) failure awl 3 Maps a declared outcome to the engine's failed status, and after `on` names a step's compensation block.
-
formstatement -
positionsworkflow-header, step-body, route-target, step-reference
//! `route failure` marks the outcome that fails the run.
workflow validate_order
input order_id: String
input valid: Bool
outcome accepted: type String, route success
outcome rejected: type String, route failure
step validate
outcome ok: if valid, route accepted(order_id)
outcome bad: else, route rejected("invalid order: " + order_id) success awl 3 Maps a declared outcome to the engine's completed status.
-
formheader-clause -
positionsworkflow-header, route-target, step-reference
//! `route success` maps the outcome to the engine's completed status.
workflow finish_job
input job: String
outcome done: type String, route success
step wrap
route done("finished " + job) level awl 3 Marks where an `input` or an `outcome` is set — `level board` once when the workflow is connected, `level card` on every card; a declaration with no clause is unmarked and is never defaulted.
-
formheader-clause -
positionsworkflow-header, workloop-header
//! `level` says WHERE a fact is set: once for the board, or on every card.
workflow triage_card
input board_name: String, level board
input card_title: String, level card
outcome triaged: type Triage, route success, level card
type Triage { priority: String }
step triage
route triaged(priority: board_name + "/" + card_title) board awl 3 The level of a fact set ONCE, when the workflow is connected to a board, and the same for every run it starts.
-
formheader-clause -
positionsworkflow-header, workloop-header
//! `level board` marks a fact set ONCE, when the workflow is connected.
workflow notify_board
input channel: String, level board
input card_title: String, level card
outcome notified: type Notice, route success, level card
type Notice { sent_to: String }
step notify
route notified(sent_to: channel + ": " + card_title) card awl 3 The level of a fact carried by every card: read when the card fires the workflow, written back when the run ends.
-
formheader-clause -
positionsworkflow-header, workloop-header
//! `level card` marks a fact every card carries, read when it fires.
workflow score_card
input card_title: String, level card
outcome scored: type Score, route success, level card
type Score { title: String, points: Int }
step score
route scored(title: card_title, points: 1) Use two-space indentation and lowercase names with underscores. Type names and enum alternatives use TitleCase. The formatter writes one canonical rendering.
An outcome is the workflow’s terminal value. Successful record outcomes also supply the named card output fields. Scalar, list and enum outcomes return their value directly.
The board and card level clauses mark where an input or outcome belongs. Omission stays unmarked. There is no output keyword.
Find a construct
Types and values
Records, enums, optional fields, schema imports, constants and expressions.
Workers and placement
Actions, retries, declared bodies, agent harnesses and relative nodes.
Steps and decisions
Dependencies, guards, routes and list pipelines.
Parallel work and loops
Fork/join, regions, collection and bounded iteration.
Children, waits and failure
Subflows, child results, sleeps, signal waits and failure handlers.
Signals and queries
Sending, receiving and registering read-only answers.
Commands
Headers, arguments, capture forms, working directories and exports.
Recipes
Typed parameters, walls, artifacts, preconditions and firing receipts.
Workloops
Cadence, carried state, health, detached work and retirement.
Roles and bindings
Separate a flow's contract from a venue's queue and harness facts.
Compiler boundaries
-
Failure handlers - No substeps, per-item regions, bounded loops, forks, timed waits or child spawns in on failure. Untimed wait is supported.
-
Forks - A collection fork body is exactly one unbound action or child call. Each named branch is one action call.
-
Substeps - Only a step body’s trailing substep block compiles. No after or max visits clause on a substep.
-
Indexing - Literal indexing is refused in parallel fork branches, parallel per-item tracks, outcome guards and visit bounds. Sequential tracks accept indexing.
-
Sort - The sort key must be Int, Float or String.
-
Schema values - schema of Type compiles in constant position. Bind a const and use it later.
-
Routes - A route to the middle of a folded fall-through chain is refused.
-
Check scope - awl check parses and typechecks. Use awl emit --target beam with an output file to verify bytecode compilation locally before deployment.
Compile the document before deploying it. Worker activities also require the declared programs or agent harness on their execution hosts.
Local guide
The installed command also serves this vocabulary as text or JSON, with a complete example for each word. See the guide command.
Editor support
Use the AWL language server and editor setup for diagnostics, formatting, completion and navigation.