dbos-inc / dbos-transact

The Transactional TypeScript Framework
https://docs.dbos.dev
MIT License
278 stars 19 forks source link

Dead Letter Queue #523

Closed kraftp closed 1 week ago

kraftp commented 2 weeks ago

This PR implements a dead letter queue for workflows. If a workflow execution is recovered more than N times (50 by default, configurable in WorkflowConfig), it is placed in the dead letter queue and no further attempts will be made to recover it. A list of all workflows in the dead letter queue can be retrieved with getWorkflows().

The goal of this change is to reduce the damage caused by buggy workflows that crash the execution environment. Without a dead letter queue, these will be retried indefinitely, wasting resources and disrupting other works. With this change, they are retried a maximum number of times then placed in the DLQ for manual investigation and restart.