Overview
FlowJob defines a job that can have child dependencies, creating a tree-like structure where children are processed before their parents.Interface
Properties
name
The name of the job
queueName
The name of the queue where this job will be added
data
The payload data for this job
prefix
Custom prefix for this job’s queue (overrides default)
opts
Job options (excluding debounce, deduplication, and repeat for parent jobs)
children
Array of child jobs that must complete before this job can be processed
Examples
Simple Flow
Nested Flow
Cross-Queue Flow
With Job Options
Multiple Independent Parents
Flow Execution
Processing Order
- All child jobs are added to their respective queues
- The parent job is added in
waiting-childrenstate - Workers process the child jobs
- When all children complete, the parent moves to
waitingstate - The parent job is processed
- The parent can access children’s results
Accessing Child Results
In the parent job processor:FlowChildJob
For child jobs, a more restrictive type is used:parentoption (automatically set)repeatoptiondebounce/deduplicationoption
Related Types
- JobOptions - Options for individual jobs
- FlowProducer - Class for creating flows
