Reset workflow in sdk

hi tctl -ns somenamespace wf -wid someworkflow rs
with event id or reset_type works well,
I see that in java sdk there is ResetWorkflowExecutionRequest

however,
when i do something like

ResetWorkflowExecutionRequest resetRequest = ResetWorkflowExecutionRequest.newBuilder()
.setNamespace(“somenamespace”).setWorkflowExecution(exectuionInfo.getExecution())
.setReason(“just like that!”).setWorkflowTaskFinishEventId(2).build();

workflowServiceStubs.blockingStub().resetWorkflowExecution(resetRequest);

i dont see any thing happening, am i missinog something?

Also is there a way to reset to work flow to first or previous step just like what can be done from tctl using FirstWorkflowTask,LastWorkflowTask through java SDK?

The WorkflowTaskFinishEventId of 2 doesn’t look right. According to the docs:

decision_finish_event_id is the Id of events of the type: DecisionTaskComplete/DecisionTaskFailed/DecisionTaskTimeout.

Also is there a way to reset to work flow to first or previous step just like what can be done from tctl using FirstWorkflowTask,LastWorkflowTask through java SDK?

Currently, the logic of finding the decision_finish_event_id is part of the CLI.

1 Like

passing correct id helped. thanks for pointing out the right docs.