What This Table Is
The sys_hub_flow table stores Flow Designer flow definitions — the complete configuration of each flow including its trigger, actions, data processing logic, and execution flow. Each record represents a single flow that can be activated, deactivated, and executed by the Flow Engine. The table contains both metadata about the flow (name, description, trigger type) and the complete internal representation as a JSON graph structure.
Flow Designer owns this table as the primary storage mechanism for all flows created through the visual flow designer interface. The table supports the complete flow lifecycle from design-time creation and testing through runtime execution and monitoring. Flows stored here can be triggered by record operations, scheduled intervals, REST API calls, or manual execution depending on their trigger_type configuration.
This table does not extend any parent table — it's a standalone entity designed specifically for Flow Designer. No tables extend sys_hub_flow either, though related execution and logging tables reference flows by their sys_id. The table has strong relationships with sys_hub_flow_instance for execution tracking and sys_hub_action_instance for individual step execution records.
Enterprise instances typically contain hundreds to low thousands of flow records, making this a relatively small table with excellent query performance. However, the graph field can contain substantial JSON payloads for complex flows, so avoid querying it unnecessarily in loops or when only metadata is needed.
When You'll Script Against This Table
Most scripting against sys_hub_flow happens in Script Includes for administrative functions, Scheduled Jobs for flow maintenance, and Business Rules that need to programmatically activate or deactivate flows based on business conditions. The Flow Designer scope (sn_fd) provides the primary APIs for interacting with flows, but direct table access is sometimes necessary for bulk operations or reporting.
The table requires flow_designer role for full access, though flow_operator can read most fields. ACLs prevent modification of active flows in production scopes without proper permissions. The graph field is particularly protected as it contains the complete flow definition.
Common scripting patterns:
- Flow inventory and audit reports — counting active flows by trigger type or application scope
- Bulk activation/deactivation of flows during maintenance windows or deployment processes
- Environment-specific flow management — disabling flows that shouldn't run in non-production
- Application scoped flow discovery for Update Set management and scoped app packaging
- Flow dependency analysis by parsing trigger conditions and referenced tables
- Performance monitoring by joining with execution instance tables to identify problematic flows
- Custom flow validation rules that check flow configurations against organizational standards
Table Gotchas
Never directly modify the `graph` field — it contains the complete flow definition as a complex JSON structure. Any changes should go through the Flow Designer interface or official APIs. Direct modifications will corrupt the flow and prevent execution.
The `active` field doesn't immediately stop running flow instances. Setting a flow to inactive prevents new executions but doesn't cancel in-progress instances. Use the Flow Designer interface for proper flow lifecycle management.
- The
trigger_typefield uses internal identifiers like 'record.inserted' rather than display values — always query by exact internal values, not what you see in the UI - Flow names (
namefield) are not unique across scopes — always includesys_scopein queries when flow names might be duplicated - The
sys_packagefield points to the update set when the flow was created, not the current update set — usesys_scopefor application scoping queries
Querying the `graph` field on large result sets can cause significant performance issues. The JSON payload can be 50KB+ per flow. Always exclude it with `addNullQuery()` or `addNotNullQuery()` conditions unless you specifically need the graph data.
- Flow execution permissions are evaluated at runtime based on the flow's scope and the triggering context — a flow might exist in the table but fail to execute due to ACL restrictions
- The
copied_fromfield creates a reference chain that can be several levels deep — flows copied from copied flows maintain the original reference, not the immediate parent
Enjoying this? Get one deep-dive per week.
Join 1,000+ ServiceNow pros — scripts, GlideRecord patterns, Flow Designer techniques, and career moves. Free.
Related Tables
The sys_hub_flow_instance table is the primary companion to sys_hub_flow, storing execution records for every time a flow runs. Each flow instance references the flow definition via the flow field, creating the foundation for flow execution monitoring and troubleshooting. The sys_hub_action_instance table stores individual step executions within each flow instance, providing detailed execution logs and error tracking.
Application scoping relationships connect flows to the sys_scope and sys_package tables for proper application lifecycle management. For record-triggered flows, the trigger configuration implicitly connects to various business tables like incident, change_request, sys_user, or any other table specified in the trigger conditions.
Flow scheduling integrates with the sysauto_script table for scheduled flows, while REST-triggered flows connect to the sys_rest_message infrastructure. Developers frequently join flow execution data with sys_user and sys_user_group to understand flow execution patterns and user impacts across the business process automation landscape.