IT CanvassTalk to an advisor
Development · LessonBy , ServiceNow Trainer, 9 yrs · Published · ServiceNow · all levels

Flow actions and subflows

Build reusable automation: action steps, inputs and outputs, subflows, and when a script step is justified.

Quick answer

Build reusable automation: action steps, inputs and outputs, subflows, and when a script step is justified.

Key takeaways
  • Actions and subflows are how flows stay maintainable
  • Inputs and outputs make automation testable
  • Script steps are an exception, not a default
  • Configure error handling explicitly on every external call

Actions are reusable units

An action takes inputs, runs steps such as look up records, create record or REST, and returns outputs. Because it is reusable, a well named action with clear inputs is worth more than the same logic copied into three flows.

Subflows

A subflow is a flow that other flows call, with its own inputs and outputs. Use subflows for shared process, for example an approval pattern used by several catalog items, so a change happens in one place.

Script steps

Flow Designer supports a script step, and it is easy to overuse.

  • Prefer no code steps so the flow stays readable to process owners
  • Use a script step for data shaping the standard steps cannot do
  • Keep the script short and pure, no side effects that the flow does not report
  • If a script step grows past twenty lines, move it into an action or a script include

Error handling

Set the error handling on each action so a failure either stops the flow or continues down an error path. Silent failures in automation are worse than loud ones.

Practice challenge

+0 XPStreak ×0
Question 1 of 2
What makes an action reusable?

Frequently asked questions

Flow, subflow or action?
A flow is triggered by a record or schedule. A subflow is called by another flow. An action is a step level unit of work with inputs and outputs.
Do flows replace workflows?
For new automation yes. Legacy workflows keep running, and migration is a planned exercise rather than a rewrite on day one.
Already working on ServiceNow and stuck on a live ticket?Get an expert ServiceNow developer on screen-share to finish your daily tasks with you. Deliver on time, protect your reputation and your job. Monthly support only, no task-wise plans.Task assigned · no idea where to startStill stuck · your job on the lineExpert joins your screenDelivered on timeExplore On Job Support