Defining an error path in a workflow
You can add a branch in your workflow so that if a job goes into error state, the
job continues processing in another path in the workflow instead of staying in the
Error state. You can define a branch out of any step in the workflow.
- Click the Workflow tab.
- Click the name of the workflow you want to modify.
- Optional: Disable the workflow by clicking the switch to the left of the workflow name. If you do not disable the workflow while you edit it, jobs that use this workflow continue to move through steps. When you save, the workflow is momentarily disabled then enabled again. Jobs that are processing in the workflow could move into error.
- Find the step you want to create an error path for.
- Add the step that you want the error branch to take.
- Draw a connector from the step where the error could occur to the step that you want to execute when the error happens.
- Right-click the connector you just drew and select Properties.
- Add a rule for when the job goes into error:
- Type the Rule name to define the new rule.We recommend giving the rule a name that identifies the branch as an error path, such as
If error
. You see the name next to the connector on the workflow editor - To specify the condition to test for the error state, set Property to Current job state, Comparison to is (=), and Value to Error.
- Note:
- Error is the only value for the Current job state property that can be used in a rule.
- Make sure that the Order of execution value is set appropriately for the error path. If other conditions are met before the error path, the job might not take the path you intended.
- Type the Rule name to define the new rule.
- Add any other conditions that you want to use to evaluate when to take the error path.
- Click OK.
- Repeat this procedure to add more error paths. Multiple error paths can exist in one workflow.
- Save and enable the workflow.
- Enable the workflow and test it to make sure that the rules in the branch work in
the way you expect. Submit jobs that are sent through all the paths. When a job takes
the error path, it moves out of the Error state, so you must find another way to look for jobs instead of searching for the
Error state.
- Note:
- When the job goes into the Error state, files in the
/tmp
directory under the spool directory for the job are moved to an/error
directory. When they are moved, the step name and phase name are prepended to the file names.
- When the job goes into the Error state, files in the