Loading...
Loading...
After upgrading to XP10, YP6, ZP1, or beyond on a domain-separated instance, some flows may fail to trigger. This may happen for the following reason: Flow Not Found Error When a flow runs for the first time after an upgrade, the system recompiles it under the flow’s domain. If the flow is triggered by a user from a different domain, the compilation occurs in the user’s domain instead, causing a “Flow not found” error. This might lead to the following symptom and affect other flows. Missing Runner Mapping or Trigger Configuration If a table (e.g., incident) has multiple flows and both meet their triggering conditions, the system executes them sequentially. If the first flow fails due to the “Flow not found” error, the second flow’s plan record may not be retrieved because of domain issues. This can mislead the system to assume no flows are associated, resulting in deletion of the runner mapping and possibly the trigger configuration for the second flow.
Environment: Instance recently upgraded to XP10, YP6, ZP1, or beyond Domain separation enabled Logged in as Administrator Steps: Create a flow in Domain A that triggers on a table (e.g., Incident) when certain conditions are met. Create User A in Domain A. Create User B in Domain B and set domain visibility to include Domain A. Impersonate User B and create an Incident record, assigning the caller to User A, ensuring the triggering conditions match. → The Incident record should be created in Domain A. Observe: The flow does not trigger, and the logs show a “Flow not found” exception.
Take a backup of the instance, follow the below steps to identify the impacted flows and remediate. Step 1) Identify and Recompile the flows throwing "Flow not found" exception. To identify such flows we need to analyse the logs, reach out to support for finding them. Important note: Until we recompile all the flows throwing "Flow not found" exception, the issue on "Missing runner mapping configuration" may persist, so first fix the "Flow not found" exception for all the flows and then follow the Step 2. Step 2) Missing runner mapping(sys_trigger_runner_mapping)/record trigger(sys_flow_record_trigger) configuration. Find the flows using the below script, if you find any such flows then Republish and Recompile. How to find the impacted flows for the missing configuration? Navigate to All > System Definition > Scripts - Background and execute the following script. It will return the number of impacted flows and each of the affected flow's sysId: var flow = new GlideRecord("sys_hub_flow"); flow.addActiveQuery(); flow.addQuery("type","flow" ); flow.queryNoDomain(); // gets flows from all domains var list = []; while(flow.next()) { var flowSysId = flow.getUniqueValue(); var remoteTriggerId = flow.getValue("remote_trigger_id"); var triggerGr = new GlideRecord("sys_flow_trigger"); triggerGr.addQuery("sys_id", remoteTriggerId); triggerGr.addQuery("active", "true"); triggerGr.queryNoDomain(); if (triggerGr.next()) { if("sys_flow_record_trigger" == triggerGr.getValue("sys_class_name")) { var runnerMapping = new GlideRecord("sys_trigger_runner_mapping"); runnerMapping.addQuery("identifier", flowSysId); runnerMapping.addQuery("active", "true"); runnerMapping.query(); if(!runnerMapping.hasNext()){ list.push(flowSysId); } } } else { list.push(flowSysId); } } gs.info("Number of impacted flows due to missing configuration : " + list.length); gs.info(list); How to republish? 1) Switch to flow's domain. 2) Open the flow in Workflow Studio and Deactivate, then Activate the flow from there. Or promote the flow from lower environment using UpdateSet as a standard process. Please ensure you are in the domain of the flow in question. How to recompile? 1. Switch to flow's domain. 2. Open the flow in Workflow Studio. 3. Click on ... > Create code snippet 4. Copy the part between .flow(<SCOPE.INTERNAL_NAME>) part of the code snippet. 5. Go to All > System Definition > Scripts - Background and change the "Run Script in scope" to the same value as the flow's scope 6. Please ensure you are in the domain of the flow in question and paste in the following script and execute. var compiledSuccessfully = sn_fd.FlowAPI.getRunner().flow('my_flow_name').compile(true); and replace .flow() part with the part from step 4.
PRB1958181
Click on a version to see all relevant bugs
ServiceNow Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.