Distributed execution

PolicyCenter uses a work queue to handle workflow execution. This, in simple terms, means that you can have a whole cluster of machines that:

  • Wake up internal Workflow instances,
  • Advance them as far as they can go,
  • Then, let them go back to sleep if they need to wait on a timeout or activity.

Asynchronous workflow execution always works the same way:

  1. PolicyCenter creates a WorkflowWorkItem instance to advance the workflow.
  2. The worker instance picks up the work item.
  3. The work item retrieves the workflow and advances it as far as possible (to a ManualStep or Outcome).

You can create a work item in any of the following different ways:

  • By a call to the AbstractWorkflow.startAsynchronously method
  • By invoking a trigger with asynchronous = true
  • By completing a workflow-linked activity
  • By the Workflow batch process, which queries for active workflows waiting on an expired timeout
  • By a call to AbstractWorkflow.resume, typically initiated by an administrator using the workflow management tool

After the workflow advances as far as it can, PolicyCenter deletes the work item and execution stops until there is another work item.