Skip to main content
The dlq.restart method restarts one or more workflow runs from the Dead Letter Queue (DLQ). This allows you to reprocess workflow runs that previously failed after exhausting retries. Can be called with DLQ IDs (with optional flowControl and retries), or with a filter object to restart matching entries.

Arguments

DLQ ID mode

dlqId
string|string[]
required
The DLQ entry ID or list of IDs to restart. Use the dlqId field from messages returned by client.dlq.list().
flowControl
object
An optional flow control configuration to limit concurrency and execution rate of restarted workflow runs.See Flow Control for details.
retries
number
Number of retry attempts to apply to the restarted workflow invocation. Defaults to 3 if not provided.

Filter mode

label
string
Restart DLQ entries with this label.
workflowUrl
string
Restart DLQ entries matching this workflow URL.
workflowRunIds
string[]
Restart DLQ entries matching these workflow run IDs.
fromDate
string
Restart DLQ entries created after this date (Unix ms as string).
toDate
string
Restart DLQ entries created before this date (Unix ms as string).

Response

The return type depends on the input:
  • Single DLQ ID (string): Returns a single object
  • Array of DLQ IDs: Returns an array of objects
  • Filter mode: Returns an array of objects
workflowRunId
string
The ID of the new workflow run created from the restarted DLQ message.
workflowCreatedAt
string
The timestamp when the new workflow run was created.

Usage

const { messages } = await client.dlq.list();

const run = await client.dlq.restart({
  dlqId: messages[0].dlqId,
  flowControl: {
    key: "my-flow-control-key",
    parallelism: 10,
  },
  retries: 3,
});

console.log(run.workflowRunId); // ID of the restarted workflow run