Demid
07/24/2025, 8:41 AMException: 'coroutine' object has no attribute 'with_options'Marvin
07/24/2025, 8:41 AMMarvin
07/24/2025, 8:42 AMwith_optionswith_optionspython
from prefect import task, flow
# First, create the task using the @task decorator
@task
async def my_async_task(x):
    # Your async task logic here
    return x * 2
# Now you can use with_options on the task object
modified_task = my_async_task.with_options(
    name="custom_name",
    retries=3,
    tags=["async", "example"]
)
@flow
async def my_flow():
    # Use the modified task
    result = await modified_task(5)
    return result@taskwith_options@taskwith_optionswith_optionswith_options@task