Hi! I’ve searched in the docs but couldn’t find an...
# prefect-community
m
Hi! I’ve searched in the docs but couldn’t find an answer so I’m asking here, is there a way to run a task even if a previous task fails? Here’s an example:
Copy code
@flow
async def test():
    connected = await connect_db.submit()

    task1 = await db_stuff.submit(wait_for=[connected])
    await disconnect_db.submit(wait_for=[task1])
If
db_stuff
fails,
disconnect_db
never is executed but I’d like it to do it
👀 1
1
b
Hi Marcos, this discourse article might be useful. There is an example which shows a task running regardless of the upstream task's state.
panda dancing 1
upvote 1