Hourly Amazon SQS queue metrics logged to Google Sheets

Every hour, log queue backlog and dead-letter growth from Amazon SQS into a Google Sheet so your team can chart trends and spot regressions.

Deterministic Code
Amazon SQSGoogle SheetsOperationsEngineeringData Sync
PromptCreate

Every hour, pull queue depth metrics from Amazon SQS and append one row per queue to a Google Sheet so the team can chart backlog and dead-letter growth over time without setting up CloudWatch alarms.

Trigger: cron on an hourly schedule. Make the cron expression a workflow input so anyone can dial it up or down (every 15 minutes, every 6 hours) without editing code.

Inputs (all configurable): a Google Sheets spreadsheet ID, a sheet/tab name (default "sqs-metrics"), and how to select queues — either an explicit list of queue URLs, or a name prefix used to discover queues. Support both modes: if the queue-URL list is non-empty use it verbatim; otherwise call Amazon SQS ListQueues with the configured QueueNamePrefix to discover queues in the connected region. When neither is set, fall back to ListQueues with no prefix so every queue in the region is logged.

For each queue URL, call Amazon SQS GetQueueAttributes and request these four attribute names: ApproximateNumberOfMessages, ApproximateNumberOfMessagesNotVisible, ApproximateNumberOfMessagesDelayed, and ApproximateAgeOfOldestMessage. Derive the queue name as the last path segment of the QueueUrl so the sheet stays human-readable.

Once all queues are collected, append rows to the Google Sheet in a single Google Sheets Append Values call (one row per queue, batched into the same request). Use valueInputOption USER_ENTERED and target the range <sheetName>!A:F. Columns, in order: timestamp (ISO 8601 UTC of when the run started, same value for every row in this run), queue name, visible (ApproximateNumberOfMessages as an integer), in flight (ApproximateNumberOfMessagesNotVisible as an integer), delayed (ApproximateNumberOfMessagesDelayed as an integer), oldest age seconds (ApproximateAgeOfOldestMessage as an integer).

Header row: on the first run against an empty sheet, prepend a header row with the six column names above so the resulting sheet is chart-ready. On subsequent runs, do not touch existing rows — Append Values naturally lands after the last populated row of the detected table.

Error handling: if GetQueueAttributes fails for a single queue (for example the queue was deleted between ListQueues and the read), log a warning and skip that queue rather than aborting the run; still append rows for the queues that succeeded. If Amazon SQS returns RequestThrottled, retry that single queue with exponential backoff (start around 1s, cap around 30s). If the Google Sheets append returns 429, retry the append with exponential backoff. Any other failure should end the run so it surfaces in the workflow history.

Output: a rolling time series in Google Sheets that the team can chart directly (line chart of visible vs in flight per queue, or a filter view for a single queue name) to spot backlog regressions and dead-letter growth by eye. No alerting is in scope — the goal is trend visibility.

What does this prompt do?

  • Every hour, reads the current queue depth for each of your Amazon SQS queues — visible messages, in-flight messages, delayed messages, and how old the oldest message is.
  • Appends one row per queue to a Google Sheet you already own, with a shared timestamp so every hour lines up as a single data point.
  • Discovers queues automatically by name prefix, or reads a fixed list you provide, so new queues start being tracked without code changes.
  • Gives your team a chartable time series they can use to eyeball backlog trends and dead-letter growth without setting up dashboards or alarms.

What do I need to use this?

  • An AWS account with Amazon SQS queues you want to track, and read access to those queues.
  • A Google account and a Google Sheet where the metrics should land — you'll paste the spreadsheet link into the workflow.
  • A rough idea of which queues to include (an explicit list, a shared name prefix, or all queues in the region).

How can I customize it?

  • Change the schedule from hourly to every 15 minutes, every 6 hours, or once a day.
  • Point at a specific set of queues by pasting queue URLs, or use a name prefix (like "prod-") to auto-discover them.
  • Rename the sheet tab, or split production and staging into separate tabs by cloning the workflow with different inputs.

FAQs

Do I need CloudWatch or a paid monitoring tool for this?
No. This workflow reads the same queue depth numbers your team looks at in the AWS console and writes them straight into a Google Sheet. You get a chartable history without turning on CloudWatch metrics or paying for an APM tool.
What if I add a new queue later?
If you're using name-prefix discovery (for example "prod-"), any new queue matching that prefix starts being logged on the next hourly run — no edits needed. If you're passing an explicit list of queue URLs, add the new queue's URL to the list.
Will this slow down my queues or cost extra?
No. Reading queue attributes is a lightweight metadata call, not a message read, and Amazon SQS charges very little per request. Once an hour across even a few dozen queues is negligible on both counts.
Can I chart the data automatically?
Yes. Because every row shares a timestamp column plus per-queue metrics, you can build a line chart in Google Sheets in a few clicks, or filter to a single queue and chart that. The workflow only appends rows — you own the chart.
Does this work with FIFO queues?
Yes. FIFO and standard queues both expose the same message-count attributes this workflow reads, so both types are logged the same way.

Related templates

Call overdue Xero customers with an AI collections agent

Every weekday at 10am, an AI voice agent phones your most overdue Xero accounts, logs what each customer promised, and reports back to finance in Slack.

LiveKit
Xero
Deepgram
+2
Agentic Task
Local listing health board for every location you manage

See every Google Maps listing you manage on one screen, ranked worst first, with an audit button that writes the fix list for you.

Local Business Data
Google Sheets
App
Let support send one-off Loops emails without an engineer

Your team picks a template, finds the customer, checks they are safe to email, then sends it, with every send logged where the whole team can see it.

Loops.so
Stripe
Google Sheets
App
Stop cold emails to anyone with a live deal in Pipedrive

Every night at 2am, pull the contacts on your open and won deals and block them from your cold outreach before the next send goes out.

Mailshake
Pipedrive
Google Sheets
Deterministic Code
iMessage campaign console with pre-flight checks and delivery board

Build every text campaign in one screen: check who is actually reachable, see a realistic send plan, then watch delivery land row by row.

LoopMessage
Google Sheets
HubSpot
App
LinkedIn Ads budget pacing dashboard for every client account

See every LinkedIn ad account's spend against the budget you committed to, catch overspend early, and rebalance without rebuilding a spreadsheet.

LinkedIn Ads
Google Sheets
Slack Bot
App

Watch your queue backlogs without touching CloudWatch.

Get an hourly, chartable record of every Amazon SQS queue directly in Google Sheets and catch backlog regressions before they page you.