Reset workflow to a particuylar event ID

Hi,

I was trying to reset workflow to particular event id using the tctl command as pointed here but it was throwing me:

rpc error: code = InvalidArgument desc = nDCStateRebuilder unable to rebuild mutable state to event ID: 260, version: 0, this event must be at the boundary

The event ID I used is that of WorkflowTaskCompleted event. Could I get an example of how to reset a workflow to a prticular even ID ?

The reset functionality is somewhat limited at the moment. It supports resetting to “WorkflowTaskStarted” event ids only.

Not sure which SDK you use, but here is a util method for Java SDK that you can use as an example:

1 Like

Hey tihomir,

Thanks for replying. We are using tctl v1.9.1, we are not resetting it via codebase, we are running the tctl command directly, Tried for WorkflowTaskStarted event as well, still getting the same issue.

Can you show your workflow history and the tctl command you are running?
Just tried locally and was able to reset a failed workflow with:

tctl workflow reset -w myWorkflow -r ac4d8846-507b-4460-b178-24538b772d76 --event_id 9 --reason "some_reason"

where event 9 is a “WorkflowTaskStarted” event.
Another question, did you fix the workflow definition and restart the worker before trying to reset?Otherwise your workflow will still run in the same issue as before the reset attempt.