Skip to content

How to run a ShellTask only after the upstream task was finished in prefect? #5486

Answered by zanieb
lucascr91 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! You shouldn't count on the order of the tasks in the flow to determine their execution order. Instead, you should indicate that they are dependent on each other.

See https://docs.prefect.io/orchestration/faq/faq.html#how-do-i-set-a-task-to-be-an-upstream-task

e.g.

with Flow("download_data") as download_data:
    create = create_dirs()
    download = download_ufs(upstream_tasks=[create])
    append = append_partitions(upstream_tasks=[download])

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lucascr91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants