← Home
🔥0 DAY
0 XP
How-To Hub

FLOW DESIGNER
HOW-TO.

Direct answers to the 10 most-searched Flow Designer questions — script steps, REST calls, subflows, decision tables, and more. Also covers the Process Automation Designer / Workflow Studio rebrand (Washington DC+) which uses the same flow engine under the hood.

How to add a script step in Flow Designer?

Use the 'Script' action under the Utilities category. Define inputs explicitly so prior step outputs are passed in — Flow Designer scripts do NOT have access to flow variables by default.

  1. Add Action → Utilities → 'Script'.
  2. On the Inputs tab, drag each upstream pill into a typed input (string, reference, etc.).
  3. In the script body, read via `inputs.your_var` and return an object matching the Outputs schema.
  4. Use `outputs.result = ...` — never `gs.print` for return values.
(function execute(inputs, outputs) {
  var gr = new GlideRecord('incident');
  if (gr.get(inputs.incident_sys_id)) {
    outputs.short_desc = gr.short_description.toString();
    outputs.priority = gr.priority.toString();
  }
})(inputs, outputs);

How to call a REST Message in Flow Designer?

Prefer the built-in 'REST' step over scripting a RESTMessageV2 call — it gives you retry, error branches, and a typed response without code.

  1. Add Action → Integrations → 'REST'.
  2. Pick the Connection & Credentials Alias (set up once in sys_connection).
  3. Map path params, query params, headers, and body in the input form.
  4. Drag `Response Body` into a downstream Script step and `JSON.parse(inputs.body)` it.
// Inside a downstream Script step
var data = JSON.parse(inputs.body || '{}');
outputs.id = data.id;
outputs.status = data.status;

How to call a Script Include from Flow Designer?

Script Includes are not directly selectable. Wrap the call in a Script step OR build a custom Action that exposes the Script Include as inputs/outputs for reuse.

  1. Make sure the Script Include is Client Callable = false and is in the same scope (or marked Accessible from: All scopes).
  2. Add a Script step, declare your inputs, and instantiate: `new global.MyHelper().doWork(inputs.x)`.
  3. For reuse across flows, promote the wrapper to a custom Action (Action Designer → Script step → publish).
(function execute(inputs, outputs) {
  var helper = new global.IncidentHelper();
  outputs.result = helper.classify(inputs.incident_sys_id);
})(inputs, outputs);

How to call a Subflow from a Flow?

Use the 'Call a Subflow' action. Subflow inputs/outputs must be defined on the subflow itself — they appear as a typed step in the parent flow.

  1. On the subflow, define Inputs and Outputs (Properties → Inputs / Outputs tabs).
  2. In the parent flow: Add Action → Flow Logic → 'Call a Subflow'.
  3. Pick the subflow; the Inputs panel auto-populates. Map pills.
  4. Use Outputs in downstream steps like any action result.

How to create and set flow variables?

Flow Variables are scoped to the whole flow. Create them in Properties → Flow Variables, then 'Set Flow Variables' anywhere in the flow.

  1. Open the flow → Properties (gear) → Flow Variables → +.
  2. Name, type (String, Reference, etc.), and default value.
  3. Use Flow Logic → 'Set Flow Variables' to assign values mid-flow.
  4. Read them in any step's input pill picker under 'Flow Variables'.

How to use a Decision Table in Flow Designer?

Decision Tables (sys_decision) replace nested if/else. The 'Make a Decision' action returns the matching answer based on inputs you pass in.

  1. Build the Decision Table in Decision Builder (rows = conditions, columns = inputs).
  2. In the flow: Add Action → Flow Logic → 'Make a Decision'.
  3. Pick the decision table, map inputs.
  4. Branch downstream steps on the returned `Answer` pill.

How to create a Flow Designer flow for a catalog item?

Set the trigger to 'Service Catalog' and pick the Catalog Item. The flow runs in place of legacy workflows and exposes variables via the requested_item record.

  1. New Flow → Trigger → 'Service Catalog' → choose Catalog Item.
  2. On the Catalog Item record, set Flow = <your flow> (this disables the legacy workflow).
  3. Pull variables via the `Requested Item` → Variables pill picker.
  4. Use 'Ask For Approval' for approvals — it auto-creates sysapproval_approver records.

How to trigger an event from Flow Designer?

There's no native 'Fire Event' action, but you can call `gs.eventQueue()` from a Script step — useful when bridging to legacy email notifications.

  1. Add a Script step.
  2. Call `gs.eventQueue('your.event.name', current, param1, param2)`.
  3. Pass the record reference via inputs (don't rely on `current` — Flow Designer scripts don't have one).
(function execute(inputs, outputs) {
  var gr = new GlideRecord('incident');
  if (gr.get(inputs.incident_sys_id)) {
    gs.eventQueue('incident.escalated', gr, gs.getUserID(), inputs.reason);
    outputs.fired = true;
  }
})(inputs, outputs);

How to check Flow Designer versions and revert?

Every published flow snapshot is stored in sys_hub_flow_snapshot. Open the flow → ⋮ menu → 'Show Versions' to view, compare, or restore a prior version.

  1. Open the flow → ⋮ (top right) → 'Show Versions'.
  2. Click any prior version to preview it.
  3. Click 'Revert to this version' — Flow Designer creates a new draft from that snapshot.
  4. Test in a sub-prod instance, then Publish.

How to create a custom Action in Flow Designer?

Actions are reusable building blocks. Build them in Action Designer with typed inputs/outputs so any flow can drag them in.

  1. Process Automation → Action Designer → New.
  2. Define Inputs (typed: string, reference, glide_date_time, etc.).
  3. Add Steps (Script, REST, GlideRecord lookup, etc.).
  4. Define Outputs and map them from step pills.
  5. Publish — the action now appears in every flow's action picker under your category.