ServiceNow Concepts
Key ServiceNow Flow Designer concepts relevant to letitflow-sn.
Flows vs Subflows
ServiceNow has two types of flow definitions:
- Flow — a top-level process that starts automatically when a trigger fires. Has a trigger, no input parameters.
- Subflow — a reusable process called from other flows or subflows. Has input/output parameters, no trigger.
Triggers
A trigger defines what starts a flow. Trigger types fall into three categories:
- Record — fires when a record is created, updated, or both on a specified table
- Scheduled — fires on a time schedule (daily, weekly, monthly, repeat, once)
- Application — fires in response to an application event (Service Catalog, inbound email, Knowledge Management, etc.)
Each flow has exactly one trigger.
Steps
Steps are the building blocks of flow logic. Types include:
- Actions — call built-in platform actions (Look Up Record, Create Record, Send Email, etc.)
- Subflow calls — invoke another subflow
- Logic containers — control flow with If/Else, For Each, Do Until, Parallel, Try/Catch
- Flow variables — set scratch variable values
- Output assignment — set subflow output values
Steps form a tree structure — logic containers hold child steps.
Data Pills
Data pills are the primary way to pass data between steps in Flow Designer. A pill represents a piece of data — a field value, a step output, an input parameter — that can be dragged onto an input field.
In YAML, pills are written as $source.field references (see Pill References).
Pill sources include:
- Trigger — fields from the triggering record
- Inputs — subflow input parameters
- Variables — scratch variables
- Step outputs — results from earlier steps
Published vs Draft
Flows have two states:
- Draft — editable but not active; changes don't affect running instances
- Published — compiled and active; the platform runs this version when the trigger fires
Publishing a flow creates a snapshot that the platform uses at runtime. The tool handles this compilation process automatically when status: published is set.
Scope
Every flow belongs to an application scope. The scope determines:
- Which tables and records the flow can access
- Which other flows can call it
- Where it appears in the Flow Designer UI
Flows with access: public can be called from any scope. Flows with access: package_private are only accessible within their own application.
Run As
The run_as setting controls the security context:
- System — runs with full system privileges
- User — runs with the privileges of the user who triggered the flow
Encoded Queries
ServiceNow uses "encoded query" format for conditions — a compact string representation of filter criteria:
priority=1^active=true^stateNOT IN6,7This means: priority equals 1 AND active is true AND state is not in (6, 7).
Operators include =, !=, >, <, LIKE, IN, NOT IN, ISEMPTY, ISNOTEMPTY, STARTSWITH, ENDSWITH, BETWEEN, CHANGESFROM, CHANGESTO, and more.