Embedded subprocess

🌐 This document is available in both English and Ukrainian. Use the language toggle in the top right corner to switch between versions.

1. Overview

An Embedded subprocess is a subprocess that is configured and run inside the main (parent) business process.

An embedded subprocess allows the user to avoid running two business processes separately, leaving the Portal every time to start each process. Embedding a subprocess provides a smooth transfer between business processes without separating the main process and the subprocess.

For example, the main process has a purpose of entering contract data, but it requires approval of the changes by an authorized officer. This approval process logically fits into an embedded subprocess, thus having a dedicated process for everything, and still fitting into one sequence flow.

embedded subprocess 1

An embedded subprocess must only contain one none start event[1].

On embedded subprocess activation, a Start event initiates it. The subprocess remains active while at least one element in its container is active. At the end of the last element of the subprocess, meaning the final event, the subprocess ends, and the output sequence flow continues in the Parent[2] process.

2. Using embedded subprocess in modeling

We’ll show how to use the Embedded Subprocess BPMN-element with a data input business process (_further in this text — main or parent process) and changes approval embedded subprocess (_further in this text — subprocess) as an example.

At the modeling stage, create 1 pool with a business process and save it in one .bpmn file.

2.2. Creating a pool for the business process

Model a pool for the main process by taking the following steps:

Modeling of business process diagram must be performed within the Create Pool/Participant element.
  1. Open Camunda Modeler and create a new BPMN diagram by clicking FileNew FileBPMN Diagram in the top left corner.

    bp 1

  2. On the left panel, find the Create pool/Participant element and drag it to the modeling canvas.

    bp 2

  3. Fill in the following fields with the corresponding values:

    • In the Participant Name field, enter the name of the pool — Data input business process.

    • In the Process id field, enter business process ID (for example, processId).

    • In the Process Name field, enter business process name — Data input business process.

    embedded subprocess 2

2.3. Modeling main process start event

Create a start event by taking the following steps:

  1. On the left panel, find CreateStartEvent element and drag it to the modeling canvas.

  2. On the right panel, fill in the following parameters with the corresponding values:

    • In the Name field, enter name for the start event — Process start.

    • In the Initiator field, enter initiator.

      initiator — is a special variable set for the user who started the process.

    embedded subprocess 3

2.4. Modelling the user task for entering online order data

To create a user task for data entering, take the following steps:

  1. Create a new task, define its type by clicking the key icon and selecting User Task from the menu.

  2. On the right panel, click Open Catalog, select User Form template, and click Apply to confirm.

  3. On the right panel, fill in the following fields:

    • In the Id field, set task ID — user-form-1.

    • In the Name field, enter task name — Order data form.

    • In the Form key field, enter form key that will correspond with the form service name — add-order-bp-add-order-test.

    • In the Assignee field, enter the variable of the user who initiated the process instance — ${initiator}.

embedded subprocess 4

2.5. Modelling embedded subprocess

Next, we need to model the embedded subprocess. It is configured inside a dedicated container within the same pool.

  1. On the left panel, find the Create expanded SubProcess element, and drag it into the pool.

    embedded subprocess 5

  2. Next, model the three elements within the subprocess:

    • subprocess start event;

    • user task for changes approval;

    • subprocess end event.

2.5.1. Modelling subprocess start event

Configure subprocess start event.

As opposed to configuring the main process, subprocess start event is added automatically, along with the Create expanded SubProcess container.

On the right panel, fill in the Name field with the start event name — Subprocess start.

embedded subprocess 6

2.5.2. Creating the changes approval user task

Create the user task for changes approval by taking the following steps:

  1. Create a new task, define its type by clicking the key icon, and selecting User Task from the menu.

  2. On the right panel, click Open Catalog, select User Form template, and click Apply to confirm.

  3. On the configuration panel, fill in the following fields:

    • In the Name field, enter task name — Making decision on contract approval.

    • In the Form key field, enter the form key that corresponds with the service name of the form — add-applicationsecond.

    • In the Assignee field, enter the variable used to store the user that initiated the instance — ${initiator}.

    embedded subprocess 7

2.5.3. Modelling subprocess end event

  1. Create subprocess end event.

  2. On the right panel, for the Name parameter, enter the value Subprocess end.

    embedded subprocess 8

2.6. Modeling main process end event

  1. Create main process end event.

  2. On the right panel, for the Name parameter, enter the value Process end.

    embedded subprocess 9


1. None events are undefined events, also called "empty."
2. Parent Process is a process that initiates subprocess start. A subprocess is a Child Process to a Parent Process.