1. Subflow vs Action — when to encapsulate
“You have the same 4-step logic repeated across 6 flows. Should you build a Subflow, a reusable Action, or a Script Include?”
How to answer
- Subflows are Flow-Designer-native — they live in the flow namespace, accept inputs/outputs, and show up as a single step in the parent flow.
- Actions are reusable steps you drag into any flow. Built from steps or custom scripts. Best when the logic is atomic (one table lookup, one REST call).
- Script Includes are server-side only and invisible in Flow Designer — avoid them unless you need shared JS across flows AND business rules.
- Rule of thumb: >3 steps → Subflow; 1-2 steps → Action; cross-platform reuse → Script Include.
Reference script
// Parent Flow: "Close Incident & Notify"
// Step 1: Run Subflow "Resolve and Update CMDB"
// inputs: incident_sys_id, ci_sys_id
// outputs: updated_ci, closure_notes
// Step 2: Send notification using output.closure_notesPitfall
Building a Subflow for a single 'Create Record' step adds indirection without value. Interviewers flag over-engineering — start with an inline action and promote to a Subflow only when reuse justifies it.