When to use CompileFlow
Use CompileFlow when a Java application needs to run business steps in a defined order, with branches or loops. Describe the flow in TBBPM or the supported BPMN subset, keep the business logic in Java methods, host components, or scripts, and execute it inside your application.
Add Deploy to publish flows independently, Durable to continue execution after a restart, or Workbench to design and manage flows in a browser.
Choose how to run your processes
Section titled “Choose how to run your processes”| Requirement | Use | Limits and requirements |
|---|---|---|
| Execute trusted definitions inside the application | ProcessEngine |
Cannot resume a flow after an application crash |
| Publish immutable versions and route Aliases | CompileFlow Deploy | Manages versions and traffic; does not save execution progress |
| Resume supported processes after restart | CompileFlow Durable | PostgreSQL and MySQL are supported; custom Stores use the Provider Preview SPI |
| Persist and retry a whole Workbench request | Workbench Server async invocation | Retries the entire engine call instead of resuming from saved progress |
| Design and inspect supported definitions | Workbench | Provides the interface; the Java engine executes the flow |
Use ProcessEngine to execute a definition directly or select a deployed version. Deploy manages versions and aliases; an execution node prepares the required version before accepting traffic. Use the Durable Run API and a Store when the execution must survive a restart. The choice between COMPILED and INTERPRETED changes how a flow runs, not whether it can recover.
Good fits
Section titled “Good fits”- Business steps with ordering and branching rules. For example, validate an order, calculate its price, check inventory, and choose the next step based on a risk assessment. Teams can review the flow while Java methods or host components implement the individual operations.
- Rules that run repeatedly. Pricing, eligibility, and order checks can reuse a prepared definition. Measure preparation and execution costs with your own workload before choosing compiled or interpreted mode.
- Flow releases that change independently of application code. Deploy publishes immutable versions, shifts traffic gradually, and records the changes.
- Processes that wait or outlive an application process. Durable records waits, timers, child calls, cancellation, and external operations so supported flows can continue after a restart.
Poor fits
Section titled “Poor fits”- A few fixed method calls with no separate flow-governance need. Ordinary Java may be easier to navigate, refactor, and test. Introduce a definition when reviewing, reusing, or publishing the control flow separately brings a concrete benefit.
- Full human-task management. CompileFlow does not provide task assignment, candidate groups, task claiming and completion, forms, escalation, delegation, or approval history.
- Full BPMN 2.0 execution semantics. CompileFlow executes a documented subset. Human tasks,
transactions, choreographies, and event-based gateways are outside the supported profile;
cf:extensions are CompileFlow-specific. - Compiled execution of one-shot definitions. In
COMPILEDmode, repeated execution amortizes compilation cost. A definition used only once may cost more to prepare than to run. ConsiderINTERPRETEDmode for such workloads and measure preparation and execution together. - DMN decision tables. CompileFlow does not include a DMN engine.
- A non-JVM runtime. Runtime execution requires a supported JDK (17, 21, or 25) with the
jdk.compilermodule.
Moving an ordinary flow to Durable
Section titled “Moving an ordinary flow to Durable”For example, the plain Java quote flow uses an action without an execution declaration. It can run directly, but Durable rejects it with DURABLE_ACTION_EXECUTION_REQUIRED. Use execution="replayable" for computations that are safe to repeat, and execution="effect" for external operations. For each Effect, configure reconciliation, idempotent retry, or manual resolution.
Preserve a stable business-request-to-ProcessRunId association, supply notification delivery and Wait authorization, and keep the original definition and required application types/bindings available. Ordinary execution rejects Effect actions, Timers, and Wait deadline/result features that require Durable. The quick start introduces the migration; the Durable guide defines the recovery contract and supported provider capabilities.
Integration boundaries
Section titled “Integration boundaries”-
If a flow involves people, your application must implement task assignment, permissions, forms, and approval records.
-
ProcessEngine.trigger(...)starts a new invocation from an event supplied by the application. It does not resume a stored CompileFlow Run. -
Durable saves Run state and each individual Wait. Your application still decides who handles a Wait and who may submit its result. Treat
WaitTokenas a credential bound to one specific Wait; never put it in logs, metric labels, browser URLs, or third-party metadata. See Repeated completion for completion and retry rules, and Wait-token security for storage and exposure handling. -
Typed output mapping happens after a successful ordinary execution. A mapping failure can return
CF_EXEC_009after business effects have occurred;isFailure()alone is not permission to rerun them. See Handling results.