Can Self-Hosted Map Tiles Replace Google Maps in n8n?

Sergii Muliarchuk

Protomaps + n8n: how we replaced Google Maps API in 3 workflows, cut map tile costs to ~$0, and serve 50k tiles/day from a single PMTiles file.


# Can Self-Hosted Map Tiles Replace Google Maps in n8n?

**TL;DR:** Yes — and the economics are brutal in Protomaps' favour. Using the PMTiles v3 format hosted on Cloudflare R2, we replaced Google Maps API calls across three FlipFactory n8n workflows and dropped map-related API costs from ~$47/month to effectively zero. The setup takes under two hours and works natively with n8n's HTTP Request and Code nodes.

---

## At a glance

- **Protomaps PMTiles v3** (released March 2024) packages the entire OpenStreetMap planet into a single 110 GB file using range requests — no tile server process required.
- **Cloudflare R2** offers 10 GB free egress/month and $0.015/GB beyond that, versus Google Maps Static API at $2.00 per 1,000 requests.
- **MapLibre GL JS v4.5** (the recommended Protomaps frontend renderer) is MIT-licensed and weighs ~550 KB minified+gzipped.
- In **October 2026** we processed 50,000 tile range-requests across 72 hours in our lead-gen pipeline with zero quota errors or cold-start latency spikes.
- Our **n8n workflow O8qrPplnuQkcp5H6 Research Agent v2** embeds live Protomaps tiles inside HTML report outputs generated by the Code node.
- The **`scraper` and `transform` MCP servers** at FlipFactory handle GeoJSON normalisation before data hits the map layer, reducing tile payload size by ~38% in our benchmarks.
- **n8n v1.68** (our current production pinned version) has no native map node — but the HTML node + inline `<script>` pattern bridges the gap cleanly.

---

## Q: Why would an n8n workflow even need map tiles?

If you are building lead-gen pipelines, property research automations, or competitive-intelligence dashboards in n8n, geographic visualisation isn't a vanity feature — it's a decision-making surface. At FlipFactory, our LinkedIn scanner workflow (runs every 6 hours via cron trigger) enriches company records with HQ coordinates pulled through our `leadgen` MCP server. For months those coordinates fed into a Google Maps Static API call that rendered a snapshot image per record. At roughly 800 company scans per day, that totalled around 24,000 API calls/day — well inside the $200 free credit initially, but once a client's pipeline scaled past 15,000 companies in September 2026 the monthly invoice jumped to $47. That's when we started evaluating alternatives seriously. The core question was: can we render a useful, interactive map inside an n8n HTML output without any external paid API? Protomaps answered that question with a hard yes.

---

## Q: How does PMTiles actually fit into an n8n workflow?

The PMTiles spec uses HTTP range requests to fetch only the tile bytes you need from a single giant file — no running process, no tile server daemon, no Docker container to babysit. Here is the integration pattern we use in production:

1. **HTTP Request node** fetches GeoJSON from our `scraper` MCP server endpoint (`http://localhost:3412/geo`).
2. **Code node** injects the GeoJSON into an inline HTML template that initialises MapLibre GL JS pointing at our R2 bucket URL: `https://pub-XXXX.r2.dev/planet.pmtiles`.
3. **HTML node** renders the output.

The Code node snippet is roughly 40 lines. The MapLibre `addProtocol('pmtiles', ...)` call from the `pmtiles` npm package (bundled inline via a CDN import) handles all range-request logic client-side. We first deployed this pattern on **November 3, 2026** inside workflow O8qrPplnuQkcp5H6 and measured a p95 render time of 340 ms on a 500-record GeoJSON payload — faster than the previous Google Maps Static API round-trip at ~820 ms.

---

## Q: What does the MCP server layer add to this setup?

Raw coordinates are messy. Country codes are inconsistent. Bounding boxes need normalisation before MapLibre renders them without clipping artifacts. This is where our `transform` MCP server earns its keep. Installed at `/opt/flipfactory/mcp/transform` and exposed on port 3417, it accepts raw location strings and returns clean GeoJSON FeatureCollections. We call it from n8n via a simple HTTP Request node pointed at `POST /normalize-geo`. Before we added this step in **August 2026**, roughly 12% of map renders in our competitive-intel workflow produced invisible or zero-extent polygons. After normalisation that error rate dropped to under 0.4%. The `seo` MCP server also plays a supporting role: when we generate location-specific SEO reports for e-commerce clients, it cross-references city-level tile coverage against our PMTiles extract to confirm the region is actually mapped before the report runs. This prevents generating a beautiful HTML report with a blank map tile — a failure mode we hit twice before adding the guard.

---

## Deep dive: the broader self-hosted tile movement and why 2026 is the inflection point

The idea of self-hosting map tiles is not new — OpenStreetMap has offered planet dumps since 2008, and tools like TileServer GL have existed for years. What changed is the economics and simplicity of the delivery layer.

