Pausing Workflows From A Workflow


# Pausing other workflows

Use this.select function to target other workflows and pause them from the handle or onEvent generator functions.

For example:


module.exports.handle = function* (...) {
  ...
  this.select.workflow().withId("<id>").pause();
  ...
};

# Pausing itself

As a shortcut, a workflow can directly pause itself with:

module.exports.handle = function* (...) {
  ...
  yield this.pause();
  ...
};

WARNING

Do not forget the yield keyword! Without it, the pause instruction is processed in the background and the workflow continues immediately to the next instructions before being paused.