ADL 49 · Part VII — Journeys

New in ADL 0.6.0

Steps, calls, and control flow

New reference draft · November 14, 2026.

Contents · Complete example · Source

49.1 A step has one role

A step invokes an operation, routes control, or invokes an operation and then routes on the result. A pure router has decide without call. An invocation has a valid call form. The name identifies the step within the Journey; it is not an HTTP route or a resource operation name.

Call resolution, permission feasibility, expression scope, and control-flow checks are separate. A known resource does not make every operation valid. A valid operation does not make its ID expression or the next step available.

49.2 Call forms

The current parser supports the following forms. They differ in several places from the consolidated Journey source; those differences are recorded below.

FormCall membersMeaning
Resource operationresource, operation (or verb), and id where applicablecreate, get, list, update, delete
Transitionresource, transition, idRequest a named state-machine edge
Custom operationresource, action, ID according to targetInvoke a declared custom resource operation
Sub-Journeyjourney, inputsBind inputs and compose a task in the same domain
Source-qualified callString source/Resource:get or source/operationIdResolve a resource call or named external operation
Raw HTTPsource, method, pathDescribe an external HTTP request

operation: put, count, and distinct are rejected with E-JRN-CALL-FORM in fresh fixtures. The source’s custom spelling also fails that gate; the parser expects action. The source’s object form {source, operationId} is not among this parser’s accepted object forms. Preserve these as implementation differences, not silent amendments to the source contract. The PUT restriction does not mean that ADL has no replacement resource API.

The parser also accepts local string calls such as Item:get, Item:transition:submit, and Item:action:recalculate. Step-level params supplies call parameters; structured call.id is copied to the ID parameter. body and query are step members. The inspected compiler requires a nonempty body for create/update, prohibits a body on get/list/delete, and admits query parameters only on list. A caller cannot write a protected field merely by placing it in a Journey body.

49.3 Expressions and results

Strings beginning with $ are expression references. For another computed AEL expression, use an explicit wrapper:

# Illustrative expression value, not a complete document.
$expr: "concat('P-', uuid())"

A bare string that looks like a function call can otherwise remain a literal; the source describes W-JRN-EXPR-BARE-CALL advice. This distinction matters when a literal accidentally resembles the intended computed value.

The closed Journey roots are $inputs, $steps, $response, $actor, and $journey. A step result must be available on every path reaching its use. The compiler expresses that condition as dominance: the producing step has to precede the consuming location on all possible paths, not merely appear earlier in the YAML file.

$response.status, $response.data, and $response.error_code belong to the current call’s response processing: success, outputs, and failure handlers. They are not global “last response” variables. Named step outputs provide an explicit value to later steps and the Journey’s result.

49.4 Routing and bounded cycles

then names the next step, end, or a named outcome target. decide contains ordered branches with a condition (condition or the documented when form) and a target. Its final branch supplies default: true. A missing default is assigned E-JRN-DECIDE-NO-DEFAULT by the source contract.

onFailure examines a failed response and selects recovery, a failed outcome, or bounded retry. A retry declares a limit and may specify a delay such as after: 2s. The graph rule requires every cycle to pass through a bounded retry edge. An ordinary back edge is not a retry budget and is assigned E-JRN-CYCLE-UNBOUNDED.

Routing to recovery does not undo a completed mutation. Retries need the target operation’s duplicate and idempotency semantics; an uncertain network result is not proof that the first attempt made no change. ADL 52 owns these execution boundaries.

49.5 Composition

A sub-Journey call binds the callee’s inputs. The source requires an acyclic call graph and describes a depth limit of eight. The inspected compiler instead rejects expansion when depth + 1 > 4, with E-JRN-CMP-DEPTH. That tighter limit is a source-reviewed discrepancy, not a freshly executed depth matrix. Compilation flattens callee steps under caller-qualified names, binds handles, and can specialize branches whose conditions are determined by literal inputs.

Specialization can remove an impossible branch from the static model. It cannot remove a runtime policy obligation on a reachable operation. Missing or unknown callee inputs, invalid callees, cycles, and depth violations have distinct E-JRN-CMP-* diagnostics. Their current source inventory is separate from the smaller executed diagnostic register in Appendix D.

49.6 Verification scope

The GET example and calibration transition compile successfully. PUT, count, distinct, the old custom-key form, and an unknown input are rejected as recorded. Retry, router defaults, valid custom/external call execution, and composition require additional fixtures before this edition can claim fresh coverage of the whole step grammar. Their definitions here are source-derived contracts or explicitly identified implementation observations.