Skip to content

Step Types

Every step in the steps list needs exactly one type key.

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

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

The action value is an alias or the full SN action name.

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

Call another subflow by sys_id or name:

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

Conditional branching:

- 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

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

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

Loop over a list:

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

Loop until a condition is met:

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

Run branches simultaneously:

- 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.

Error handling:

- 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.

Pause execution:

- wait: "Wait for approval"

Stop the flow:

- end: "Stop here"

Decision table:

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

Assign values to scratch variables:

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

Set subflow output values:

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

All step types support these optional fields:

FieldNotes
idUnique 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.