Icon for n8nIcon for InfluxDB

n8n + InfluxDB: workflow-driven time-series writes

Integrates withCurated

n8n and InfluxDB integrate via InfluxDB's HTTP API. n8n workflows receive events (from MQTT, webhooks, schedule, or REST) and write structured line-protocol data to InfluxDB buckets. This positions n8n as the ETL/routing layer in a manufacturing data pipeline.

How it works

n8n uses the HTTP Request node to call the InfluxDB v2 write API endpoint (POST /api/v2/write). The workflow constructs the InfluxDB line protocol payload (measurement, tags, fields, timestamp) and posts it. For reads, n8n can also query InfluxDB via the Flux query API to fetch aggregated metrics for use in reports or decisions.

Use cases

  • MQTT-to-InfluxDB pipeline — MQTT Trigger → parse payload → HTTP Request to InfluxDB write API → data available in Grafana
  • Enriched writes — before writing, n8n enriches raw sensor data with machine metadata from an ERP or asset database
  • Conditional storage — only write to InfluxDB when a value is anomalous; discard normal readings to reduce storage costs
  • Scheduled aggregations — n8n cron job queries InfluxDB for hourly averages → writes summary to PostgreSQL for reporting

Tradeoffs

  • No native InfluxDB node in n8n — requires HTTP Request node with manual line-protocol formatting; more setup than Node-RED's dedicated InfluxDB nodes
  • For high-frequency writes (thousands/sec), Telegraf is more efficient; n8n is better suited for lower-frequency enriched writes
  • n8n adds a processing hop vs. direct MQTT-to-InfluxDB via Telegraf, but enables richer transformation and multi-destination routing