Concurrent Execution of Activities in Parallel Transition Branches

The FLOGO_FLOW_EXECUTE_BRANCHES_CONCURRENTLY variable controls whether activities on parallel transition branches execute concurrently. When set to true, the Flogo flow engine runs the branches simultaneously instead of sequentially, reducing overall flow latency for I/O-bound and CPU-intensive workloads. The default value is false. This variable has the following key characteristics:

  • Off by default — existing flows behave exactly as before unless the feature is explicitly enabled.
  • Engine-wide switch — the setting applies to the entire engine; no per-flow configuration is required.
  • No impact on sequential flows — flows with sequential transitions continue to behave identically regardless of the variable setting.

Enabling Concurrent Branch Execution

Set the following environment variable where the Flogo flow runtime starts:

FLOGO_FLOW_EXECUTE_BRANCHES_CONCURRENTLY=true

No application code changes or flow redesign are required.

When to Enable

Enable this variable when the flow fans out into two or more parallel branches that perform independent work, such as:

  • Blocking I/O operations, such as REST calls, database queries, object-storage operations, or messaging
  • CPU-intensive work, such as data transformations, compression, or encryption, when the host has spare CPU cores available

You do not need to set the environment variable when:

  • The flow is linear or single-branch — concurrent execution provides no benefit.
  • The parallel branches perform trivial work (sub-millisecond execution) — scheduling overhead may exceed the benefit.
  • The host is CPU-saturated and the branches are CPU-intensive — concurrent execution competes for limited CPU resources.

The speed-up from concurrent branch execution is approximately equal to the sum of all branch durations divided by the duration of the longest branch. For example, three branches that take 200 ms, 300 ms, and 500 ms complete in approximately 500 ms when run concurrently, compared to 1000 ms when run sequentially.

Capacity Planning

  • Budget approximately 10 to 15 MB of additional working-set memory per engine instance running concurrent I/O flows under load.
  • Expect approximately twice as many OS threads under concurrent load compared to sequential mode.
  • No extra CPU headroom is required for I/O-bound flows.
  • For CPU-intensive parallel branches, provision CPU cores equal to the branch fan-out that you want to parallelize.
Note:
  • Tail latency is governed by downstream services, not the Flogo engine. The feature improves throughput and typical request latency. Outlier latency reflects the performance of external dependencies.
  • The concurrency pool size is bounded by min(GOMAXPROCS, 32).
  • The feature is Go-version-independent — the concurrency speed-up is consistent across Go toolchain versions.
  • The feature is off by default. Existing deployments require no changes.
  • When the feature is enabled, only flows with parallel transition branches are affected. Sequential flows are unchanged.
  • Setting the variable to false or removing it reverts to sequential branch execution immediately.
  • Roll out the feature per environment and test gradually to validate behavior with your specific flow patterns and downstream services.