Add a callback to your pipeline blocks
Adding a callback to your block
- Create a block as normal.
- In the top right of the block, click the triple dot icon which should open up a menu with more options. Click “Add callback”.
- You should now see another code editor under the main editor for your block.
- You can add an
on_successcallback and/or a
on_failurecallback. These callbacks will run after your block run completes or fails. When you run your block in the pipeline edit page, it will also run the callback depending on the status of the block.
- The callback function will be passed your pipeline’s runtime variables as keyword
arguments, so you can use the same
kwargs.get('<variable>')syntax in your callback.