Flow Designer - How to find FLOWs based on the triggering table AND conditions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2025 12:56 PM
I often need to analyse what triggers are configured and cannot find where to do this with FLOWs. For example, if I want to find all FLOWS are triggered by change_request.state I cannot see a way to do this. This is a backwards step for us that often are asked to decipher the novel, poor, and erroneous configuration on a platform. Now it seems we must manually look through hundreds of FLOWS to find the needle, instead of the simple search I run on Business Rules.
- I have found the table sys_hub_trigger_instance_v2 which has the trigger inputs that are encoded. It is not Base64 encoded, tried to decode it.
- I found the function in the Configuration Menu for a table that adds a column to a List Query javascript:sn_flow.AssociatedFlows.getFlows("change_request")
- There are some APIs available but the method sn_flow.AssociatedFlows.getFlowsWithTriggerDetails(tableName) just returns the FLOW, and thir tigger type and they do not seem to be accessible or documented
- There are other posts asking the same thing but none get to the detail of searching by the TABLE, Trigger, and the CONDITION.
var tableName = 'change_request';
var rawJson = sn_flow.AssociatedFlows.getFlowsWithTriggerDetails(tableName);
// Print the raw JSON string
gs.info('Raw JSON for table: ' + tableName);
gs.info(rawJson);
Business Rules
In Business Rules I can use the LIST and Filter by table, FilterConditions, or Condition, and you have your list. I do this regularly when I start diagnosing an issue or start on a new customer instance. https://[instance_name]].service-now.com/now/nav/ui/classic/params/target/sys_script_list.do%3Fsysparm_query%3DcollectionSTARTSWITHincident%255Efilter_conditionLIKEstate%26sysparm_first_row%3D1%26sysparm_view%3D
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
So, I had this same requirement because we needed to identify hard-coded filter conditions on Flow triggers we knew were going to change.
First, you can't decode the "sys_hub_trigger_instance_v2" record without unzipping if after, and there is not a native ServiceNow "unzip" method available to us. (even though it seems to exist in GlideStringUtil, but inaccessible from our scopes). You can export and run all that in Python if needed, but thankfully, I found an SN solution.
To filter on Flows and their Trigger Table/Conditions:
- Create a DB View joining sys_hub_flow and sys_flow_record_trigger on the remote_trigger_id field
- Leave Left join false if you only want Flows which use record triggers, else you can Left join to see all Flows even if they do not have a record trigger
This is the best I got right now. I'm still looking into how I may be able to join filter conditions for Actions as well (Record query, etc).
