Prefect 2.0
You can store the flow run object into a variable and inspect its properties as follows:
from prefect import task, flow
@task
def say_hi():
result = "Hi!"
print(result)
return result
@flow
def hello_world():
say_hi()
if __name__ == "__main__":
flow_run_state = hello_world()
print(flow_run_state) # [Completed(message=None, type=COMPLETED, result='Hi!')]
Prefect 1.0
See the following documentation pages: