Repository navigation
Description
Agreed design as of 2026-10-02, amended the same day (the abnormal termination retriable setting, which also amends proposal 0008 through #24). The original proposal is kept at the end.
Running a workflow (tier 1)
How an executor runs one workflow: the workflow instance, step descriptors, the order of steps, step statuses, retries, journey IDs and the result. Builds on proposals 0002 (Foundations) and 0008 (Steps).
The workflow instance
- One workflow instance per journey. The workflow's definition (its steps, order, policies and adapters) is fixed and can be listed without running anything (Foundations). A workflow instance is created by the developer's own code, for each journey, and handed to an executor, which runs it. Creating the instance is the developer's responsibility, so a failure while creating it happens before the executor is involved.
- Initial data. The developer may create the instance with initial data, and the instance may obtain more, for example by calling services, while it is created. Whatever the instance holds when it is handed to the executor is the initial content of the data bag. Keys are strings; values may be any value the language can hold; a wrong type is detected when the value is read. The "journey started" event lists the initial keys, not their values.
- The executor asks the instance. The executor queries the workflow instance for its step descriptors, its data bag and everything else it needs; the data bag and all other journey state belong to the instance.
Journey IDs
- One ID per journey. In tier 1 a journey has exactly one run, so it has one ID, the journey ID.
- The workflow provides it. If the workflow defines a custom ID generator, the executor calls it; otherwise the workflow uses its default generator, which produces a UUID v4. A custom generator belongs to the workflow instance, so it can derive the ID from the instance's own data, for example
order-1234. The caller does not pass an ID to the executor.
Step descriptors
-
A workflow provides one step descriptor per step, in order. The executor builds and runs steps from them. A step descriptor holds:
- the step's name (unique and case-sensitive, proposal 0008);
- how to build the step;
- its retry budget;
- whether an abnormal termination is retriable (the
abnormal termination retriablesetting); - the step policies and input adapters attached to it (Foundations).
How a language lets developers write descriptors, such as parameters on a declarative attribute, is decided in its tech spec.
-
The retry budget is per step, explicit, and 0 by default. It is the number of retries allowed after the first attempt: 0 means no retries, 1 means one retry, and so on. There is no workflow-wide default: each step that may be retried states its own budget.
-
Attempts are counted separately from retries. The first execution of a step is attempt 1. If it ends with a retriable failure and the budget allows, attempt 2 is retry 1, and so on. A step with a budget of N is attempted at most N + 1 times.
-
abnormal termination retriableis a per-step setting, false unless the descriptor says so, with no workflow-wide default. It uses the same word as a failure'sretriableflag (proposal 0008). An abnormal termination is an error the step did not anticipate, so its side effects may already have happened: it is retried only when the step's descriptor allows it, and then within the same retry budget. Otherwise the step becomesFailedand its failure hook is called with the cause "abnormal termination". This amends proposal 0008, which treated abnormal terminations like retriable failures by default (#24).
Order and the scan
- Strict order. The steps run in the order of their descriptors. Hooks cannot reorder, skip or jump between steps.
- The scan. The executor repeatedly looks at the first step that is not finished:
SucceededandSkippedsteps are passed over;- a
NotExecutedorMustRetrystep is built and run; - a
Failedstep ends the journey through its failure hook (Hooks, lifecycles and workflow roles #10); - when no step is left, the journey succeeds.
- Step statuses in tier 1:
NotExecuted,Executing,MustRetry,Succeeded,Failed,SkippedandAborted.Abortedmarks the step during which the journey was aborted, for example because it could not be built or its hook threw; the steps after it stayNotExecuted. - Run-once. A step that ended as
Succeeded,FailedorSkippedis never run again in the journey.
Retries
- A retriable failure, or an abnormal termination when the descriptor marks it retriable, puts the step in
MustRetryif its retry budget allows another attempt; both use the same budget. When the budget is exhausted, the step becomesFailedand its failure hook is called with the cause "retries exhausted" (proposal 0008). An abnormal termination that is not retriable makes the stepFailedat once, with the cause "abnormal termination". - A retry happens immediately. The executor never waits between attempts in tier 1. A delay or a backoff between attempts will be a later parameter of the step descriptor, available to every executor, including synchronous ones. A step that needs to wait before reporting a failure can do so itself.
The data bag
- One data bag per journey, held by the workflow instance. It starts with the initial data, receives committed contributions (proposal 0008), and is read by input adapters by default (Foundations). Overwriting a key, including one from the initial data, is allowed and recorded by an event (proposal 0008).
The journey result
- The data bag is the journey's output. The result always carries the data bag as it stood at the end: the initial data plus every committed contribution.
- The result also carries:
- the final status: succeeded, failed or aborted;
- every step's status and attempt count;
- for a failed journey, the step that failed and its failure reason or cause;
- for an aborted journey, the step during which it was aborted, if any, and an abort reason from a fixed list: a step could not be built, required data was missing, a value had the wrong type, a hook threw, a hook returned a lifecycle it may not return, a reporter threw.
- Finishing early. A journey ended early by
FinishWorkflow(Hooks, lifecycles and workflow roles #10) succeeds; the steps that did not run stayNotExecuted, so the result shows it ended early.
Not in tier 1
- Delays and backoff between attempts.
- Workflow-wide defaults for step descriptors.
- Several runs in one journey, and separate run IDs (tier 2).
Tier
Original proposal
Summary
How an executor runs one workflow in tier 1: the order of steps, step statuses, run-once, retries, run IDs and the result. Builds on #2 and #8.
Proposal
- Strict order. A workflow is an ordered list of steps (Foundations: step isolation, declarative workflows, policies and data flow #2, premise 2). The list you read is the order that runs. Hooks cannot reorder, skip or jump between steps.
- The scan. The executor repeatedly takes the first step in the list that is not finished:
- a
Succeededstep is skipped; - a
NotExecutedorMustRetrystep is executed; - when every step has succeeded, the workflow succeeds.
- a
- Step statuses in tier 1:
NotExecuted,Executing,MustRetry,Succeeded,Failed. - Run-once. A step that succeeded is never executed again, and a step that failed is never executed again either.
- Retries.
- A transient outcome or an abnormal termination puts the step in
MustRetryif attempts remain. Both use the same retry budget. - When attempts run out, the step becomes
Failed. - The cause of each retry (transient, or abnormal with its error) and the attempt number are available to the retry hook (Hooks, lifecycles and workflow roles #10).
- A transient outcome or an abnormal termination puts the step in
- Step configuration: the maximum number of retries, and whether an abnormal termination aborts the workflow instead of entering the retry loop.
- The data bag. Each run has an untyped data bag. Inputs are read from it by default and committed contributions are written to it (Steps #8).
- Run IDs. Every run has an ID. The caller may provide one, any string; otherwise the engine generates a UUID v4. A local executor does not check for duplicate IDs.
- The workflow result:
- the final status: succeeded, failed or aborted;
- the data bag;
- each step's final status and attempt count.
Activity
marlon-sousa commentedon Oct 1, 2026
marlon-sousa commentedon Oct 1, 2026
marlon-sousa commentedon Oct 2, 2026
marlon-sousa commentedon Oct 2, 2026
marlon-sousa commentedon Oct 2, 2026
Claude summary
Posted by Claude (Claude Code) from a maintainer's account, as described in PROCESS.md.
Evaluated with the maintainer outside the thread on 2026-10-02; every question was settled. The issue body now holds the agreed design, with the original proposal kept at the end. The earlier comments (decisions carried over from #2, the maintainer's additions, the notes from #8) are folded in and hidden as outdated.
Decided in the evaluation: one workflow instance per journey, created by the developer with optional initial data and handed to the executor; the workflow provides the journey ID (custom generator, or a UUID v4 by default); step descriptors (name, how to build the step, retry budget, abort on abnormal termination, policies, adapters); the retry budget is per step, explicit, 0 by default, with no workflow-wide defaults; attempts are counted separately from retries; retries happen immediately in tier 1 (delay and backoff later); an
Abortedstep status; the scan includingSkippedandFailed; the result carries the data bag as the journey's output, and the step and reason for a failure or an abort;FinishWorkflowsucceeds early.The conformance checklist is updated in itinera-dev/conformance#9. This proposal is ready for a maintainer to set
status: ready.github-actions commentedon Oct 2, 2026
Accepted on 2026-10-02 in #26.
marlon-sousa commentedon Oct 2, 2026