Hi everyone! I’d like to mark that a task is depen...
# ask-community
f
Hi everyone! I’d like to mark that a task is dependent from the successful completion of another task. The docs (https://docs.prefect.io/core/concepts/tasks.html#triggers) only show examples about how to add a
trigger
in the
run()
method, but these tasks are written using the task decorator only.
Copy code
@task
def parent():

@task
def child():
What are the best next steps?
k
Hey @Fina Silva-Santisteban, not quite sure what you are asking. Is it adding a trigger to the decorator? You can do
@task(trigger=...)
👌 1
f
Hi @Kevin Kho! Sorry for phrasing it confusingly! Yes that’s what I meant. I hadn’t seen a code snippet of a task using the task decorator use a trigger so I wasn’t sure how that was done. Sorry I should have just checked the task decorator function defined inside the prefect codebase to see how that works, the docstrings make things quite clear 😅
k
No problem!