Skip to content
Tutorials Center
My learning

Topics

Lesson 20 of 39 ยท Workflows and Flow Designer

Flow Triggers and Conditions in ServiceNow

Learn the ServiceNow flow trigger types (record created or updated, scheduled, application, email) and how trigger conditions and run options avoid loops.

A trigger decides when a flow starts. Choosing the wrong trigger or writing a loose condition is the most common reason a flow runs too often, too rarely, or in an endless loop. This lesson covers the trigger types you will use daily and how to write conditions that fire exactly once when they should.

Trigger families

When you click Add a trigger in Flow Designer you pick from these groups:

Group Fires when Example
Record A record on a table is Created, Updated, or Created or Updated New incident with priority 1
Date A date or time field on a record is reached (with an offset) Three days before a change's planned start
Schedule A clock says so: Daily, Weekly, Monthly, Repeat, Run Once Every night at 02:00
Application Another capability emits it: Inbound Email, SLA Task, Service Catalog, REST/SOAP A catalog item is ordered

You will use record and schedule triggers most.

Record triggers

For a record trigger you choose a Table (for example Incident [incident]), a Condition and a Run Trigger option.

The condition is the familiar filter builder: field, operator, value, joined by AND/OR. A condition such as Priority is 1 - Critical and Active is true limits the flow to records that match.

Updated triggers need extra care. A condition is evaluated on the record as it is saved. If the flow fires on every update where Priority is 1, then each later edit of that incident fires it again. To react only when the field changes into the state you care about, use an operator such as changes to, or add a condition on the previous value.

Run Trigger: once or for every update

Under the condition there is a setting with two main choices:

  • Once: the flow runs one time per record, the first time the condition matches.
  • For each unique change: the flow runs again whenever the condition becomes true again after a change.
  • Only if not currently running: skip a new run while an earlier run for the same record is still active.

Beginners should choose Once unless they can explain why the flow must repeat.

Avoiding loops

A flow that updates the same table it was triggered by can retrigger itself. Example: the trigger is "incident updated", and a step sets the assignment group on that incident, which saves an update, which fires the trigger, and so on.

Three defenses work together:

  1. Add a condition that is false after your own change, such as Assignment group is empty.
  2. Use Once as the run option.
  3. Use the platform's recursion limit as a safety net, not as the plan. ServiceNow stops runaway flows, but a flow that hits that limit is already a defect.

Scheduled triggers

A scheduled trigger has no record. Pick Daily and a time (the instance time zone applies, so check the Time Zone field) or Repeat with an interval. A common pattern is a nightly flow that uses Look Up Records to find stale work and then For Each to act on each one. You will build exactly that in a later lesson.

Date triggers

A date trigger ties a flow to a field on the record: "start 2 days before planned_start_date". It is better than a schedule that checks every record every hour, because the platform schedules one job per record.

Application triggers

Examples:

  • Inbound Email: the flow runs when a matching email arrives; the data pills include the sender, subject and body. Use it to create records from messages.
  • Service Catalog: the flow runs when a requester submits a catalog item, and the variables they filled in become data pills.
  • REST or SOAP: lets an outside system start a flow by calling an endpoint.

Practice a trigger condition

The stand-in below models how a "once, when the value changes into a condition" trigger behaves compared with a naive "on every update" trigger. It is JavaScript written for this lesson and is not ServiceNow code.

JS Stand-in: naive trigger vs change-aware trigger

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Notice that the naive version fires on three saves where nothing about priority changed, and the change-aware version fires only twice, each time the priority really became 1.

JS Stand-in: a filter builder for trigger conditions

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Choosing the table and the event

Triggering on a parent table such as Task also catches every child table (Incident, Change, Problem). That is powerful and dangerous: always add a condition on Task type or use the child table directly unless you truly want all of them.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the main risk of a record-updated trigger with the condition 'Priority is 1' and no run limit?

    The condition stays true on each save, so every update that keeps priority at 1 retriggers the flow.
  2. 2. Which trigger type has no triggering record?

    A scheduled trigger fires from the clock, so you usually use Look Up Records inside the flow.
  3. 3. Which run option makes a flow run one time per record?

    Once runs the flow a single time per record, the first time the condition matches.
  4. 4. A flow triggered by incident updates sets the assignment group on the same incident. What prevents a loop?

    A condition like 'Assignment group is empty' goes false after your update, and Once adds a second guard.

Summary

  • A flow has one trigger: record, date, schedule or application.
  • Record conditions use the filter builder; use change-aware operators so updates do not refire the flow.
  • Pick Once unless a repeat is deliberate, and guard against loops when a flow updates its own table.
  • Triggering on a parent table such as Task includes all child tables.

Next: Data Pills, Flow Variables and Logic