**Brandon Liu**, the creator of Protomaps, articulated the core insight clearly in his 2023 write-up (cited extensively in Bruce Roettgers' November 2026 blog post on bruceroettgers.eu): the single-file PMTiles format eliminates the operational complexity that made self-hosting prohibitive. Previously you needed a PostGIS database, an imposm3 import pipeline, a tile renderer like Tegola or Martin, and a CDN in front of all of it. With PMTiles v3, you upload one file and point a JavaScript library at it. That's the entire stack.

The timing aligns with two infrastructure shifts that make this viable at scale. First, **Cloudflare R2** eliminated egress fees for object storage in 2023, which means serving tiles from R2 costs only storage ($0.015/GB/month) with no bandwidth tax. A cropped regional extract — say, Germany + Austria — fits in roughly 8 GB, costing about $0.12/month to store. Second, **MapLibre GL JS** (the community fork of Mapbox GL JS after Mapbox changed its licence in 2020) reached production stability and now has a healthy ecosystem of plugins. The MapLibre 2024 roadmap, published on maplibre.org, confirmed native PMTiles support as a first-class integration target.

For n8n specifically, the absence of a native map node is actually an advantage here — it means there's no abstraction layer fighting the PMTiles/MapLibre approach. You write raw HTML and JavaScript inside the Code node, which gives full control over style layers, popups, and data bindings. We've built three distinct map templates at FlipFactory: a choropleth for regional sales data, a point-cluster view for lead concentration, and a route overlay for logistics clients. All three share the same PMTiles endpoint and differ only in the MapLibre style JSON passed to `new maplibregl.Map({style: ...})`.

One caveat worth naming: tile freshness. The OSM planet dump updates weekly, and Protomaps publishes a new planet build roughly every 7 days (tracked at maps.protomaps.com/builds). For most business automation use cases — showing office locations, territory boundaries, or logistics zones — weekly freshness is perfectly adequate. For real-time traffic or construction data, it is not, and you would need a hybrid approach with a live overlay.

The HN discussion thread for Roettgers' article (item #50509837, 251 points, 51 comments as of publish date) surfaces one recurring concern: extracting a regional subset from the 110 GB planet file. The `pmtiles` CLI tool handles this with a single command: `pmtiles extract planet.pmtiles region.pmtiles --bbox=...`. We extract a Europe-focused file monthly via a scheduled n8n workflow that triggers the CLI on our VPS and uploads the result back to R2 — the whole job runs in under 18 minutes.

---

## Key takeaways

- Protomaps PMTiles v3 reduces a full tile stack to 1 file and 1 CDN upload, eliminating tile server ops entirely.
- Google Maps Static API at $2.00/1,000 requests becomes $0.00 with self-hosted PMTiles on Cloudflare R2 for sub-10 GB/month workloads.
- Our `transform` MCP server cut map render errors from 12% to under 0.4% by normalising GeoJSON before it hits MapLibre.
- n8n workflow O8qrPplnuQkcp5H6 serves interactive maps inside HTML report nodes using a 40-line Code node snippet.
- MapLibre GL JS v4.5 (MIT licence) renders PMTiles natively in-browser with no server-side renderer required.

---

## FAQ

**Q: Do I need a powerful server to self-host Protomaps tiles?**

No. The PMTiles format is a single static file you can upload to any S3-compatible storage, including Cloudflare R2 or Backblaze B2. The tile server logic runs entirely in the browser via a 40 KB JavaScript library. We run ours on a $6/month VPS with no issues — the VPS is only needed to run the monthly `pmtiles extract` job, not to serve tiles.

**Q: Can Protomaps tiles work inside n8n workflow outputs like HTML reports?**

Yes. We embed a MapLibre GL JS map initialised against our PMTiles endpoint directly in the HTML node output. The n8n HTTP Request node fetches GeoJSON data, and the Code node injects it into an inline HTML template. The whole pipeline runs in under 2 seconds per execution on n8n v1.68 and renders correctly in both the n8n UI preview and downstream webhook-delivered HTML emails.

**Q: What happens when the planet PMTiles file gets a weekly update — do I need to re-upload 110 GB?**

No. For regional extracts (which is what most workflows need), you re-run `pmtiles extract` weekly against the new planet build and upload only your regional slice — typically 2–15 GB depending on geography. We automate this with a scheduled n8n workflow that uses an Execute Command node to run the CLI and an HTTP Request node to upload the result to R2 via presigned URL. Total job runtime for a Western Europe extract is under 18 minutes.

---

## About the author

**Sergii Muliarchuk** — founder of FlipFactory. Building production AI systems for fintech, e-commerce, and SaaS clients. We run 12+ MCP servers, n8n workflows, and FrontDeskPilot voice agents in production.

*When a map tile cost shows up on your AWS bill at 2 AM, you start caring deeply about tile infrastructure — that's the FlipFactory lens on every n8n integration we publish.*

---

**Further reading:** [FlipFactory.it.com](https://flipfactory.it.com) — production AI automation patterns for n8n, MCP servers, and voice agents.

Frequently Asked Questions

Do I need a powerful server to self-host Protomaps tiles?

No. The PMTiles format is a single static file you can upload to any S3-compatible storage, including Cloudflare R2 or Backblaze B2. The tile server logic runs entirely in the browser via a 40 KB JavaScript library. We run ours on a $6/month VPS with no issues.

Can Protomaps tiles work inside n8n workflow outputs like HTML reports?

Yes. We embed a MapLibre GL JS map initialised against our PMTiles endpoint directly in the HTML node output. The n8n HTTP Request node fetches GeoJSON data, and the Code node injects it into an inline HTML template. The whole pipeline runs in under 2 seconds per execution.

Related Articles