Skip to content

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 reference

Input

Access subflow input parameters:

yaml
$input.my_param
$input.recipient.email    # Dot-walk on reference inputs

Variable

Access scratch variables:

yaml
$variable.counter
$variable.temp_record

Step 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: incident

Then reference it as $my_lookup.<output>.

Common action outputs:

ActionOutputs
lookup_recordrecord, record_count
create_recordrecord, record_sys_id
run_scriptScript-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 that id
  • Referenced steps appear before the referencing step (no forward references)
  • $trigger, $input, and $variable are reserved and not checked against step IDs
bash
letitflow-sn --validate my-flow.yaml

If a pill reference points to an undefined step ID, you'll see:

pill reference $find_user (in input "to") refers to undefined step id