client.dlq

client.dlq.restart

The dlq.restart method restarts one or more workflow runs from Dead Letter Queue (DLQ). This allows you to reprocess workflow runs that previously failed after exhausting retries.

Arguments

The first argument specifies which DLQ entries to restart. The optional second argument provides flow control and retry settings.

By DLQ ID

Pass a single DLQ ID or an array of IDs directly:

await client.dlq.restart("dlq-12345");await client.dlq.restart(["dlq-12345", "dlq-67890"]);

By filters

Pass an object with a filter field:

filterbodyobject
countbodynumber

Maximum number of messages to process per call. Defaults to 100.

cursorbodystring

A pagination cursor from a previous request.

Restart all

allbodyboolean

Set to true to restart all DLQ entries.

Options (second argument)

flowControlbodyobject

An optional flow control configuration to limit concurrency and execution rate of restarted workflow runs.

See Flow Control for details.

retriesbodynumber

Number of retry attempts to apply to the restarted workflow invocation. Defaults to 3 if not provided.

Response

cursorstring

A pagination cursor. If not returned, all matching entries have been processed.

workflowRunsobject[]

Usage

Single
const { messages } = await client.dlq.list();const response = await client.dlq.restart(messages[0].dlqId, {  flowControl: {    key: "my-flow-control-key",    parallelism: 10,  },  retries: 3,});
Multiple
const response = await client.dlq.restart(["dlq-12345", "dlq-67890"]);
By filters
let cursor: string | undefined;do {  const result = await client.dlq.restart({    filter: { label: "my-label" },    cursor,  });  cursor = result.cursor;} while (cursor);
All
let cursor: string | undefined;do {  const result = await client.dlq.restart({ all: true, cursor });  cursor = result.cursor;} while (cursor);
Loading search…