Saved flow triggers
Summarize
Summary of Saved flow triggers
Saved flow triggers in ServiceNow allow you to create and store reusable trigger definitions that flow authors can select when designing application flows. This feature streamlines flow creation by enabling the reuse of predefined triggers across multiple flows, ensuring consistency and simplifying maintenance by pushing updates to all flows using a saved trigger simultaneously.
Show less
Key Features
- Reusable Trigger Definitions: Save and reuse trigger configurations to avoid recreating triggers for each flow.
- Centralized Updates: Changes to a saved trigger automatically update all flows that use it.
- Trigger Visibility and Condition Controls: Specify if flow authors can view trigger details or add conditions when using the saved trigger.
- Support for Record-Based Triggers: From the Yokohama release onward, only record-based triggers are supported for saved flow triggers.
- Advanced Options for Flow Execution: Configure session types (interactive or non-interactive), user restrictions, and table scope for triggering flows.
- Flow Execution Context: Choose whether flows run asynchronously in the background (default) or synchronously in the foreground, depending on the immediacy of updates required.
Using the Workflow Studio Interface
Within Workflow Studio, the Triggers component allows you to create, publish, edit, and manage saved triggers. Key interface elements include:
- Publish and action menus to manage trigger lifecycle.
- Undo/redo and auto-save functions to streamline trigger creation.
- Select trigger types and target tables.
- Define conditions and specify whether flow authors can modify them.
- Configure advanced trigger options such as session requirements and user-based execution controls.
Practical Considerations
- Session Type Options: Define if a flow triggers during interactive sessions, non-interactive sessions, or both, tailoring flow behavior to user context.
- User Restrictions: Control which users can trigger a flow, either by excluding certain users or limiting to specific users.
- Table Scope: Choose whether the flow triggers only on a specific table or also on its extended tables.
- Foreground vs Background Execution: Use background execution for non-urgent flows to optimize system performance, and foreground execution when immediate user updates are necessary, keeping in mind that foreground flows may block user interaction during execution.
- Modification of Saved Triggers: Flow authors can be allowed to modify conditions or advanced options per flow usage; such changes isolate their instance from future trigger updates.
Next Steps
ServiceNow customers can create, edit, or delete saved record-based triggers within Workflow Studio to leverage these benefits. This capability supports efficient flow development and maintenance by promoting trigger reuse and centralized management.
Save a set of trigger definitions as a reusable trigger. Enable flow authors to select the saved trigger from some or all application flows. Specify whether flow authors can see the trigger details or add conditions to the trigger.
Benefits
- Allow flow authors to select predefined trigger definitions without the hassle of creating a trigger.
- Push changes to every flow that uses a saved trigger rather than having to update each flow manually.
- Reuse trigger definitions in multiple flows.
UI elements
The Workflow Studio home page displays a Triggers option in the list of available components and the list of new components.
- 1. Publish and more actions
- Publish the trigger for consumption or access the More actions menu to delete the trigger, edit the trigger properties, view flows that are using the trigger, or force save your changes.
- 2. View options
- View the draft version of the trigger for all latest changes or view the published trigger.
- 3. Redo and undo buttons
- Redo or undo an action that you have performed while creating the trigger.
- 4. Auto-save icon
- View if and when your changes are automatically saved.
- 5. Trigger type & table section
- Select the trigger type and table from the available options.
For more information about trigger types, see Workflow Studio flow trigger types.
- 6. Conditions section
-
Specify the conditions for the trigger. Add more conditions as you need.
You can allow flow authors to view the conditions or to view and add more conditions when they use the saved trigger in a flow. The changes don't affect the saved trigger.
- 7. Advanced Options section
-
Specify the user session requirements needed to start a flow in the Advanced Options section.
- When to run the flow
-
Determine the type of session that can trigger the flow, whether to run the flow when triggered by certain users, and which tables can trigger the flow.
Table 1. Interactive session drop-down menu options Option Description Only Run for Non-Interactive Session Flow that is triggered only in non-interactive sessions. See Non-interactive sessions. Only Run for User Interactive Session Flow that is triggered only in interactive sessions. Run for Both Interactive and Non-Interactive Sessions Flow that is triggered in all sessions. Table 2. User drop-down menu options Option Description Do not run if triggered by the following users Flow that doesn't trigger for a selected list of users. Select the Add User icon ( ) to add users to the list.
Only run if triggered by the following users Flow that triggers only for a selected list of users. Select the Add User icon ( ) to add users to the list.
Run for any user Flow that runs for any user. Table 3. Table drop-down menu options Option Description Run only on current table Flow that is triggered only for the selected table. Run on current and extended tables Flow that is triggered for the selected table and any extended tables. - Where to run the flow
-
Determine whether to run the flow in the background or in the current session.
Option Description Run flow in background (default) Flow that runs asynchronously in the background. Use this option for flows that don't require immediate updates and to allow other system processes to run at the same time. Run flow in foreground Flow that runs synchronously in the current session. Use this option to provide immediate updates to an end user. For example, if a flow opens a task after the previous task closes, use this option to open the next task immediately after a user closes one. Note:Running a flow in foreground may block the current session thread and prevent user input until the flow finishes. Avoid running flows in the foreground when they contain actions that cannot be interrupted, such as actions that run script. Actions or flow logic that pause a flow will not block a session.