Workflow Input Contract
A workflow's Start node declares the inputs the workflow needs. Axiom provides a fixed set of standard
inputs and puts into a new run's context exactly the standard inputs the Start node declares. The registry
of standard inputs is io.apitomy.axiom.app.StandardInputs.
Standard inputs
| name | type | presence | value |
|---|---|---|---|
subject |
object | always | the run's subject: id (number), name, type, ref, refSource, repository (strings); a field with no value is null |
event |
object | only when the run was started from a stream event | the event envelope: id, type, source, eventSourceId, ref, timestamp, actor, payload |
A run is started from a stream event (all through EventStreamOrchestrator.startRunFromEvent) by:
- a subscription's
create-workflowrouting rule; - Run workflow… on the event detail page (
POST /stream/events/{eventId}/runs); - a re-run of a run that was itself started from an event (
POST /workflow/runs/{runId}/rerun).
Runs started by a schedule trigger, or as a re-run of such a run, have no event.
Declaring inputs
A Start node declares its inputs under config.inputs (a list of { name, type, required, description }).
WorkflowContentRules.startInputViolation checks the declarations at publish and in workbench validation
(propose_workflow_changes). It rejects an input when:
- its name is not a valid identifier;
- its name is not a standard input name (the message lists the standard inputs);
- its
typeis set and differs from the standard type (objectfor both); - it declares a default value — Axiom provides standard inputs itself.
Either input may be required. Requiring event is how a workflow says it must be started from an event.
New workflows (from the workbench and Components → Workflows) are scaffolded by
WorkflowTemplates.emptyWorkflow with subject and event both declared and required. A workflow run by a
schedule trigger must remove event or make it optional.
Run creation
WorkflowExecutionService.startRun resolves the declared inputs with StandardInputs.resolve:
- only declared inputs are put into the initial context; undeclared standard inputs are not provided;
- a declared optional input that is not available is absent from the context;
- a declared required input that is not available stops the run before it is created, with the message
Cannot start workflow "<name>": required input(s) not available: <names>.
How that failure surfaces depends on how the run was started:
| started by | outcome when a required input is unavailable |
|---|---|
re-run (POST /workflow/runs/{runId}/rerun) |
HTTP 400 with the message |
| schedule trigger | the firing records lastOutcome failed: <message>, for example failed: Cannot start workflow "<name>": required input(s) not available: event |
| subscription routing, Run workflow… on an event | cannot happen: both inputs are always available |
A re-run resolves its inputs again from the subject's current state and the original run's triggering event; it does not copy the original run's inputs.
The run's stored inputs (shown in the Inputs field of the run's Overview tab and returned by
axiom_get_workflow_run) are the resolved standard inputs without event; the event is linked to the run as
its trigger instead.
Reading inputs
Expressions read standard inputs from the run context, for example context.subject.ref,
context.subject.repository or context.event.payload.pull_request.number.
Reading a standard input that the Start node does not declare (for example context.subject without
declaring subject) is not reported, because a node output with that name may legitimately provide the key.
Standard input names are not reserved.
Shadowing warning
Workflow validation (ConfigItemValidationService.validateWorkflow, which backs the workbench's
propose_workflow_changes problems and assistant item validation) reports a warning with code
SHADOWS_WORKFLOW_INPUT when a node would write a context key equal to the name of a declared Start input,
for example Output 'event' of node 'Review' overwrites the workflow input 'event' for later nodes. The
check is WorkflowContentRules.shadowProblems and does not block publish. It considers these output keys:
- an
actionnode'sconfig.outputs(by their context key); - the declared outputs of the node's action type that the node does not rename;
- a
human-tasknode's form fields (by their context key); - a
receive-eventnode's output mapping context keys.
sdk: node results are not declared anywhere and are not checked.
Passing context to action types
Action types never read the run context directly. Each action node maps values into the action type's
declared inputs, for example context.subject.ref into a ref input. Every required action-type input must
be mapped, mapping an undeclared input name is an error, and an unmapped optional input is simply absent. See
Inputs, Placeholders and Mappings.
Action type inputs and outputs at run time
When a workflow task runs, TaskExecutionService checks the task's resolved inputs before it runs the action
type:
InputBindingResolver.missingRequiredInputslists required declared inputs with no value (absent,nullor a blank string). If any are missing, the task fails withMissing required input(s): ....ActionTypeIoValidator.validatechecks each supplied value against its declared type. A mismatch fails the task withInput validation failed: ....
When the task completes, WorkflowExecutionService validates its outputs against the action type's declared
outputs with the same validator. A mismatch fails the task and the node with Output validation failed: ....
Workbench test runs (DraftTestRunner) use the same validator for inputs and outputs.
ActionTypeIoValidator accepts a value that already has the declared type or can be converted without loss:
| Type | Accepted values |
|---|---|
string |
strings, numbers and booleans |
number |
numbers, and strings that parse as a number |
boolean |
booleans, and the strings true / false (any case) |
object |
any JSON structure: an object or an array, or a string that parses as one |
Any other declared type is not checked. InputBindingResolver also substitutes {{inputs.NAME}} placeholders
in agent prompts and scripts: strings are inserted as-is, null becomes an empty string, and other values
are serialized as JSON.