Cloudflare Domain and DNS Inventory Export to Google Sheets - n8n Workflow

Automate bulk data export from Cloudflare to Google Sheets using this powerful n8n workflow. Capture domain settings, DNS records, and TLD metadata efficiently.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

System Administrators or DevOps teams managing large numbers of Cloudflare domains.
Users seeking a robust inventory management solution for domain assets.
Anyone needing reliable n8n templates for complex API pagination and data transformation.
Technical users who want to centralize Cloudflare configuration data in Google Sheets.

Overview

This professional n8n workflow is designed to solve the complexity of maintaining an up-to-date inventory of Cloudflare domains, DNS records, and zone settings. Managing hundreds of domains across Cloudflare can be challenging; this automation ensures all critical configuration details are consistently captured and exported. Utilizing the power of the n8n node for HTTP requests and JavaScript data manipulation, this solution handles API pagination automatically, fetching data page by page. This specific n8n workflow is highly valuable for audits, migration planning, or simply keeping a central repository of configuration statuses within a searchable Google Sheet, making it one of the most useful n8n templates for infrastructure management.

How it Works


  1. The n8n workflow starts with a Manual Trigger, designed to be executed on demand.

  2. The flow initializes the pagination process using the Set Page n8n node, setting the starting page number for the API call.

  3. The Get TLDs n8n node fetches the first batch of registered zones (domains) from the Cloudflare API, utilizing credentials configured in the n8n instance.

  4. The Each Host n8n node splits the batch, enabling the n8n workflow to process data for each domain individually in parallel.

  5. For each domain, three parallel branches run: one to filter the TLD metadata, one to call the API for DNS records (Get DNS), and one for fetching all Zone Settings (Get Settings). Custom Code n8n nodes are used extensively to clean and focus the JSON payload after each request.

  6. The Merge n8n node combines the TLD data, DNS records, and settings into a single, comprehensive item for that specific domain.

  7. The More Pages? n8n node evaluates the Cloudflare API response's pagination data. If more pages exist, the n8n workflow loops back through Increment Page and Wait (acting as a basic delay mechanism to respect rate limits) before executing the Get TLDs n8n node again, ensuring complete data retrieval.

  8. Once all domains are fetched, the central Flatten n8n node uses custom JavaScript to transform the deeply nested settings into columnar data and aggregates all DNS records into a single, formatted text field, ideal for spreadsheet use.

  9. Finally, the Export Google Sheets n8n node appends this structured, massive data set, column by column, to the designated Google Sheet, completing the extraction process of this complex n8n template.

Installation Guide


  1. Import this n8n workflow JSON into your n8n instance.

  2. Cloudflare Credentials: You must configure HTTP Custom Auth credentials. Provide your Cloudflare API token or key with full access to the zone endpoints, as noted in the sticky note within the n8n node layout.

  3. Google Sheets Credentials: Set up OAuth2 credentials for the Google Sheets n8n node, granting it necessary permissions to write data.

  4. Sheet Preparation: Copy the provided Google Sheet template (link is in the sticky note) and ensure the Document ID and Sheet Name in the Export n8n node match your newly created inventory sheet. The sheet must be prepared with a header row matching the output columns defined in the n8n node.

  5. Save the n8n workflow and execute the When clicking ‘Test workflow’ n8n trigger to start the data synchronization.

Node Details

Manual Trigger (When clicking ‘Test workflow’): Acts as the primary n8n trigger for immediate execution of the n8n workflow.
HTTP Request (Get TLDs, Get DNS, Get Settings): These core n8n nodes interact with the Cloudflare API v4. They handle fetching zone lists, individual DNS records, and all zone settings dynamically using expressions (={{ $json.id }}).
Set/Increment Page: n8n nodes essential for maintaining state during API pagination, ensuring all available domains are fetched by the main Get TLDs n8n node.
Split Out (Each Host): Splits the array of zones returned by Cloudflare, enabling parallel processing of DNS and settings data for each domain.
Code (Filter TLD, Filter DNS, Filter Settings): Custom scripting n8n nodes used for data cleansing and normalization, reducing the payload size and preparing the data structure before the final merge.
Code (Flatten): A critical custom JavaScript n8n node that transforms nested data structures (especially the array of zone settings and DNS records) into a flat key-value format suitable for export to Google Sheets columns. It also formats DNS records into a single string.
Merge: Combines the multiple data streams (TLD metadata, Settings, DNS) back into a unified data item per domain.
If (More Pages?): Controls the complex loop for pagination, determining if the Get TLDs n8n node should run again.


  • Google Sheets (Export): The final n8n node, responsible for appending the structured Cloudflare domain inventory data to the specified Google Sheet.

Related n8n Workflows

Free

Nodes: 10 Nodes
Updated: December 26 2025
View all
Created by

With 15 years on my back, carrying clients' web apps through the storms of bad code, tight deadlines, and ever-changing tech trends, I now do stuff as an AI Automation Engineer, with focus on streamlining backend services, making systems faster, smarter, and more sustainable.

Featured*