Attributes
Share results between capabilities and decide which inputs are essential, optional, or worth waiting for.
Values Shared by Steps
An Attribute is a named value shared within a Flow: an order ID, a payment receipt, a document, or a model’s answer. Steps declare which values they need and which they produce, so several consumers can reuse a result. Matching names connect a producer to the consumers that need its value.
- Inputs are the values a Step consumes.
- Outputs are the values it contributes to the Flow.
Attribute Roles
Required Input
The Step cannot execute until this input’s Collection Policy is satisfied. Values come from the Flow’s initial state or from upstream Steps: earlier Steps that produce values used by it. The none policy instead requires confirmed absence and supplies no value.
Optional Input
The Step can execute without this value. Optional inputs can have a default value and a deadline (milliseconds) that limits how long collection can remain inactive. If the Collection Policy is still unsatisfied when the window expires, the Step uses the default, or omits the input when no default is declared.
Constant
A fixed value built into the Step definition, sent as input on every execution. The value is written as JSON. Use it for Step configuration:
{
"region": {
"role": "const",
"const": { "value": "\"us-east-1\"" }
}
}
Metadata
A value drawn from execution metadata at invocation time. The key selects a field such as flow_id, step_id, receipt_token, or webhook_url. Argyll resolves it separately for each Work Item and sends it as a Step-local input:
{
"callback_url": {
"role": "meta",
"meta": { "key": "webhook_url" }
}
}
Feed
The value of a Feed, captured when the Flow starts. Every Step in the Flow that reads the Feed receives the same value, and the input never holds a Step back. The id names a registered Feed:
{
"running_total": {
"role": "feed",
"feed": { "id": "order-total" }
}
}
Output
The Step may produce this Attribute value for downstream Steps that declare it as an input. Successful executions may omit declared outputs.
Argyll records an output as a Flow Attribute when its Step is a Goal or a pending consumer still needs the value. Other outputs remain in the Work Item history.
Attribute Values
An Attribute holds any JSON value:
- Strings
- Numbers
- Objects
- Arrays
- Booleans
- Null
An optional default is written as JSON, and registration checks that it parses.
Invocation Mapping
The name used in Flow state is the Attribute’s outer name: the key in the Step’s attributes object. A mapping.name gives that Attribute a different inner name in the HTTP request or response.
This Step consumes the Flow Attribute customer_id but sends it to the endpoint as customerId:
{
"customer_id": {
"role": "required",
"required": {
"mapping": { "name": "customerId" }
}
}
}
Input mapping changes the name and optional value transformation before the Step Predicate and invocation. The script receives only the selected input under mapping.name, or the Attribute’s outer name when no inner name is configured. Matching and collection happen before this transformation. The mapping runs on the resolved value, which can be a collected list. Output mapping reads the endpoint’s inner name or transforms its raw outputs, then stores the result under the outer Attribute name for downstream Steps. These mappings also apply to Script Steps.
Use mapping.script for transformations in Argyll Expressions or Lua. An input mapping error passes through the original value. An output mapping error omits that output. See Validation and Failure Behavior for the shared script rules.
An Argyll Expressions output mapping receives only the raw output object, under the output Attribute’s outer name, even when mapping.name is configured. With multiple Work Items, mapping runs after their outputs are aggregated. Use Argyll Expressions for output transformations that inspect the raw outputs.
Collection Policies
When multiple Steps can produce the same Attribute, the Collection Policy on an input controls when the Step is satisfied and what value it receives. Set it inside the input’s role-specific configuration:
{
"price": {
"role": "required",
"required": { "collect": "last" }
}
}
| Policy | Satisfied when | Value received |
|---|---|---|
first | First value arrives | That value (remaining providers removed because they are no longer needed) |
last | All providers finish | The last value produced |
some | All providers finish and at least one value arrived | Array of all values that arrived |
all | All providers succeed and supply the Attribute | Array of all values |
none | All providers finish with no value | Nothing (gating on absence) |
The default policy is first.
If a required input cannot satisfy its Collection Policy and no provider can change that, the Step fails. The Flow fails if its Goals are no longer reachable.
Planning applies the same policies. A required all input whose providers cannot all have their own required inputs satisfied must come from the initial state instead. A Step whose required none input is declared with values in the initial state stays out of the plan.
For example, if two providers produce prices of 10 and 12, last waits for both to finish and selects whichever value arrived last.
Use none to run a Step after confirming that a value is absent, such as proceeding when no fraud signal was raised. With no initial value and no planned providers, absence is confirmed immediately. Otherwise, Argyll waits for all providers to finish without supplying the Attribute.
Match Predicates
A required or optional input can declare a match script that filters candidate values before collection. Each candidate is evaluated individually, and only values that pass are collected. When the Flow’s initial state declares the Attribute, those initial values form the complete candidate set.
{
"attributes": {
"payment_result": {
"role": "required",
"required": {
"match": {
"language": "argyll",
"script": "value?.status == \"approved\""
}
}
}
}
}
The match script receives one candidate at a time as value, in both Argyll Expressions and Lua, and must return a boolean. With optional access in value?.status, an object without a status property does not match. A null candidate causes an access error. Use value != null && value?.status == "approved" to exclude null candidates.
For a required input, a match error fails the consuming Step before its work starts. Returning false instead filters out that candidate and can close the match gate described below. See Validation and Failure Behavior for compilation and result checks.
Required inputs also have a match gate. For first, last, and some, the gate closes once providers finish with no candidate passing. For all, every provider must deliver a passing value, so the gate is unmatched when any candidate fails the match, or when a provider fails, is skipped, or finishes without supplying the Attribute. For none, any matching candidate makes it unmatched. Execution records a closed gate after providers are terminal and skips the Step without demanding its other required inputs.
Optional inputs have no Step-level match gate. Their filtered values are judged against their Collection Policy, with the configured default used only when collection is unfulfilled.
Guard missing or null values explicitly in optional matches. An evaluation error there leaves collection unresolved and keeps the Step pending.
With for_each, the matched candidate list is expanded into Work Items. An empty result contains zero candidates, which differs from one candidate whose value is an empty array.
Initial Values Are Authoritative
Naming an Attribute in the Flow’s initial state freezes it at those values for every consumer.
An empty array is a declaration too. Without a required match predicate, it lets some and all receive an empty array and a for_each input create zero Work Items, while a required first or last input declared empty fails its Step. With a required match predicate, an empty array closes the gate for all four policies and skips the Step instead. An optional some or all input resolves to an empty array even if its match predicate rejects every initial value. Leave a name out of the initial state entirely to let providers supply it.
A Step may still run to produce other Attributes. Its outputs for names declared in the initial state are discarded, including outputs from Goal Steps. The raw outputs remain in Work Item history.
In the Flow creation UI’s basic editor, a JSON array represents the complete candidate list. Comma-separated values are also accepted: 1, 2 and [1, 2] both supply two candidates. A blank field leaves the name out of init, while [] explicitly freezes it at zero candidates. Type "" to supply one empty-string candidate, or [[]] to supply one empty-array candidate. Switching between basic and JSON modes preserves these distinctions. In the JSON editor, omit an absent key or leave its value as "", and use [""] for an actual empty-string candidate.
Collection Deadline
Optional inputs can declare a deadline (milliseconds) that sets the input’s collection inactivity interval:
- The window opens when all of the Step’s required inputs are satisfied. Values already available are included.
- Each value arriving before expiry resets that input’s timer while its Collection Policy remains pending. Other optional inputs have independent timers. Provider completion without a value does not reset a timer.
- Collection ends immediately when the policy is satisfied or becomes impossible to satisfy.
- If the window expires before the policy is satisfied, the Step uses the declared default, or omits the input if no default exists. Partial results do not satisfy
last,some, orallwhile providers are still pending.
An expired window stays closed, and late values remain available to other consumers. Once an optional input has its value or its default, upstream Steps that have not started are skipped unless another Step still needs their outputs. A deadline of 0, or no deadline, means no waiting: the input must already satisfy its policy when the required inputs become ready.
{
"profile": {
"role": "optional",
"optional": {
"collect": "last",
"deadline": 2000,
"default": "{}"
}
}
}
For this last input, a value at 1.5 seconds moves expiry from 2 seconds to 3.5 seconds. Another value at 3 seconds moves it to 5 seconds. If all providers finish at 4 seconds, the Step uses the last value immediately. If providers are still pending at 5 seconds, the input uses {} instead.
The Step proceeds once all required inputs are satisfied and every optional input has either satisfied its policy or selected its fallback. If collection becomes impossible before expiry, the input selects its fallback immediately. For example, all cannot succeed after a provider finishes without supplying the Attribute, and none cannot succeed after any value arrives.