Skip to content

Commit

Permalink
[Docs] Echo Task (#5707)
Browse files Browse the repository at this point in the history
* add echo tasks

Signed-off-by: Future-Outlier <[email protected]>

* update nikki's advice

Signed-off-by: Future-Outlier <[email protected]>
Co-authored-by: nikki everett <[email protected]>

---------

Signed-off-by: Future-Outlier <[email protected]>
Co-authored-by: nikki everett <[email protected]>
Signed-off-by: pmahindrakar-oss <[email protected]>
  • Loading branch information
2 people authored and pmahindrakar-oss committed Sep 9, 2024
1 parent 17bad62 commit e7adb39
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/user_guide/advanced_composition/conditionals.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,25 @@ You can run the workflow locally as follows:
:lines: 181-188
```

## Running a noop task in a conditional

In some cases, you may want to skip the execution of a conditional workflow if a certain condition is not met.
You can achieve this by using the `echo` task, which simply returns the input value.

:::{note}
To enable the echo plugin in the backend, add the plugin to Flyte's configuration file.
```yaml
task-plugins:
enabled-plugins:
- echo
```
:::
```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/89bf7bc7788802097904c5f9ffb75ba70ef980a6/examples/advanced_composition/advanced_composition/conditional.py
:caption: advanced_composition/conditional.py
:lines: 197-209
```
## Run the example on the Flyte cluster
To run the provided workflows on the Flyte cluster, use the following commands:
Expand Down Expand Up @@ -170,4 +189,10 @@ pyflyte run --remote \
consume_task_output --radius 0.4 --seed 7
```

```
pyflyte run --remote \
https://raw.githubusercontent.com/flyteorg/flytesnacks/89bf7bc7788802097904c5f9ffb75ba70ef980a6/examples/advanced_composition/advanced_composition/conditional.py \
noop_in_conditional --radius 0.4 --seed 5
```

[flytesnacks]: https://github.com/flyteorg/flytesnacks/tree/master/examples/advanced_composition

0 comments on commit e7adb39

Please sign in to comment.