In certain scenarios, you may want to halt a pipeline if, for example, a metric value surpasses a specified threshold. This can be achieved using a pipeline property known as actions
. Here’s how it works:
When: Actions trigger when certain events occur during pipeline execution. The available options include:
node-starting
: When a node is about to start.node-complete
: When a node successfully completes.node-error
: When a node encounters an error.
If Condition: The condition to trigger the action can be based on either metric or a parameter value.
Then: Depending on the condition being met, you can take one of the following actions:
stop-pipeline
: Halts the entire pipeline.require-approval
: Pauses the pipeline until a user manually approves the previous results.
This structure allows you to add conditional logic to your pipeline, making it more flexible and responsive to specific criteria during execution.
- pipeline:
name: Action pipeline
nodes:
- name: train-model
type: execution
step: Train model
actions:
- when: node-complete
if: metadata.foo >= 0.8
then: stop-pipeline
- name: test-model
type: execution
step: Test model
actions:
- when: node-starting
then: require-approval
edges:
- [train-model.output.model*, test-model.input.model]