What is the most effective way to fix a bug in long-running workflows?

Hey guys,

Consider that I have a long-running workflow with multiple instances currently in execution. While I can use the patching API to modify new workflows, I am unable to make changes to the workflows currently in progress. Is there a way to address bugs in the workflows that are already running?

Patching API does work with already started workflows.

The new worker versioning feature applies to the entire workflow.

If I have a workflow definition that involves operations A and B, and I need to transition to operations A, C, and B, taking into account that numerous workflows are currently in operation B, how could the Patching API assist me in this scenario?

From what I understood, these new operations A, C, and B would only be applied to new workflows, while the old ones would still be performing operations A and B.

Patching doesn’t change the past of a specific workflow. So a workflow that is blocked on A after the patch is deployed going to execute A, C, B. So it does affect workflows that are currently executing.

The workflow that is blocked on B is not going to change its past to execute C.

You have to use reset to revert workflow state to before the change if you want to change the past. In this case. you can reset workflow to the state just after A completion and then it is going to execute the new code path.

1 Like

Thank you for your answer Maxim :smiley: