The CreatorCon Call for Content is officially open! Get started here.

Lisa Holenstein
ServiceNow Employee
ServiceNow Employee

LisaHolenstein_0-1739200503384.png

 

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

General Guidelines (Docs)

 

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)

https://www.servicenow.com/community/developer-advocate-blog/creator-toolbox-playbook-triggers-amp-p...

 

SNU content (AKA Now Learning)

https://sn.works/CoE/Training

 

back to top^

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.

 

back to top^

 

Q&A Nuggets

  1. 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.

  1. Is debugging only available in Zurich?

Answer: No, it was introduced in Yokohama.

  1. 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.

  1. 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.

  1. 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.

  1. How do we troubleshoot slow flows?

Answer: 

  1. Step-Level Runtime Analysis
    1. Check the runtime of each step to pinpoint slow actions and optimize accordingly.
  2. Flow Size & Complexity Limits
    1. Limit flow actions to 25 for best performance; system max is 50.
    2. Error handling sections: max 10 items.
    3. Loops: avoid iterating over more than 1,000 items.
  3. Logging Overhead
    1. Enable full logging only for critical flows.
    2. Minimize or disable logging for routine flows to reduce system load.
  4. Asynchronous Execution
    1. Let flows run asynchronously (default) for optimal scheduling and to avoid blocking other processes.
  5. Queue Management & Prioritization
    1. Assign higher priority to business-critical flows.
    2. Set lower priority for large-volume or slow-running flows.
  6. Architectural Considerations
    1. Number of concurrent flows depends on event handlers (default: 3 per node).
    2. Node affinity ensures flows run on the node where triggered, reducing queue latency.
  7. Use Playbooks for Complex Flows
    1. For highly complex or lengthy flows, consider orchestrating with playbooks for better manageability and UI integration.

 back to top^

  1. Can a flow be replaced by a playbook?

Answer: No direct conversion exists, but you can reuse subflows and actions in playbooks.

  1. 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.

  1. When will we be able to search for scripted content?

Answer: No specific timeline; under exploration.

  1. 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:

https://sn.works/CoE/Training

  1. How to move a flow to another instance?

Answer: Flows are represented as a single file in update sets.

  1. When will the ability to search flow by name be added?

Answer: This is already available via column header filters in Workflow Studio.

  1. Will clone backs affect Flow History?

Answer: Yes, clone overwrites version history similar to other records.

  1. Best practices for naming conventions/versioning?

Answer: Use annotations specific to versions; flow name remains the same.

back to top^

  1. 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.

  1. 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

  1. What are playbooks used for in the service portal?

Answer: They automate processes for agents and end users that might go back and forth.

  1. 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.

  1. 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.

  1. Can you create workflows with Now Assist?

Answer: Yes, you can create flows, subflows, and playbooks via Now Assist; legacy workflows are not supported.

  1. Does debugging indicate potential performance issues?

Answer: Yes, it can highlight slow steps.

  1. 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.

back to top^

  1. 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.

  1. 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

  1. How to debug an IF statement with stuck parallel tasks?

Answer: Use breakpoints on parallel branches and step through.

  1. 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

 

  1. Is there a central resource for helpful articles?

Answer: Yes, start at https://sn.works/CoE

back to top^