Workflow Activity Parallelization

Asynchronous execution of activities provides numerous benefits including the ability to process data in batches and execute batches in parallel.

Activity parallelization works as follows:
  1. A COMMAND in and out parameter is used to indicate run modes for the activity. This is an internal parameter and no configuration is needed. A null command indicates that the activity is executing for the first time.
  2. When the activity suspends, it sets the command to indicate the next step.
  3. The workflow passes this command back to the activity when the activity restarts.
  4. The activity initializes the run counters (these counters are stored in the ProcessDetail Table):
    • Total number of records to be processed.
    • Initial counter for record processed as zero.
    • Hidden (with respect to the UI).
  5. The activity initiates parallel batch processing and suspends.
  6. The activity creates batches of the records to be processed and sends messages for each batch.
  7. Each batch keeps track of the record/bundle count for the batch.
  8. At the end of each batch, the processing batch increments the counters in an atomic operation.
  9. Checks for restart. If total records processed matches the total records to be processed, a restart event is sent.
  10. Workflow manager restarts the workflow and initiates the suspended activity.