Introduction to BPMN#

Business Process Model and Notation (BPMN) is a graphical representation for specifying business processes in a business process model Wikipedia. Its design was influenced by the Workflow Patterns initiative to cover most of the identified control-flow patterns.

Although originally designed for business workflows, BPMN is now widely used for general process automation and orchestration across IT systems—including microservice choreography, RPA, and integration workflows.

This is an opinionated introduction to some of the most common BPMN 2.0 symbols and their use from a task automation perspective.

Sequence flow#

../_images/sequence-flow.svg

A BPMN sequence flow consists of at least one start event, one end event, and any number of tasks (BPMN activities) connected between them. sequence-flow.bpmn#

Naming of elements#

../_images/sequence-flow-annotated.svg

BPMN flow elements should be named using terms from the business domain of the process. Events should be named to describe the business state of the process. Tasks (BPMN activities) are named using verbs to describe what actions to take in the process. sequence-flow-annotated.bpmn#

Element

Label Pattern

Example

Start Event

Noun + Past Participle / Trigger

“Request received”

Task

Verb + Object

“Handle request”

End Event

Result or Outcome

“Request handled”

Gateways and paths#

../_images/gateways-and-paths.svg

BPMN gateways control which one of the available paths is taken at the time of execution. The exclusive gateway in the example allows only one path to be followed at a time, either splitting or joining the flow. gateways-and-paths.bpmn#

Conditional flows#

../_images/sequence-flow-redux.svg

With exclusive gateways, you can direct the flow of the process based on the results from completed tasks. sequence-flow-redux.bpmn#

Concurrent tokens#

../_images/concurrent-tokens.svg

A BPMN token is a theoretical concept used to define the behavior of a process being performed. There can be any number of concurrent tokens in a single running process. For example, a parallel gateway creates a new token for each outgoing path. The process is completed only when all tokens have been consumed. concurrent-tokens.bpmn#

Inclusive gateway#

../_images/gateways-inclusive-paths.svg

The inclusive gateway in the example allows multiple paths to be followed simultaneously, depending on the conditions defined. This means one or more paths can be taken based on the evaluation of the conditions. gateways-inclusive-paths.bpmn#

Multiple end events#

../_images/multiple-end-events.svg

Not all BPMN tokens need to reach the same end event for the process to be considered complete. A BPMN process may have as many end events as it makes sense for the business process it describes. Not all end events need to be reached for the process to complete; the process completes when there are no more tokens alive. multiple-end-events.bpmn#

Events at boundary#

../_images/boundary-events.svg

Attaching events to element boundaries is where BPMN really shines. In this example, a non-interrupting timer boundary event is used to send a notification about a test execution taking too much time. Non-interrupting events, as the name suggests, do not interrupt the task they are connected to. Instead, they create a new token for the path they start (in the example, once or repeatedly as long as the task has not been completed). boundary-events.bpmn#

Errors at boundary#

There are two kinds of errors in BPMN-driven process automation:

  • Application errors, which are caused by technical issues like network outages or programming errors and can be fixed by retrying the failing part of the process once the technical issue has been resolved.

  • Business errors, which are known exceptions in the process itself and cannot be fixed by simply retrying, but must be expected and handled at the BPMN diagram level instead.

../_images/boundary-bpmn-error.svg

In this example, a business error is expected with a error boundary event (which is always interrupting), and it is used to route the process to an alternative business error end event for further rerouting in the calling parent process. boundary-bpmn-error.bpmn#

Embedded sub-process#

../_images/embedded-subprocess.svg

An embedded sub-process is a process with its own start event and end event(s) within its host process. It is a powerful pattern for wrapping tasks that should share boundary events. In this example, an interrupting boundary timer event is used to cancel the whole sub-process. embedded-subprocess.bpmn#

Note

The example above could also be implemented using multiple boundary events on a task. However, this would change the behavior by allowing the task to handle multiple events simultaneously. Each boundary event could trigger different actions or paths, providing more flexibility and complexity in the process flow.

This approach is useful when a task needs to respond to various conditions or events without interrupting the main process flow.

../_images/multiple-boundary-events.svg

Event sub-process#

../_images/event-subprocess.svg

An event sub-process can either interrupt the execution of the main process (with an interrupting start event) or run sub-processes in parallel to the main process (with a non-interrupting start event). The example demonstrates the latter with a non-interrupting start timer event. event-subprocess.bpmn#

Externalized sub-process#

../_images/call-activity-process.svg

A call activity is used to encapsulate and reference a reusable sub-process (or another process), allowing for modular and maintainable process designs. In this example, it is used to hide the embedded sub-process details from the earlier examples. call-activity-process.bpmn#

Basic task types#

The examples above use only the so-called undefined task. This is useful for drafting and documenting processes, but not for actually implementing and automating them. There are many more specific task types available.

Service task#

../_images/service-task.svg

A service task represents an automated task. All Robot Framework tests and tasks are modeled as service tasks.#

Service task (custom)#

../_images/robot-task.svg

Now that service task has become the core component in process automation, it has also become common to customize its symbol to make it easier to recognize service tasks by category. So, when you see a task element with a unique symbol, like the Robot Framework logo, it is safe to assume that it is a service task with a custom symbol.#

Call activity#

../_images/call-activity-task.svg

Call activity calls a separately configured sub-process, which is defined outside of the main process (unlike an embedded sub-process). It allows abstraction of recurring parts of a process into reusable sub-processes, reducing clutter.#

User task#

../_images/user-task.svg

User task is a task meant to be completed by a human via a connected user interface. The most common way to implement a user task is to show the user a form.#

Symbol summary#

Symbol

Description

Start event

End event

Task

Service task

User task

Call activity

Exclusive gateway

Parallel gateway

Inclusive gateway

Non-interrupting timer boundary event

Error boundary event

Interrupting timer boundary event

Non-interrupting timer sub-process start event