Sequence Flows

Sequence flow is a BPMN element that represents the order in which activities are performed within a business process. It defines the logical flow of work or information from one activity to another, indicating the sequence in which tasks or subprocesses should be executed.

Sequence flows connect two activities in a BPMN diagram, showing the direction in which the process flows and the dependencies between activities. They play a crucial role in visualizing and modeling the flow of work within a business process, helping to ensure clarity and consistency in process design.

Graphical and XML Representation

A sequence flow is visualized as an arrow going from the source element towards the target element. The arrow always points towards the target.

graphical flow

In the XML file sequence flows are represented as separate objects among other BPMN elements:

    <sequenceFlow id="Flow_1sjggq6" sourceRef="Event_15w11z6" targetRef="Gateway_0r2ejfv" />

You can see two XML attributes in the sequence flow description: sourceRef and targetRef that are referencing elements where the arrow begins and ends.

Incoming and Outgoing Flows

As a sequence flow connects two activities, for the first one it is outgoing and for the second one — incoming flow.

incoming outgoing flows

Best practice is to have the only one incoming and the only one outgoing flow for each activity.

In the XML file you can see references to sequence flows in the corresponding BPMN element description:

    <task id="Activity_1pncn0v" name="Activity">
      <incoming>Flow_1tncfsd</incoming>
      <outgoing>Flow_1nxsuoi</outgoing>
    </task>

Sequence Flow Properties

In the BPMN modeler, you can set the following properties of a sequence flow:

flow properties

Property

Description

Id

The identifier of the element. It is generated automatically, but you can change it to a more meaningful one to make logs easier to understand.

Name

The name of the element.

Condition source

The source of the condition: Expression, User task outcome, or Business rule task result. See Conditions.

Condition expression

The condition for the Expression source. See Expressions.

User task id, User task outcome

The user task and its outcome for the User task outcome source. See User Task Outcomes.

Condition type

The completion condition for a multi-instance user task. Available for the User task outcome source when the selected user task is multi-instance. See Multi-Instance.

Business rule task, Decision table output variable name, Decision table output value

The business rule task and its result for the Business rule task result source. See Business Rule Task Result.

Execution listeners

See Execution Listeners.

Documentation

A description and additional information about the element.

Conditional Sequence Flow

BPMN 2.0 defines a conditional flow as a special element of notation. Graphically, it is represented as a regular sequence flow with a mini-diamond at the beginning of the connector line, see below:

conditional flow

Conditional flow can be used only as outgoing flow for activity. The condition must be evaluated at runtime to determine whether the sequence flow will be used or not.

In Jmix BPM all sequence flows may have a condition, but it will be evaluated and used only when required.

conditional flow example

It is highly not recommended to use conditional flows because of the risk of errors. For example, in the picture above, the process will stop if the condition is false and no other paths are available.

Default Sequence Flow

All BPMN 2.0 tasks and gateways can have a default sequence flow. This sequence flow is only selected as the outgoing sequence flow for activity or gateway.

A default sequence flow is visualized as a regular sequence flow, with a 'slash' marker at the beginning.

default flow

Default flow’s behavior depends on the element it is used with. Conditions on a default sequence flow are always ignored.

Using Conditional and Default Sequence Flows

Though BPMN specification allows using conditional and default flows as in the picture below, avoid using them such way. It makes the diagram worse readable and ambiguous.

sequence flow bad example

Instead of conditional and default flows, outgoing from the activity, better use gateway:

using flows good example

In this example, you can see an exclusive gateway, parallel and inclusive gateways are also possible.