For the complete documentation index, see llms.txt. This page is also available as Markdown.

Process execution

The workflow engine executes the process in a transactional way, advancing until it encounters a wait state, such as a timer event, in each active path of the execution. Subsequent tasks, sub-processes, and call activities are executed in a single transaction, and if one fails, the entire transaction is rolled back.

Asynchronous activities

You can have tasks, sub-processes, and call activities run asynchronously to split execution into smaller units of work. The benefit of an asynchronous activity is that it is part of a separate transaction, and if it fails, the actions that were performed before it are not rolled back.

The Workflow Designer provides two independent properties to control where transaction boundaries are placed around an activity:

Asynchronous

Places a transaction boundary before the activity starts. The activity runs in a separate background thread, isolated from the steps that preceded it.

Leave asynchronously

Places a transaction boundary after the activity completes, before the process advances to the next element. This ensures the completed state is committed immediately, preventing the activity from being re-run if the engine restarts.

The following table summarizes how these properties affect transaction boundaries:

Setting
Transaction break point
Effect

Neither property set.

None.

Fastest execution. The activity runs in the same transaction as its surrounding steps. If it fails, the entire transaction is rolled back.

Asynchronous set.

Before the activity starts.

The activity runs in a background thread. A failure does not roll back the steps that ran before it.

Leave asynchronously set.

After the activity completes.

The completed state is committed before the process moves on. The activity is not re-run.

To perform actions as a specific user, use the runAsUserById() or runAsUserByUserName() methods of the Users bean.

Exclusive activities

By default, all activities run as exclusive jobs and cannot be completed at the same time as another exclusive activity that belongs to the same process. This ensures the workflow engine performs all activities sequentially. You do not need to change this behavior, as the built-in capabilities can manage different scenarios. You can learn more about the logic behind exclusive jobs in the Flowable documentation.

Last updated

Was this helpful?