Weekly SQS dead-letter queue triage into Linear
Every Monday morning, peek at your dead-letter queue, cluster failures by root cause, and file grouped Linear issues so engineering starts the week with a clear backlog.
Every Monday at 9am (user-configurable), triage our Amazon SQS dead-letter queue and file grouped Linear issues so the engineering team starts the week with a clear failure backlog. This is a peek pattern only: nothing gets deleted from SQS, because operators still need to be able to redrive.
Trigger: cron, weekly, Monday 9am, in the user's local timezone. Let the operator change the schedule when they configure the workflow.
Step 1 — Sample the dead-letter queue. Call Amazon SQS Receive Message against the configured DLQ URL with MaxNumberOfMessages set to 10, WaitTimeSeconds set high enough for long polling (up to 20), and VisibilityTimeout kept short (a few seconds) so messages become visible again quickly and stay available for redrive. Repeat the call for a handful of pages (roughly 5 to 10) to build a representative sample. Do NOT call DeleteMessage. Do NOT call ChangeMessageVisibility to hold messages longer. If the queue is empty across the sample, exit cleanly with a note that there was nothing to triage this week.
Step 2 — Parse and cluster. For each message returned, parse the message body (typically JSON, but be resilient to plain text). Cluster the sample by root cause signal: normalized error type or exception class, failing endpoint or handler name, the top frame of any stack trace, and repeating entity id patterns (for example the same customer id or job id showing up across many messages). Prefer clustering by the strongest signal and fall back to weaker ones. Keep a count per cluster and a representative sample payload for each.
Step 3 — Check Linear before filing. For each cluster, call Linear Search Issues using the cluster's key signal (error type + endpoint, or a distinctive substring) to find any open issue that already covers this pattern. If a matching open issue exists, skip creation for that cluster and note it in the run summary.
Step 4 — File genuinely new patterns. For each cluster with no existing open issue, call Linear Create Issue in the configured team. Write a readable title (for example: 'DLQ: TimeoutError in POST /invoices/sync — 42 msgs this week'). In the description include: a plain-English summary of the root cause, the count seen this week, the fields that defined the cluster, one representative payload (JSON code block, redact obvious secrets), and a suggested priority based on volume and error type. Map priority to Linear's numeric scale (1 Urgent, 2 High, 3 Normal, 4 Low). Apply a 'dlq-triage' label if the team uses labels.
Output: a short run summary listing clusters found, clusters skipped as duplicates (with existing issue URLs), and Linear issues newly created (with URLs). Never delete or purge SQS messages — the goal is visibility so operators can still call StartMessageMoveTask (redrive) when they are ready.
Additional information
What does this prompt do?
- Reads a sample of failed messages from your Amazon SQS dead-letter queue every Monday at 9am without removing anything, so operators can still redrive.
- Groups messages by root cause signals like error type, endpoint, stack frame, or entity id pattern instead of flooding the team with one issue per message.
- Checks Linear for an existing open issue on each cluster before filing anything new, so the same failure pattern does not get logged twice.
- Creates a Linear issue per genuinely new pattern with a sample payload, this week's count, and a suggested priority so engineers can pick up the biggest problems first.
What do I need to use this?
- An AWS account with access to the dead-letter queue you want to triage and permission to read messages from it.
- A Linear workspace where the workflow can search existing issues and create new ones in the team of your choice.
- A rough idea of your priority conventions in Linear so the workflow can suggest sensible severity levels.
How can I customize it?
- Change the schedule if Monday 9am is not right — a Friday afternoon wrap-up or a daily peek both work.
- Point it at a different queue or run several copies, one per service, if you have more than one dead-letter queue to watch.
- Adjust how many pages of messages the workflow samples, or ask it to file issues into a specific Linear team, project, or with a label like triage.
Frequently asked questions
Will this delete or consume my dead-letter queue messages?
What if the same failure is already logged in Linear?
How does it decide what counts as one 'root cause'?
Can I run this against more than one dead-letter queue?
What priority does it suggest for new issues?
Related templates
Stop scrolling through raw SQS payloads on Monday morning.
Let this workflow cluster your dead-letter queue and hand engineering a clean, deduped Linear backlog every week.