What This Table Is

The sys_hub_subflow table stores reusable Flow Designer subflows—modular workflow components that encapsulate common automation logic. These subflows act as functions in Flow Designer, accepting inputs and returning outputs while hiding implementation complexity from consuming flows.

Owned by the Flow Designer module, this table supports the entire Flow Designer automation ecosystem. Subflows enable developers to create reusable components that can be called from any flow or other subflow, promoting consistency and reducing duplication across automation workflows.

This table extends sys_hub_flow and inherits core flow properties while adding subflow-specific functionality like input/output parameter definitions. No tables extend sys_hub_subflow directly—it's the leaf table in this inheritance hierarchy.

Record volume is typically moderate in enterprise instances—hundreds to low thousands of subflows. Performance is generally good since these records are primarily read during flow execution setup, not during high-volume transaction processing. However, querying by category can be expensive without proper indexing on large datasets.

When You'll Script Against This Table

You'll primarily script against sys_hub_subflow in Script Includes when building Flow Designer management tools, Business Rules for subflow lifecycle management, and Scheduled Jobs for subflow maintenance. REST API integrations often query this table to discover available subflows or validate subflow references.

Access requires flow_designer role for full CRUD operations. The flow_operator role provides read access for execution contexts. Application scope affects visibility—global subflows are visible to all scopes, while scoped subflows are only accessible within their scope unless explicitly shared.

  • Query subflows by category for dynamic flow building
  • Validate subflow existence before creating flow references
  • Count subflows by scope for governance reporting
  • Bulk activate/deactivate subflows during deployment
  • Extract input/output definitions for documentation generation
  • Monitor subflow usage patterns across flows
  • Synchronize subflow versions between instances

Table Gotchas

⚠️

Inactive subflows (active=false) will cause flows that reference them to fail at runtime, but Flow Designer won't validate this at design time. Always verify subflow status before deployment.

  • The category field is a string, not a choice field, so typos create new categories rather than validation errors
⚠️

The sys_scope field determines subflow visibility across applications. Cross-scope subflow calls require explicit sharing or will fail silently in some execution contexts.

  • Subflow versioning is handled through copied_from relationships, not traditional version fields—query the reference chain for version history
  • The inputs and outputs fields contain JSON that must be parsed—direct string queries against these fields are unreliable
⚠️

Deleting subflows doesn't automatically remove references from flows that use them. This creates broken references that cause runtime failures.

  • Performance suffers when querying by description or other long text fields without proper indexing—use name or category for better query performance
Free Newsletter

Enjoying this? Get one deep-dive per week.

Join 1,000+ ServiceNow pros — scripts, GlideRecord patterns, Flow Designer techniques, and career moves. Free.

No spam · Unsubscribe anytime

The sys_hub_subflow table extends sys_hub_flow, inheriting core flow functionality like activation status, scope, and basic metadata. When querying subflows, you often need to join with the parent table to access shared flow properties.

The most common related tables are sys_hub_flow_step for subflow references within flows, sys_scope for application context, and sys_hub_action_input/sys_hub_action_output for input and output parameter definitions. You'll frequently join these tables when building subflow management tools or analyzing subflow usage patterns across your Flow Designer ecosystem.