Flows are queued due to flow compilation error: executeWithTimeout() timeout expired (TransactionCancelledException)DescriptionFlows will re-compile when they execute for the first time after the flow is modified or after a system upgrade. In this case, this may cause the flow execution to timeout and the flow context to be stuck in a queued state.Steps to Reproduce 1. Create a subflow called Subflow 1The content of the subflow isn't that important, but the larger it is the easier it will be to reproduce the problem. I used 2. Activate the Subflow3. Call the subflow from Scripts - Background using the following mechanism:sn_fd.FlowAPI.getRunner().subflow('global.subflow_1').inForeground().timeout(3000).run();Expected: Flow executes normally or at least as it normally would for if the flow didn't need to be recompiledActual: Flow can timeout due to the time it takes the flow to compile. Stack trace is belowFlow Designer: Compiling flow Subflow 1Flow Designer: Begin creating Action "Look Up Records" (sys id 66911ea273322010d70877186bf6a7b8) with order number 1 in flow and UUID 6af4b173-5630-45b6-849b-8852eb79d9dfFlow Designer: Begin creating Step "Lookup Records step" (sys id c7400a1587003300663ca1bb36cb0b6a) with step number 1 of Action "Look Up Records" (sys id 66911ea273322010d70877186bf6a7b8) with order number 1 in flow and UUID 6af4b173-5630-45b6-849b-8852eb79d9dfFlow Designer: Finished creating Step "Lookup Records step" (sys id c7400a1587003300663ca1bb36cb0b6a) with an input count of 5 and an output count of 3 as step number 1 of Action "Look Up Records" with order number 1 in flow and UUID 6af4b173-5630-45b6-849b-8852eb79d9dfFlow Designer: Finished creating Action "Look Up Records" (sys id 66911ea273322010d70877186bf6a7b8) with an input count of 5 an output count of 3 with order number 1 in flow and UUID 6af4b173-5630-45b6-849b-8852eb79d9dfSlow ACL 155fb134c32b32002841b63b12d3ae48 for the path record/sys_hub_action_type_base/read, time was: 91Flow Designer: Begin creating Action "Log" (sys id 76911ea273322010d70877186bf6a7bd) with order number 3 in flow and UUID ede92b65-8e85-4cbe-ac32-ef94fa8fea86Flow Designer: Begin creating Step "Log step " (sys id 67c1bcc6531003003bf1d9109ec587f1) with step number 1 of Action "Log" (sys id 76911ea273322010d70877186bf6a7bd) with order number 3 in flow and UUID ede92b65-8e85-4cbe-ac32-ef94fa8fea86Flow Designer: Finished creating Step "Log step " (sys id 67c1bcc6531003003bf1d9109ec587f1) with an input count of 2 and an output count of 0 as step number 1 of Action "Log" with order number 3 in flow and UUID ede92b65-8e85-4cbe-ac32-ef94fa8fea86Flow Designer: Finished creating Action "Log" (sys id 76911ea273322010d70877186bf6a7bd) with an input count of 2 an output count of 0 with order number 3 in flow and UUID ede92b65-8e85-4cbe-ac32-ef94fa8fea86Flow Designer: actionSysId/aliasOverride null or emptyFlow Designer: actionSysId/aliasOverride null or emptyTransaction: executeWithTimeout() timeout expired*** ERROR *** com.glide.sys.TransactionCancelledException: Transaction cancelledWorkaroundExtend the timeout to cover the time it takes for the flow to compile. For example: sn_fd.FlowAPI.getRunner().subflow('global.subflow_1').inForeground().timeout(t).run(); With the timeout(t) argument the default timeout is 30000. You could call it with timeout(120000) (2 minutes) to ensure there's plenty of time for the re-compile.Related Problem: PRB1481529