Pill References
Pill references let you wire data between steps — passing the output of one step as the input to another.
Syntax
Pill references use a $ prefix followed by a source and field path:
$<source>.<field>
$<source>.<field>.<subfield>Sources
Trigger
Access fields from the triggering record:
yaml
$trigger.current.number # Record number
$trigger.current.short_description
$trigger.current.caller_id # Reference field (sys_id)
$trigger.current.caller_id.email # Dot-walk through referenceInput
Access subflow input parameters:
yaml
$input.my_param
$input.recipient.email # Dot-walk on reference inputsVariable
Access scratch variables:
yaml
$variable.counter
$variable.temp_recordStep Output
Reference outputs from earlier steps using the step's id:
yaml
steps:
- action: lookup_record
id: find_user
inputs:
table: sys_user
conditions: "sys_id=$trigger.current.caller_id"
- action: send_email
inputs:
to: $find_user.record.email # Output from step "find_user"
subject: "Hello $find_user.record.name"Step IDs
To reference a step's output, give it an id:
yaml
- action: lookup_record
id: my_lookup
inputs:
table: incidentThen reference it as $my_lookup.<output>.
Common action outputs:
| Action | Outputs |
|---|---|
lookup_record | record, record_count |
create_record | record, record_sys_id |
run_script | Script-defined outputs |
Embedding in Strings
Pill references can be embedded in text:
yaml
inputs:
subject: "Incident $trigger.current.number needs attention"
body: "Assigned to $find_user.record.name ($find_user.record.email)"Validation
The --validate command checks that:
$<step_id>references point to a step with thatid- Referenced steps appear before the referencing step (no forward references)
$trigger,$input, and$variableare reserved and not checked against step IDs
bash
letitflow-sn --validate my-flow.yamlIf a pill reference points to an undefined step ID, you'll see:
pill reference $find_user (in input "to") refers to undefined step id