Hi! I am using prefect `3.0.11` , and reproducing ...
# ask-community
j
Hi! I am using prefect
3.0.11
, and reproducing the example to manage States:
Copy code
from prefect import flow, task 


@task 
def add_one(x):
    return x + 1


@flow 
def my_flow():
    # avoided raising an exception via `return_state=True`
    state = add_one("1", return_state=True)
    assert state.is_failed()

    # the flow function returns successfully!
    return
My question is:
return_state=True
run and waits for task run? I mean, if I use
state = add_one.sumbmit("1", return_state=True)
, it seems that it waits...but does it use the task runner? Is it intended? Does it under the hood executes the old prefectv2
t = add_one.sumbmit()
,
state = t.wait()
?