How to pause/unpause a temporal workflow?

Hi folks! A questions from our users.

I was wondering if there is an option to pause/unpause a temporal workflow? We would like to pause our workflow during service deployments. I’m aware that Temporal does not officially support pausing and unpausing, just wondering if anyone has any creative ideas :slightly_smiling_face:

I only know two ways to pause a running workflow.

  1. Stop all the relate worker.
  2. Call workflow.sleep() inside the workflow.

Doesn’t seem to solve the problem.

One neat solution is to use workflow.Await + Signal as demonstrated here (it’s in TS but applies to other SDKs too).

There is ongoing work in place to investigate the native support mentioned at Workflow Pause / Unpause · Issue #3006 · temporalio/temporal · GitHub

1 Like

Why do you want to pause workflows during deployments? Usually we desire the opposite, i.e. deployments should not cause interruptions. Could you elaborate on what your use case is?
For cases where we want the workflow to pause and wait for an external event, say from another system or a human action, then signals is the recommended way.