Using hooks to customize job execution¶
You use hooks to override the default behavior of a job or of all jobs in a workflow, or to customize the behavior of functions.
Overview¶
About functions hooks¶
You can use hooks
to define a set of actions to customize the behavior of functions.
Typically, you use function hooks to:
Example of defining hooks for function a
When more than one hook is defined for the same event, the orchestrator order them as follows:
before
hooks defined in the workflow (in order of appearance)before
hooks defined by the function handler (in order of appearance)- Steps from the event
after
hooks defined by the function handler (in reverse order)after
hooks defined in the workflow (in reverse order)
For more information on setting function hooks, see “Defining function hooks.”
About job hooks¶
Typically, you use jobs hooks to:
Job hooks override the default behavior at job setup and teardown time. That allows you to specify a specific workspace for the job to run on, or to keep this workspace if the job fails, or if some condition occurs.
Example of defining job hooks
When more than one hook is defined for the same event, the orchestrator order them as follows:
before
hooks defined in the workflow (in order of appearance)before
hooks defined by the job handler (in order of apperance)- Steps from the event
after
hooks defined by the job handler (in reverse order)after
hooks defined in the workflow (in reverse order)
For more information on setting job hooks, see “Defining job hooks.”