The dlq.list
method retrieves messages that were sent to the Dead Letter Queue (DLQ) .
DLQ messages represent failed workflow or QStash deliveries that could not be retried successfully.
Arguments
A pagination cursor from a previous request.
Use this to fetch the next batch of results.
Maximum number of DLQ messages to return.
Defaults to a system-defined limit if not provided.
Filter options for narrowing down DLQ messages Earliest timestamp (Unix ms) to include.
Latest timestamp (Unix ms) to include.
Filter messages that targeted a specific URL.
Filter by HTTP response status code.
Response
An array of DLQ messages that match the provided filters.
A cursor to paginate through additional results.
If not returned, you have reached the end of the DLQ.
Usage
import { Client } from "@upstash/workflow" ;
const client = new Client ({ token: "<QSTASH_TOKEN>" });
// 👇 List all DLQ messages
const { messages , cursor } = await client . dlq . list ({ filter: dlqFilters });
// 👇 List with pagination and filtering
const result = await client . dlq . list ({
cursor ,
count: 10 ,
filter: {
fromDate: Date . now () - 86400000 , // last 24 hours
toDate: Date . now (),
url: "https://your-endpoint.com" ,
responseStatus: 500
}
});