Using Flow API from Workflow is generating a Flow for the wrong Request ItemDescriptionYou have a Request Item Workflow which is calling the Flow Designer FlowAPI and triggering a Flow / Subflow to execute. When ordering a Request which contains multiple Request Items using this Workflow you are finding that the Flow Contexts are sometimes referencing the wrong Request Items. For example you might find that two of the Flows are referencing the same Request Item even though you are expecting them all to be different.CauseThis is most likely happening because you are not scoping the FlowAPI Call. Example: Inside a Workflow Run Script Activity you have the following code: var inputs = {};inputs['req_item_sys_id'] = current.sys_id; // String// Start Asynchronously: Uncomment to run in background. Code snippet will not have access to outputs.// sn_fd.FlowAPI.getRunner().subflow('global.flow_name_here').inBackground().withInputs(inputs).run();// Execute Synchronously: Run in foreground. Code snippet has access to outputs.var result = sn_fd.FlowAPI.getRunner().subflow('global.flow_name_here').inForeground().withInputs(inputs).run();var outputs = result.getOutputs(); This is retrieving the current.sys_id as one of the Subflow InputsHowever, since the function has been omitted it means that the inputs['req_item_sys_id'] is not being scoped and therefore can potentially be overwritten by other scripts. ResolutionPlease ensure that when calling Subflows / Flows via Script you are using the Code Snippet which we provide in the Out Of Box Flow Designer Product. You can follow our "Create code snippets for flows, sub-flows, and actions" Documentation Here for further guidance on how to find this. For further reference the Code Snippet should be enclosed in a function and will look similar to the following (Depending on your Instance Platform Version): (function() {try {var inputs = {};inputs['req_item_sys_id'] = current.sys_id; // String// Start Asynchronously: Uncomment to run in background. Code snippet will not have access to outputs.// sn_fd.FlowAPI.getRunner().subflow('global.flow_name_here').inBackground().withInputs(inputs).run();// Execute Synchronously: Run in foreground. Code snippet has access to outputs.var result = sn_fd.FlowAPI.getRunner().subflow('global.flow_name_here').inForeground().withInputs(inputs).run();var outputs = result.getOutputs();// Current subflow has no outputs defined.} catch (ex) {var message = ex.getMessage();gs.error(message);}})();