This message was deleted.
# ask-marvin
s
This message was deleted.
m
Running asynchronous flows in Prefect 3.0 involves a few changes compared to Prefect 2.0, especially if you previously used
asyncio.run()
for execution. In Prefect 3.0, asynchronous flows are supported and can be executed as coroutines, which provides flexibility in managing flow execution asynchronously or concurrently. Here's a friendly tip: to run these async flows, you should ensure you're treating them as coroutines. Prefect 3.0 supports both synchronous and asynchronous execution of flows, including class methods and static methods. If you decorate your function with
@flow
, Prefect will understand that this is a flow, and you can then execute them asynchronously or run them concurrently according to standard async Python practices. More details on writing and executing async flows can be found here where they guide on turning standard Python functions into Prefect flows using the
@flow
decorator. As for the
@sync_compatible
decorator, there haven't been explicit documented changes between Prefect 2.x and 3.x, but you might be encountering behavior changes related to how Prefect handles asynchronous flows internally. It's always a good practice to consult the specific version documentation or see if any migration guides are applicable between major versions. Let me know if you need any more information, and remember, there's no need to panic—unless you really enjoy panicking.
t
deleted as my question was related to my own mistake in my own decorator that wraps
flow
to add custom hooks, thanks Marvin