Pausing/resuming a workflow

Hello,

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?

Cheers.

1 Like

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.

3 Likes

Is there a issue for this feature?
(I didn’t see one in git)

I don’t think there is an issue for this. Feel free to file one.

Is temporal workflow allow requesting human approval by email ? in our case, we many require to wait for an authorize person to respond before continuing workflow.

Temporal doesn’t have direct email integration. Temporal workflow can wait on an external signal which is emitted as an API call from one of its SDKs (or though direct gRPC call).

The signal can be emitted based on any external logic. It can be based on email receival, but it can be any other code like reaction to a web form submission or button click in a mobile app.

Pausing and Resuming support for temporal will be great, really looking forward for it!

2 Likes

wrap all the “ExecuteActivity” calls with a check for the latest signal value


hi, I have same problem

  1. how do u continue get the latest signal? with workflow.Go() ? is it a block way?
  2. which interceptor func did u wrap? just ActivityInboundInterceptor.ExecuteActivity?
  1. workflow.Go is a good way to listen for a signal asynchronously.
  2. WorkflowOutboundInterceptor.

tks for answering

but I found “blocked on chan…” err at the temporal ui “stack trace” cause i use “selector.Select(ctx)” in a coroutine started by “workflow.Go”, is it matter

here has more details: What's the right way to pause/unpause a workflow with interceptor and signal? - #5 by jackban

This is not an error. This view is just the dump of threads of the workflow.

@maxim Is there relevant documentation which explains the pause/start feature ?

There is a feature request here that has requested details, feel free to add more requirements / ideas that you have.

Documentation I’m sure will be updated once this feature has been added and released.

1 Like

+1 for this functionality - Do you have any visibility in terms of the development timelines at all or is it not planned yet?

Will check and post here if there is any info that can be shared at this time.

1 Like

Hi, is there a way to pause/resume workflow/activity execution via Temporal web interface or is it feature planned to be implemented in future releases?

This feature is not available at this time, opened feature request here and linked to mentioned server feature request for tracking.

2 Likes

@tihomir thanks!

Hi, @tihomir any updates or timelines available on this feature? I think this would be a great feature to have.