BPMN2

Comparisons

The Business Process Model and Notation (BPMN) defines a flowchart-based DSL for workflows. It is maintained by the Object Management Group (OMG). The latest BPMN version is 2.0.2, published in 2014.

BPMN2 defines a graphical notation to specify workflows. This notation can then be shared between tooling and organizations. The graphical notation is translated into XML, which then can be used for runtime execution.

For this comparison, we will compare the Serverless Workflow language with the graphical representation of BPMN2, and not its underlying XML representation. The BPMN2 XML is very difficult to understand, quite large for even the smallest workflows, and often not portable between runtimes. It makes more sense to use its portable graphical notation for comparisons.

Serverless Workflow is a declarative workflow language, represented with JSON or YAML. It currently does not define a graphical notation. However, it can be graphically represented using different flowcharting techniques such as UML activity diagrams. The Serverless Workflow Java SDK as well as its VSCode Extension provide means to generate SVG diagrams based on the workflow JSON/YAML.

Note when reading provided examples

The BPMN2 graphical notation does not provide details about data inputs/outputs, mapping, and transformation. BPMN2 does provide graphical representation for things such as Data Objects. However, most of the examples available do not use them. Execution semantics such as task and event properties are also not visual. For this reason, the event, function, retry, and data mapping defined in the associated Serverless Workflow YAML are assumed.

Examples

Simple File Processor

BPMN2 Diagram
Serverless Workflow

Process Application

BPMN2 Diagram
Serverless Workflow

Compensation

BPMN2 Diagram
Serverless Workflow

Error Handling With Retries

BPMN2 Diagram
Serverless Workflow

Process Execution Timeout

BPMN2 Diagram
Serverless Workflow

Multiple Instance Subprocess

BPMN2 Diagram
Serverless Workflow

  • Note: We did not include the dosomethingandwaitformessage workflow in this example, which would just include a starting "operation" state transitioning to an "event" state which waits for the needed event.

Loop Subprocess

BPMN2 Diagram
Serverless Workflow

This workflow assumes that the input to the workflow includes a maxChecks attribute set to an integer value.

  • Note: We did not include the checkAndReplyToEmail workflow in this example, which would include the control-flow logic to check email and make a decision to reply to it or wait an hour.

Approve Report

BPMN2 Diagram
Serverless Workflow

  • Note: Human interactions during workflow execution in Serverless Workflow is handled via its Callback state.

Event Based Decision

BPMN2 Diagram
Serverless Workflow

Last updated