Camunda Transaction Boundaries Explained Visually

 Many Camunda production issues come from one misunderstanding:

“Each BPMN task runs separately.”

No — by default Camunda executes multiple BPMN steps inside one database transaction.

That means one failure can roll back multiple steps.

Understanding transaction boundaries is the key to fixing:

  • stuck processes

  • optimistic locking

  • duplicate executions

  • random rollbacks


What is a Transaction Boundary?

A transaction boundary is a checkpoint where the process state is saved in DB.

Without it → everything runs in one transaction
With it → process resumes safely later


Default Execution (No Boundary)

Camunda runs until a wait state appears.

What is a Wait State?

  • User Task

  • Receive Task

  • Timer

  • External Task

At these points, state is stored automatically.


The Problem — Rollback Chain Reaction

Example:

Service Task A → Service Task B → Service Task C

If C fails → A & B rollback too.

This causes:

  • duplicate API calls

  • payment charged twice

  • inconsistent business data


Async Before Creates Boundary

Async Before forces a save before execution.

Now only the failing step retries — not previous ones.


Async After Creates Boundary After Execution

Used mainly before gateways and parallel flows.


Optimistic Locking Problem

Occurs when two executions update same process instance.

Without boundary → exception loop
With async → safe retry


Internal Engine Behavior

Camunda does:

Execute → Flush DB → Commit → Continue

Async splits it into multiple safe commits.


Where Boundaries Should Exist

LocationWhy
Before external callPrevent duplicates
Before gatewayAvoid optimistic locking
Parallel gatewayConcurrency safety
Long service taskPrevent blocking

Common Mistake

Adding async only at process start

Does nothing for internal rollback chains.


Architecture Rule

Every remote call must have a transaction boundary.


📚 Recommended Reading

Improve reliability:

👉 https://shikhanirankari.blogspot.com/search/label/English

Especially:


Final Advice

BPMN controls flow
Transactions control safety

If you design boundaries correctly, your process becomes resilient.


💼 Professional Support Available

If you are facing issues in real projects related to enterprise backend development or workflow automation, I provide paid consulting, production debugging, project support, and focused trainings.

Technologies covered include Java, Spring Boot, PL/SQL, CMS, Azure, and workflow automation (jBPM, Camunda BPM, RHPAM, Flowable).

📧 Contact: ishikhanirankari@gmail.com | info@realtechnologiesindia.com

🌐 WebsiteIT Trainings | Digital metal podium



Comments

Popular posts from this blog

OOPs Concepts in Java | English | Object Oriented Programming Explained

Scopes of Signal in jBPM

jBPM Installation Guide: Step by Step Setup