Frank Embleton

05/15/2022, 11:38 AM
Hello am new to prefect and just reading through the docs. On the Flows page this is super confusing to me:
Return a future
If a flow returns one or more futures, the final state is determined based on the underlying states.
```from prefect import task, flow
def always_fails_task():
raise ValueError("I am bad task")
def always_succeeds_task():
return "foo"
def always_succeeds_flow():
x = always_fails_task()
y = always_succeeds_task()
return y```
What does it mean by futures here? My understanding was that futures are to do with threading and async in Python, of which I see neither here? What am I missing? 🤔

Anna Geller

05/15/2022, 12:00 PM
this doc means PrefectFutures which represent the result of a computation happening in a task runner.
>>> @flow
>>> def my_flow():
>>>     future = my_task()  # PrefectFuture[str, Sync] includes result type
>>>     future.run_id  # UUID for the task run

Frank Embleton

05/15/2022, 12:07 PM
Thanks @Anna Geller 🙏 I have submitted a PR to the docs to link
👍 1
:thank-you: 1