https://prefect.io logo
e

Equipe AI HOC

01/02/2021, 11:28 AM
Hello. I am in doubt either to use Trigger or State Handler. I want some tasks to check a context/parameter to see if they should run or not.
n

nicholas

01/02/2021, 2:11 PM
Hi @Equipe AI HOC - it sounds like perhaps the best way for you to handle this would be to have a single upstream task that checks your context/parameter and raises a
SKIP
signal if your conditions aren't met. By default, downstream tasks will skip if their upstream tasks are skipped (and if you don't always want this to happen, you can choose to disable that behavior on a per-task basis using the
skip_on_upstream=False
kwarg). For more information on signals, take a look at the concept docs and the API docs.
e

Equipe AI HOC

01/02/2021, 3:39 PM
Thanks for the reply.
👍 1