Manual Workflow reset

Hi there, we are shifting from Airflow to Temporal (Java Spring Boot) in our organization. We’re currently using an older version of Temporal’s UI, which doesn’t have a reset option, and we don’t intend to upgrade because we don’t want others in the organization to have the ability to reset workflows.

I want to create an internal API that can reset a timed-out or failed workflow given its workflow ID, or reset an event given the workflow and event IDs. Can someone tell me if there are any internal APIs or methods available for this?

Thanks!

You can use sdk client api to reset, for example:

    ResetWorkflowExecutionResponse res = 
    service.blockingStub().resetWorkflowExecution(ResetWorkflowExecutionRequest.newBuilder()
                    .setNamespace("your namespace")
                    .setReason("your reason")
                    .setRequestId(UUID.randomUUID().toString())
                    .setResetReapplyType(ResetReapplyType.RESET_REAPPLY_TYPE_SIGNAL) // set to what you need
                    .setWorkflowTaskFinishEventId(3) // workflow task event id to reset to
                    .setWorkflowExecution(WorkflowExecution.newBuilder()
                            .setWorkflowId("your workflow id")
                            .setRunId("your runid") //optional
                            .build())
            .build());
    System.out.println("Reset exec run id: " + res.getRunId());

where “service” is your WorkflowServiceStubs

1 Like