Async Before / After in Camunda — Why Your Process Freezes

 One of the most common production complaints in Camunda:

“My process sometimes freezes… but no error is visible.”

This usually happens because the process is running inside a single transaction.

Camunda executes multiple BPMN steps in one database transaction unless you tell it not to.

So, when one step blocks → the entire process stops.

The solution: Async Before / Async After


What is Async in Camunda?

Async creates a transaction boundary.

Instead of executing everything in one go:

Task A → Task B → Task C

Camunda stores the state in DB and continues later via Job Executor.


Without Async (Single Transaction)

Everything runs in one DB transaction.

Problem

If Task B takes 20 seconds:

  • DB lock held

  • UI stuck

  • Other instances blocked

  • Possible deadlock


Async Before

Creates checkpoint before task execution

Behavior

Process state saved → job created → executed later

Use When

  • Calling external API

  • Slow logic

  • Network calls


Async After

Checkpoint after task completes

Use When

  • Before gateway evaluation

  • Avoid optimistic locking

  • Parallel flows


Critical Production Scenario

Without Async

Service task → gateway

Gateway evaluated inside same transaction
If another instance updates → optimistic locking exception

With Async After

Gateway evaluated safely in new transaction


Where You MUST Use Async

BPMN ElementNeeded
External APIAsync Before
Parallel GatewayAsync After
User Task creationAsync After
External TaskAsync Before
Long Java DelegateAsync Before

Common Mistake

Only adding async at process start

This does nothing for internal blocking tasks.

Async must be placed at risk points.


Architecture Rule

Every remote call must be async
Every parallel gateway must be async

Debug Tip

If process freezes and DB CPU high → missing async boundary.


📚 Recommended Reading

Improve Camunda stability:

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

Read especially:

These relate directly to async configuration.


Final Advice

BPMN is fast.
Transactions are slow.

Async boundaries protect your engine.

Correct async placement = stable production system.


💼 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