Exit status of a task-oriented job step
Key Takeaway
The dw.system.Status that a task-oriented step returns sets its exit status. A non-error Status ends the step with OK or its custom code, so the job continues. An error Status ends the step with ERROR, even when it has a custom code, so the job stops unless a transition handles that status.
A task-oriented job step runs one script function from start to finish. Its exit status tells the B2C Commerce job framework whether the step failed and whether the job should keep running. The function sets the exit status by returning a dw.system.Status object. When the function doesn't return one, default rules decide the exit status.
Task-oriented script modules
A task-oriented CommonJS script module exposes one function. The job framework calls that function as the main function of the step.
A task-oriented module works best for a single task where progress can't be calculated or where the boundaries are hard to calculate.