Skip to content

Step Types

Every step in the steps list must have exactly one type key that determines what it does.

Action

Calls a ServiceNow action (e.g., Look Up Record, Create Record, Send Email).

yaml
- action: lookup_record
  name: Find the Caller
  inputs:
    table: sys_user
    conditions: "sys_id=$trigger.current.caller_id"

The action value is an alias (like lookup_record) or the full SN action name. Common aliases:

AliasAction
lookup_recordLook Up Record
create_recordCreate Record
update_recordUpdate Record
delete_recordDelete Record
create_taskCreate Task
update_field_valuesUpdate Field Values
send_emailSend Email
send_notificationSend Notification
logLog
run_scriptRun Script

Subflow

Calls another subflow by sys_id or name:

yaml
- subflow: abc123def456abc123def456abc123de
  name: Notify On-Call
  inputs:
    incident: $trigger.current.sys_id

If / Else If / Else

Conditional branching:

yaml
- if: "$trigger.current.priority = 1"
  then:
    - action: send_email
      inputs:
        to: oncall@example.com
        subject: P1 Alert
        body: "Priority 1 incident created."
  else_if:
    - condition: "$trigger.current.priority = 2"
      then:
        - action: log
          inputs:
            message: "P2 incident, logging only."
  else:
    - action: log
      inputs:
        message: "Low priority, no action."

Rules:

  • then is required
  • else_if and else are optional
  • Multiple else_if blocks are allowed
  • Each else_if needs a condition and then

Condition Inputs

For fine-grained control, use inputs instead of the inline condition string:

yaml
- if: "$trigger.current.state"
  inputs:
    operator: "="
    rhs: "6"
  then:
    - action: log
      inputs:
        message: Resolved

For Each

Loop over a list:

yaml
- for_each: "Loop through users"
  inputs:
    items: $find_users.record_list
  do:
    - action: send_email
      inputs:
        to: $current.email
        subject: Notification
        body: "Hello!"

Do Until

Loop until a condition is met:

yaml
- do_until: "Retry until success"
  inputs:
    operator: "="
    rhs: "true"
  do:
    - action: run_script
      inputs:
        script: "// attempt operation"

Parallel

Run branches simultaneously:

yaml
- parallel: "Check multiple systems"
  branches:
    - - action: lookup_record
        name: Check CMDB
        inputs:
          table: cmdb_ci
      - action: log
        inputs:
          message: "CMDB check done"
    - - action: lookup_record
        name: Check Users
        inputs:
          table: sys_user

Each item in branches is a list of steps that runs as one parallel branch.

Try / Catch

Error handling:

yaml
- try: "Attempt API call"
  do:
    - action: lookup_record
      inputs:
        table: sys_user
        conditions: "sys_id=invalid"
  catch:
    - action: log
      inputs:
        message: "API call failed, handling gracefully."

Both do and catch are required.

Wait

Pause execution:

yaml
- wait: "Wait for approval"

End

Stop the flow:

yaml
- end: "Stop here"

Decision

Decision table:

yaml
- decision: "Route by category"
  inputs:
    table: my_decision_table

Set Flow Variables

Assign values to scratch variables:

yaml
- set_flow_variables: "Store result"
  inputs:
    counter: "1"
    status: $find_record.record.state

Assign Outputs

Set subflow output values:

yaml
- assign_outputs: "Return result"
  inputs:
    success: "true"
    record_id: $create_record.record.sys_id

Common Fields

All step types support these optional fields:

FieldDescription
idUnique step identifier (for pill references and updates).
nameDisplay name shown in Flow Designer.
commentDeveloper comment (not shown at runtime).
inputsKey-value map of configured inputs. See Input Formats.