- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
10-24-2022 02:48 AM - edited 12-03-2024 05:38 AM
Workflow Automation CoE > Flows > Best Practices > General
Flows Best Practices
Application Scope
- Create Flows and Actions in a scoped application.
- Use ServiceNow source control integration with Git for versioning, forking and branching of your flows.
- Application names should not include version as part of the name.
Guidelines for creating flows
- Add annotations to provide context, when action titles are insufficient
- Flow Annotations are generally used by a developer to provide context when authoring a flow. Annotations on an action are optional. Only use annotations if the flow step needs extra description e.g. do not have annotation that repeats what the action name or subflow e.g. My Action is Create User, an Annotation that says, "This action will create a user" has negative value and creates noise on the flow.
- Add a log step for each possible branch of the flow to assist in debugging or triage.
- Limit inline scripting use to field formatting and field validation.
- Use conditions in trigger to pull a smaller set of records.
- Only trigger flows when required.
- Flow Variables.
- Similar to Workflow scratchpad variables, create variables that you can use and modify directly in your flow. Access flow variables as data pills directly in the Data panel.
- Use flow variables to store data and pass it between outside of branching logic.
- Flow variables are mutable, where subflow and action inputs and outputs are immutable. That is, Flow Variables can change through the life of the flow, where-as inputs/outputs cannot. Subflow and Action inputs/outputs are configured and set at point in time during the flow, and cannot be changed.
Subflows
- Flows should be short, modular reusable. Use subflows as reusable automation, just like actions.
- Consider actions as single purpose atomic events, where-as subflows are composite logic made of up actions, logic and other subflows.
- Consider using subflows for portions of your logic, when the flow exceeds 25 actions.
- Note: You can use triggered flows as subflows. To see the triggered flows in your subflow picker, enable the "show triggered flows" in the flow preferences dialog.
- Use the Reference.Table output and map the full record instead of a String with just the sys_id of a record. This saves you an extra Look Up Record step after using a subflow.
Naming convention
- Include a Description for your Flow.
- Use human readable names for Flow Name, Subflow Inputs and Subflow Outputs.
- All Input/Output labels use Camel Case with spaces.
- Categorize your Flows and Subflows when the application scope includes more than a few Flows and Subflows.
- Categorized Flows and Subflows appear in the Subflow picker menu
- Note: to show Triggered flows in your Subflow picker, enable the Flow preference "Show Triggered Flows" toggle preference.
Decisions
- Use Decision Tables when your flow has a condition with nested else-ifs.
- Check out how to get started with Decision Tables.
Notifications
- When sending emails from a flow, choose the “Send notification” action over the (legacy) “Send email” action. System notifications need to be set to “Send when = Triggered” to show up in Flow Designer. This allows you to benefit from:
- Notification email templates
- Standardized email headers & footers
- Multilingual email notifications
Center of Excellence Navigation
- 10,188 Views

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Super useful best practices!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Amazing, great content. Thanks for sharing 🙂
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thanks for this useful overview!
Are there any Best Practices regarding the Upgrade process when it comes to OOTB Flows? As an example with Approval Flows, since they are mostly the target of changes...is it better to modify them or to disable/clone them? The discussion internally was, that it's better to see any changes on each Upgrade to always have the option for latest changes/fixes evaluated (having a higher priority in the Upgrade Review process).
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
What is the reasoning behind building Flows in a scoped app? I can understand having a Flow in a scope if it related to a scope app. What if the item is in Global? For example, we are looking to move some of our catalog item's workflows to Flows. The catalog items reside in Global, should the associated Flows sit in Global or be in a custom scope?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Matteo11 Apologies for the delayed reply! I'll make sure to be notified about replies on this topic!
Our current recommendation is to go ahead and make changes to OOTB artifacts, so you'll get notified about changes to the OOTB codebase when upgrading via Skipped Records and can then decide to accept baseline or retain your customization. There are some artifacts that are read-only, which you'd have to copy/clone instead.
@zynsn if the use case demands it, flows can be created in the global scope, we recommend to make use of Global applications to collect them:
https://docs.servicenow.com/bundle/vancouver-application-development/page/build/applications/concept...