In Prefect 2.x, you can manage synchronous (sync) and asynchronous (async) operations within their respective contexts using the concurrency tools provided by Prefect.
Prefect doesn't naturally support running an async flow within a sync flow directly; however, you can manage both types separately using different concurrency management contexts. If you want to incorporate async tasks within a sync flow, you typically need to await them properly, necessitating an async flow context.
Here's a useful guide on
global concurrency limits in Prefect 2.x that explains how to manage both sync and async operations.
For further details on running async functions within Prefect, you might consider converting the enclosing flow into an async flow to accommodate async tasks. If you need to mix sync and async operations frequently, structuring them as separate flows might be beneficial for clean execution and better control.