- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Ask the Experts: Flow Performance and Debugging
Struggling with debugging or optimizing flows in ServiceNow? This Platform Academy session is packed with insights to help you make the most of the Flow Engine and Flow Debugger.
Hosted by Sharon Barnes with a panel of ServiceNow experts, including Eric, Riya, Sravya, Vincent, and others, you’ll get practical demos, best practices, and answers to common developer questions.
Watch this session on YouTube now!
Resources
Last Platform Academy on Debugging:
https://sn.works/platformacademy/19
Error Handling:
https://sn.works/CoE/ErrorHandling
Getting Started with Playbooks:
https://sn.works/CoE/StartPlaybooks
Approvals in Flows:
https://sn.works/CoE/FlowApproval
Creator Toolbox (skip to 36:50 for Flow Debugger)
SNU content (AKA Now Learning)
Debugging and Optimizing Flows in ServiceNow: Key Takeaways from Platform Academy
Building reliable flows in ServiceNow can get tricky, especially when errors surface or performance slows down. In this Platform Academy session, ServiceNow experts unpacked everything you need to know about the new Flow Debugger, flow performance, and strategies for handling complex automation.
Flow Debugger in Action
First introduced in the Yokohama release, Flow Debugger eliminates the guesswork from troubleshooting. With breakpoints, step navigation, and direct integration into the platform script debugger, developers can debug long, complex flows and custom action scripts more easily than ever before.
Performance Best Practices
Flows that grow too large can quickly impact memory and execution time. Here are the key recommendations from the session:
- Keep flows under 25 actions; split into subflows when necessary.
- Hard limit: 50 actions per flow (system-enforced).
- Loops: avoid going beyond 1,000 iterations.
- Minimize detailed logging except when actively troubleshooting.
- Run flows asynchronously whenever possible for better resource management.
Playbooks for Complex Automations
When flows become massive, Playbooks can orchestrate multiple subflows with a UI layer, making them more manageable and user-friendly. And they’re no longer limited to workspaces—they work in portals and mobile apps too.
What’s New in Zurich
The upcoming Zurich release brings flow history and auto-save, allowing you to revert to earlier versions and track changes with timestamps and editor details. It also expands flow variable support to include arrays of objects and strings.
Workflow Migration Guidance
Migrating from legacy workflows to flows isn’t a copy-paste job. Instead, it’s an opportunity to re-examine processes, optimize them, and take advantage of modern integrations and automation patterns.
Q&A Nuggets
- Are there any ACLs or specific roles required for debugging, or are the standard flow roles sufficient?
Answer: Standard flow roles. Initially, a flow_debugger role was introduced but later removed to simplify access.
- Is debugging only available in Zurich?
Answer: No, it was introduced in Yokohama.
- Can you debug flows from a different scope or do you have to be in the flow's scope to debug?
Answer: You can access execution even if the flow is in a different scope.
- If you provide a record as input, like an incident or RITM, does it run the flow based on the record in its current state or its initial state?
Answer: It runs based on the current state. Debugging is similar to testing.
- Should you debug flows in a Production instance or only development instances? Is there performance impact in Prod?
Answer: Best practice is to debug in non-prod instances, but it is available in production.
- How do we troubleshoot slow flows?
Answer:
- Step-Level Runtime Analysis
- Check the runtime of each step to pinpoint slow actions and optimize accordingly.
- Flow Size & Complexity Limits
- Limit flow actions to 25 for best performance; system max is 50.
- Error handling sections: max 10 items.
- Loops: avoid iterating over more than 1,000 items.
- Logging Overhead
- Enable full logging only for critical flows.
- Minimize or disable logging for routine flows to reduce system load.
- Asynchronous Execution
- Let flows run asynchronously (default) for optimal scheduling and to avoid blocking other processes.
- Queue Management & Prioritization
- Assign higher priority to business-critical flows.
- Set lower priority for large-volume or slow-running flows.
- Architectural Considerations
- Number of concurrent flows depends on event handlers (default: 3 per node).
- Node affinity ensures flows run on the node where triggered, reducing queue latency.
- Use Playbooks for Complex Flows
- For highly complex or lengthy flows, consider orchestrating with playbooks for better manageability and UI integration.
- Can a flow be replaced by a playbook?
Answer: No direct conversion exists, but you can reuse subflows and actions in playbooks.
- Is it better to set them up as scheduled jobs in the first place?
Answer: Both approaches are fine. Scheduled jobs are triggered backend automation.
- When will we be able to search for scripted content?
Answer: No specific timeline; under exploration.
- Is there a guideline or video to assist with replacing flows with playbooks?
Answer: Yes, refer to the Workflow Automation CoE: https://sn.works/CoE/StartPlaybooks
And check out the training available on ServiceNow University:
- How to move a flow to another instance?
Answer: Flows are represented as a single file in update sets.
- When will the ability to search flow by name be added?
Answer: This is already available via column header filters in Workflow Studio.
- Will clone backs affect Flow History?
Answer: Yes, clone overwrites version history similar to other records.
- Best practices for naming conventions/versioning?
Answer: Use annotations specific to versions; flow name remains the same.
- Will playbooks work in UI16 forms or are they limited to workspaces?
Answer: Playbook Experience is currently usable in Next Experience pages, including Configurable Workspaces, Service Portal and Mobile; UI16 forms not supported.
- Can Gen AI generate playbooks yet?
Answer: You can generate playbooks with the Playbook Generation Skill, which is included in Now Assist for Creator. https://sn.works/PlaybookGeneration
- What are playbooks used for in the service portal?
Answer: They automate processes for agents and end users that might go back and forth.
- Can flows triggered by events be limited to certain concurrent runs?
Answer: Concurrency is limited by the number of event handlers, by default there are 3 per node, thus the capacity is determined by the instance size and architecture.
- Do flows run on worker nodes by default in environments with UI and Worker nodes?
Answer: Flows start background processes by default and can be configured for node affinity.
- Can you create workflows with Now Assist?
Answer: Yes, you can create flows, subflows, and playbooks via Now Assist; legacy workflows are not supported.
- Does debugging indicate potential performance issues?
Answer: Yes, it can highlight slow steps.
- When debugging a flow with an input record, is the record's state modified?
Answer: Debugging is similar to testing, the record's state might be modified, depending on the flow; it is not rolled back when you're done debugging.
- Are there best practices for handling loops and arrays in subflows?
Answer: Zurich supports arrays as flow variables, but it’s currently limited to Array.Object. More array types are planned for a future release.
- Will there be an option to continue after a flow error while debugging?
Answer: Not yet for debugging, but it's under exploration. When building flows, encapsulate steps that might run into an error in a subflow and make use of the try logic, looping, and Flow Error handler.
Learn more in this blog series: https://sn.works/CoE/ErrorHandling
- How to debug an IF statement with stuck parallel tasks?
Answer: Use breakpoints on parallel branches and step through.
- Is there an easier way to translate a workflow into a flow?
Answer: Solutions are under exploration. Meanwhile, we recommend evaluating the existing legacy workflows by complexity and execution frequency. Migrating incrementally is the strategy of choice. Whenever Change Requests require you to work on a legacy workflow, consider this a chance to re-evaluate a potentially years old processes to be modernized to current requirements and technology. Flows and subflows can be called from a legacy workflow directly, and vice versa, allowing for incremental and reusable migration.
For more detailed guidance, check out this Migration Guide: https://sn.works/coe/migration/guide
- Is there a central resource for helpful articles?
Answer: Yes, start at https://sn.works/CoE
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.