You are not looking at the latest version of the documentation. Check it out there.
You are looking at draft pre-release documentation for the next release of Flows for APEX. Product features documented here may not be released or may have different behavior to that documented here. You should not make any purchase decisions based on this draft documentation..

BPMN Sub Processes

Sub Process types

BPMN allows model decomposition, encapsulation and detail hiding through the use of Sub Processes. These can be defined in a diagram, allowing the details of a process to be hidden from the top level process.

BPMN 2.0 has two methods for creating sub processes:

  • BPMN Sub Processes ( ), which allow you to create a sub process as part of your process diagram. Sub processes can be nested to contain other sub processes. All sub processes must be contained in the same diagram as their parent Process. SubProcesses can be drawn expanded, showing all of their contents in the parent diagram level, or collapsed, where the sub process detailed is shown in another diagram level that can be drilled-into. Expanded or collapsed, the details are stored in a single diagram.
  • BPMN Call Activities ( ), where one diagram is able to call a process or part of a process defined in a different diagram. This facilitates process decomposition and re-use of common processes / sub-processes by multiple diagrams.

Flows for APEX allows you to create both sub processes within your process diagram, and call activities to call other process diagrams. Sub processes can be nested to contain other sub processes, and a deeply nested hierarchy of processes and sub processes can be built.

This page documents sub Processes. Call Activities are documented on this page.

Here is an expanded sub process structure, showing sub-process B2 nested inside sub process B in our parent process.

Nested Sub Processes

Creating a Sub Process in Your BPMN Process Diagram

Add a Sub Process into your BPMN diagram by adding a task ( the symbol). Then, using the spanner tool , convert the task to a Sub-process (collapsed) ( ).

Name. On the Modeler properties panel, in the General section , give your task a descriptive name.

ID. By default, this generates a random name like โ€˜โ€˜Activity_0d5gtyhโ€. You can change this to something more descriptive, but it should be short and not contain any spaces.

Screenshot 2025-08-05 at 17.05.33

Now move into the sub process by clicking on the blue arrow on the bottom right-hand corner of the collapsed sub process object.

This will open a fresh diagram level (within the parent diagram). Note that the parent object in the property panel is now the sub process. And also notice the breadcrumb are on the new canvas, which can be used to navigate back to the parent level.

empty sub process

To define the sub process, start by dragging a Start Event from the BPMN Object palette into the sub process. Then add additional process steps, and finally, complete the sub process with an End Event

Screenshot 2025-08-05 at 17.17.24

Rules for Processing Sub Processes

1. Sub Processes must have a single Start Event. ( )

A Sub Process must start with a single Start Event, which should be a simple Start Event (i.e., without any associated Timer, etc. event).

2. One or More End Events ( )

A sub process must have at least one End Event. If more than 1 end events are specified, the sub process waits for all active subflows to complete before returning to its parent process. This acts like an implicit parallel merging gateway. Additionally, a sub process may have additional non-standard end events, such as error or escalation end events).

3. Terminate End Events ( )

A Sub Process can contain a Terminate End Event. If a Terminate End Event is reached, all processing in the sub process, along with any processing in any nested child sub processes contained inside it, are terminated. Control passes to the next event following the normal exit path of the sub process in its immediate parent process.

4. Sub Processes are Embedded Sub Processes and Operate in a Single Lane. ( )

If your diagram contains lanes, a sub process must be contained in a single lane.

5. Sub Processes can be nested.

SubProcesses can be nested to arbitrary depth.

6. Boundary Events ( )

Sub Processes can have Timer, Message, Error and Escalation Boundary Events attached to them. See Boundary Events

7. Multi Instantiation / Iteration. ( ) ๐Ÿ†•

Sub-processes can be defined to execute multiple times - once for each item in a set, either in parallel or sequentially, โ€“ or repetitively until some completion condition is met (BPMN Loop). For example, each low stock item in a stock-take could be re-ordered using a reordering sub process by defining the reordering sub process to be multi instance (parallel).

Multi-instantiation and looping requires the Flows for APEX Enterprise Edition.

6. Event Sub Processes are not yet supported.

Good Practice / Style

Expanded or Collapsed?

Flows for APEX Flow Modeler and Flow Viewer supports sub processes that are shown as expanded or contracted. If a sub process is expanded, the details are visible in the parent diagram. If the sub process is collapsed, the detail is hidden in the parent diagram but you can drill down into the collapsed sub process by clicking on the blue arrow icon shown below the collapsed sub process icon.

Best practice is to use collapsed sub processes normally, unless you have a good reason to show them expanded.

If you are using iteration or looping on sub-processes, you should use collapsed sub processes. The iteration selector then allows you to select which iteration / loop of the sub process you want to view.

Sub Processes and Subflows - How they Work.

When a subflow reaches a Sub Process object, the subflow gets a status of โ€˜In Subprocessโ€™.

Processing in the SubProcess starts on a new subflow, which is running at the subprocess level.

Subflows inside a sub process can themselves split at parallel or inclusive gateways, creating new subflows running at the sub process level. They can also start a new child sub process โ€“ in which case the new parent sub process gets status โ€˜In Subprocessโ€™, and its new child starts new subflows at the new sub process level.

For a sub process to complete normally, all subflows running at the subprocess level must complete by reaching an end event. When the last running subflow in a process level completes normally, the subprocess has completed, and processing continues on its parent subflow.

If a subflow triggers a non-interrupting boundary event, it will cause a new subflow to start on its parentโ€™s process level.

If a subflow triggers an interrupting boundary event, for example an error event or an interrupting timer or interrupting escalation, all processing inside the subprocess is stopped, and the sub processโ€™ parent subflow continues on the path forward from the boundary event, if defined.