Restart UI action on sys_flow_context table is not working and getting "The sysevent record for the supplied context is no longer present on the system" exceptionWhat does "Restart UI Action" do? The Restart UI Action, introduced from Utah, allows you to restart a flow, subflow, or action that was previously executed in the background. You have the option to provide new inputs or reuse the inputs that were used previously. This action utilizes the sn_fd.FlowAPI.getRunner().restartFlowFromContext(flowContextID, inputs) API. An important note is that restarting the flow will not impact the existing flow context in any way.Here is the doc for restartFlowFromContext API. https://docs.servicenow.com/bundle/utah-api-reference/page/app-store/dev_portal/API_reference/ScriptableFlowAPI/concept/ScriptableFlowAPI.html#title_FlowAPI-restartFlowFromContext_S_O Why are we encountering this exception? One of the steps in our process involves checking for a specific sysevent that triggers the flow. The condition for this event is when the name is "flow.fire" and parm1 is null. However, since sysevents are retained for only 7 days, this API is functional within that time frame from the initiation of the flow. Potential Workarounds with Limitations 1. Use a standard API call inBackground() - an example is provided in the code snippet below:var inputs = {};inputs['xx'] = ;sn_fd.FlowAPI.getRunner().flow('scope.flow_name').inBackground().withInputs(inputs).run();var outputs = result.getOutputs();Here is the doc for code snippet - we should grab the code snippet for background executionhttps://docs.servicenow.com/bundle/utah-build-workflows/page/administer/flow-designer/task/flow-design-code-snippet.html2. Insert a new sysevent In certain scenarios, this approach might not ensure successful restart when dealing with numerous input records created at the same time. var contextId = ""; // Populate the context ID if (contextId) { var json = new GlideRecord("sys_json_chunk(before tokyo) or sys_flow_context_inputs_chunk(from tokyo)"); json.addQuery("document_id", contextId); json.orderByDesc("sys_created_on"); json.query(); if (json.next()) { var inputKey = json.getValue("field").split(".")[1]; var contextGR = new GlideRecord("sys_flow_context"); contextGR.get(contextId); gs.eventQueue("flow.fire", contextGR, "", inputKey, "flow_engine"); gs.info("Event created"); } else { gs.info("No input parameter found"); }} else { gs.info("Context ID is empty");}