Slackbot
06/19/2026, 11:08 AMMarvin
06/19/2026, 11:08 AMMarvin
06/19/2026, 11:11 AMcool_task.submit() returns a PrefectFuture
- when that future is passed as an argument to another task/flow, Prefect automatically resolves it to its result before execution
So this is valid:
python
from prefect import task, flow
@task
def cool_task():
return "sup"
@task
def what_did_cool_task_say(what_it_said: str):
return f"cool task said {what_it_said}"
@flow
def my_workflow():
future = cool_task.submit()
print(what_did_cool_task_say(future))
and should print:
cool task said sup
Docs: Handling futures
A couple important notes:
1. This is not concurrent for the second task
what_did_cool_task_say(future) is a normal task call, so the flow waits for it and gets its return value immediately.
2. If you want both tasks orchestrated as submitted task runs, use:
python
from prefect import task, flow
@task
def cool_task():
return "sup"
@task
def what_did_cool_task_say(what_it_said: str):
return f"cool task said {what_it_said}"
@flow
def my_workflow():
future = cool_task.submit()
future_2 = what_did_cool_task_say.submit(future)
print(future_2.result())
If it “does not work” on your side, can you paste the exact error and your exact Prefect version from:
prefect version
Most likely causes are:
- an indentation/copy issue from the snippet
- running in an environment with an older/different Prefect installed
- mixing sync/async patterns somewhere outside this minimal example
If you want, I can help debug it from the traceback.