Camunda Job Executor vs External Task — Complete Comparison & Best Practices
One of the most confusing topics for Camunda developers is:
Should I use Java Delegates (Job Executor) or External Tasks (Workers)?
Both execute service tasks — but their architecture, scalability, and reliability are completely different.
Choosing the wrong one leads to:
blocked threads
timeouts
production incidents
impossible scaling
This guide explains the real difference with practical use cases.
Conceptual Difference
| Feature | Job Executor | External Task |
|---|---|---|
| Execution | Inside engine | Outside engine |
| Language | Java only | Any language |
| Scalability | Limited | Very high |
| Failure handling | Incident | Retry controlled |
| Microservices ready | ❌ | ✔ |
1) Job Executor (Java Delegate)
The engine executes the code inside its own thread pool.
Flow:
Process reaches service task
Engine locks job
Executes Java code
Continues process
Example
public class PaymentDelegate implements JavaDelegate {
public void execute(DelegateExecution execution) {
paymentService.charge();
}
}
Advantages
✔ Simple
✔ Fast
✔ Good for DB operations
Problems in Production
❌ Engine crash = job lost
❌ Long API calls block engine
❌ Scaling difficult
2) External Task (Worker Pattern)
Engine only creates a task.
Worker pulls and executes it.
Flow:
Process reaches service task
Engine creates external task
Worker fetch & lock
Worker executes
Worker completes
Example (Java Worker)
client.subscribe("charge-payment")
.handler((task, service) -> {
paymentService.charge();
service.complete(task);
});
Advantages
✔ Microservice friendly
✔ Retry safe
✔ Independent scaling
✔ Multi-language support
Tradeoff
Slightly slower than delegate
Failure Behavior (Critical Difference)
| Scenario | Job Executor | External Task |
|---|---|---|
| API timeout | Incident | Retry |
| Worker crash | Process stuck | Re-fetch |
| Engine restart | Lost execution | Safe |
| Network failure | Incident | Recoverable |
When to Use What
Use Job Executor if:
Pure DB logic
Millisecond operations
Internal logic
No remote calls
Use External Task if:
REST APIs
Payment gateways
Email / SMS
AI services
Microservices
Architecture Recommendation
Modern Camunda architecture:
BPMN Engine = Orchestrator
Workers = Business logic
Never mix heavy logic inside the engine.
Common Production Mistake
Calling REST API inside JavaDelegate
This blocks job executor threads → engine stops processing.
Always use External Task for IO operations.
📚 Recommended Reading
Continue learning Camunda production stability:
👉 https://shikhanirankari.blogspot.com/search/label/English
Suggested topics:
These directly relate to execution strategy selection.
Final Advice
Job Executor = Embedded automation
External Task = Distributed automation
Modern systems always prefer External Tasks.
💼 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
🌐 Website: IT Trainings | Digital metal podium
Comments
Post a Comment