Pausing/resuming a workflow


Is it currently possible to pause/resume a workflow? I was thinking about using signals to pause or resume a workflow execution. That would probably mean to wrap all the “ExecuteActivity” calls with a check for the latest signal value, and potentially waiting for it to change.

Is this the way to go or is it possible to pause a workflow execution at the scheduler level directly?


If you are looking to pause all workflow executions on a TaskQueue, then simplest mechanism is to shutdown workers polling on that TaskQueue. Any workflows which are in flight will not make any forward progress.
Instead if you want to pause a single workflow execution then you might have to use signal to put it in paused state as your own application logic.

We have plans to support pausing/resuming workflow at the service level.

Your approach of using signal can work for some use cases. I would recommend using WorkflowInterceptor to implement such functionality generically.