oban-bg/oban

Introduce global timeouts for workflows

Closed this issue · 2 comments

Is your feature request related to a problem? Please describe.

I'm currently working on a project where we have relatively long running workflows. It's ok for the individual workers in the flow to retry in case of failures, but overall we would like to cancel the entire workflow in case it takes longer than a set number of hours. I think I can build something that sort of works with the Relay extension, but it feels extremely hacky. I couldn't find an "official" way of doing something like this in the docs. I think this would be a nice feature to have.

Describe the Solution You'd Like

Being able to set a timeout on a workflow, after which the entire workflow gets cancelled, unless an individual worker is configured to run, even if cancelled.

@jkrueger With the upcoming deadline option for all Pro workers you'll be able to set a per-job deadline, which can cascade down a workflow to cancel jos that haven't started. Deadlines can optionally be applied after a job starts as well, to auto-cancel a long running job while its still executing.

That sounds really good. Thanks for building a solution for this. Looking forward to trying it out.