Expose Google Sheet KPIs as Prometheus metrics for Grafana
Ready for 3.0Ready 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.
- Set Exporter Config (Edit Fields (Set)): sets 7 fields: sheet_id, sheet_tab, cache_ttl_seconds…
- Read Metrics Cache (Code): runs custom JavaScript code
- Check Cache Freshness (If): checks a condition and branches into true / false
- Add Exporter Self Metrics (Code): runs custom JavaScript code
- Read Metrics Sheet (Google Sheets): uses Google Sheets
- Return Metrics Text (Respond to Webhook): sends the response back to the webhook caller
- Validate Metric Rows (Code): runs custom JavaScript code
- Flag Sheet Read Failure (Edit Fields (Set)): sets 4 fields: degraded, error_message, cached_body…
- Build Exposition Text (Code): runs custom JavaScript code
- Save Metrics Cache (Code): runs custom JavaScript code
Services it uses
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)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Google Sheets
n8n-nodes-base.googleSheets - Respond to Webhook
n8n-nodes-base.respondToWebhook
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.…