How can I inspect the flow run states locally?

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:

This is no longer valid as of 2.0b9 since it eagerly computes.

1 Like

Thanks Andrew, I edited the example

1 Like