When working with Flowable, understanding the distinction between a Job and a Batch is crucial — especially when you're building scalable and asynchronous business process automation.
Let’s clear the confusion once and for all. π
π§± What is a Job in Flowable?
A Job in Flowable represents a single unit of work scheduled for asynchronous execution. It’s typically used for:
-
Timer events (like
TimerBoundaryEvent
,IntermediateTimerCatchEvent
) -
Asynchronous tasks (
asyncBefore
,asyncAfter
) -
Message events
-
Signal handling
-
Retryable operations
✅ Jobs are picked up and executed by the Flowable Job Executor, and each job runs in its own transaction for isolation and retry capability.
π Example: A process has a timer boundary event set for 24 hours. Flowable creates a timer job to wake up the process after 24 hours and continue execution.
π️ What is a Batch in Flowable?
A Batch in Flowable is a higher-level structure that manages large-scale operations by breaking them into multiple jobs (called batch parts).
It’s used when an operation affects many process instances, and processing all of them at once would be inefficient or risky.
✅ A batch ensures:
-
Scalability through chunking
-
Asynchronous execution
-
Resilience via transactional jobs
π Example: Deleting 10,000 historical process instances creates a batch with multiple jobs, each deleting 100 instances at a time.
π Key Differences at a Glance
Feature | Job | Batch |
---|---|---|
Scope | Single unit of async work | Collection of work split into multiple jobs |
Use Case | Timers, async tasks, signals | Bulk operations like mass delete or migration |
Execution | Directly by Job Executor | Executed in multiple job parts (Batch Jobs) |
Transactional | Per job | Per batch part/job |
Monitoring | Visible in Admin UI as jobs | Managed via batch metadata and job parts |
π― When to Use What?
-
Use a Job when you need to handle an async point in a single process (e.g., waiting for 1 hour, or handling a message).
-
Use a Batch when you need to process thousands of instances safely and asynchronously (e.g., delete, migrate, or cleanup operations).
π Final Thoughts
Flowable’s job and batch mechanisms provide the backbone for scalable process automation. Mastering the difference helps you build resilient and performant systems — especially in large enterprise or multi-tenant architectures.
π Want to see batch and job handling in action? Check out our YouTube tutorials and follow us for hands-on demos:
https://youtube.com/@AKITIinstitute
0 Comments