Templates / Expose Google Sheet KPIs as Prometheus metrics for Grafana

Expose Google Sheet KPIs as Prometheus metrics for Grafana

Ready for 3.0

by Kevin Yu ✓ · 21 views · created 2026-07-28 · DevOps

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This workflow has 11 nodes and runs when an HTTP GET request hits its webhook URL. Along the way it connects Google Sheets.

How it runs

Trigger: When an HTTP GET request hits its webhook URL.

  1. Set Exporter Config (Edit Fields (Set)): sets 7 fields: sheet_id, sheet_tab, cache_ttl_seconds…
  2. Read Metrics Cache (Code): runs custom JavaScript code
  3. Check Cache Freshness (If): checks a condition and branches into true / false
  4. Add Exporter Self Metrics (Code): runs custom JavaScript code
  5. Read Metrics Sheet (Google Sheets): uses Google Sheets
  6. Return Metrics Text (Respond to Webhook): sends the response back to the webhook caller
  7. Validate Metric Rows (Code): runs custom JavaScript code
  8. Flag Sheet Read Failure (Edit Fields (Set)): sets 4 fields: degraded, error_message, cached_body…
  9. Build Exposition Text (Code): runs custom JavaScript code
  10. Save Metrics Cache (Code): runs custom JavaScript code

Services it uses

Google Sheets

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (6)

From the author

Quick overview This workflow exposes KPI values stored in a Google Sheet as a Prometheus text exposition endpoint via an n8n webhook, so Grafana can scrape and chart them, with caching, validation, and built-in exporter health metrics. How it works 1.…

Excerpt from Kevin Yu's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.