Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add on failure node passing err message doc #6209

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions docs/user_guide/development_lifecycle/failure_node.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ To clone and run the example code on this page, see the [Flytesnacks repo][flyte

```{literalinclude} /examples/development_lifecycle/development_lifecycle/failure_node.py
:caption: development_lifecycle/failure_node.py
:lines: 1-6
:lines: 1-7
```

Create a task that will fail during execution:

```{literalinclude} /examples/development_lifecycle/development_lifecycle/failure_node.py
:caption: development_lifecycle/failure_node.py
:lines: 10-18
:lines: 11-19
```

Create a task that will be executed if any of the tasks in the workflow fail:
Expand All @@ -42,7 +42,8 @@ Create a task that will be executed if any of the tasks in the workflow fail:
Specify the `on_failure` to a cleanup task. This task will be executed if any of the tasks in the workflow fail:

:::{note}
The input of `clean_up` should be the exact same as the input of the workflow.
The inputs of `clean_up` must exactly match the workflow's inputs. Additionally, the `err` parameter will be
populated with the error message encountered during execution.
:::

```{literalinclude} /examples/development_lifecycle/development_lifecycle/failure_node.py
Expand All @@ -54,7 +55,7 @@ By setting the failure policy to `FAIL_AFTER_EXECUTABLE_NODES_COMPLETE` to ensur

```{literalinclude} /examples/development_lifecycle/development_lifecycle/failure_node.py
:caption: development_lifecycle/failure_node.py
:lines: 42-53
:lines: 43-54
```

You can also set the `on_failure` to a workflow. This workflow will be executed if any of the tasks in the workflow fail:
Expand Down
Loading