A flow called by the scriptable Flow API that times out may leave the context with state QUEUEDDescriptionA flow called by the scriptable flow api that times out may leave the context with state QUEUED when state CANCELLED is expected.Steps to Reproduce Create a flow named for example, "def0172879_subflow" that will take some time. (For example: look up all sys_user records and then for each record X look up all sys_user records where name is not X.name)Navigate to System Definition > Scripts - Background and run: sn_fd.FlowAPI.getRunner().subflow('global.def0172879_subflow').inForeground().timeout(1000).run(); Go to the Flow executions in Flow Designer for subflow def0172879_subflow and observe that the state is QUEUED. The state should be CANCELLED.WorkaroundThe default timeout is 30000 ms (30 seconds). A workaround would be to alter the script to add a timeout of 10 minutes, for example with: var result = sn_fd.FlowAPI.getRunner().subflow('<flow_name>').inForeground().withInputs(inputs).timeout(600000).run(); Additional information ScriptableFlowRunner .timeout(Number timeout)FlowAPI - Scoped, GlobalRelated Problem: PRB1449946