Automate XML Data Import to Google Sheets with n8n

Save hours of manual data entry by automating the import of XML data into Google Sheets using this n8n workflow. It fetches XML from a URL, parses it, and organizes it into a new spreadsheet seamlessly.
httpRequest
googleSheets
xml
+5
Workflow Identifier: 1831
NODES in Use: Manual Trigger, Sticky Note, HTTP Request, XML, Google Sheets, Set, Item Lists, Merge
Automate XML to Google Sheets with n8n

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Workflow Does

This workflow takes an XML food menu from a website and loads it into Google Sheets without any manual work.

It solves the problem of copying XML data by hand, which wastes time and causes mistakes.

The result is a new Google Sheet with all the food items neatly listed and labeled.


Who Should Use This Workflow

Anyone who gets food menu or similar XML data and wants to save hours entering data into sheets.

No need to know how to code because n8n does all steps automatically.


Tools and Services Used

  • HTTP Request node: Downloads the XML file from a web address.
  • XML node: Turns XML into JSON format to work with.
  • Item Lists node: Extracts items from the nested JSON array.
  • Google Sheets nodes: Create new spreadsheet, write headers, and add data rows.
  • Set node: Builds the header row from keys in the JSON data.
  • Merge node: Makes sure the sheet is ready before adding rows.

How This Workflow Works

Inputs

The starting input is a manual trigger inside n8n.

The workflow fetches XML data from a web URL (https://www.w3schools.com/xml/simple.xml by default).

Processing Steps

First, it downloads the XML file using the HTTP Request node.

Then the XML node changes the XML data into JSON to make it easier to handle.

Next, the Item Lists node pulls out each food item in the list from the JSON path breakfast_menu.food.

The Google Sheets node makes a new spreadsheet called “My XML Data.

The Set node builds a header row from the keys of the first food item.

The Google Sheets node writes this header row into the new sheet.

The Merge node waits until the spreadsheet is ready.

Finally, the last Google Sheets node adds each food item as a row below the header.

Output

The output is a fully created Google Sheets spreadsheet with correctly labeled columns.

Each food item from the XML is shown in its own row for easy reading and analysis.


Beginner Step-by-Step: How to Use This Workflow in n8n

Import the Workflow

  1. Download the workflow file using the Download button on this page.
  2. Open the n8n Editor where workflows are managed.
  3. Choose “Import from File” and select the downloaded workflow to load it into n8n.

Configure the Workflow

  1. Add your Google Sheets OAuth2 credentials to n8n if not set up already.
  2. Check the HTTP Request node and change the XML URL if you want other XML data.
  3. If needed, adjust paths or spreadsheet titles in the nodes to match your data.

Test and Activate

  1. Run the workflow manually by clicking “Execute Workflow” inside n8n.
  2. Look at each node’s output to make sure the data is correct.
  3. After successful tests, turn on the workflow to use it in production.
  4. For automatic runs, replace the manual trigger with a scheduling node like Cron.

If running self-host n8n, visit self-host n8n for setup help.


Inputs and Outputs Explained

  • Input: Manual start triggers workflow. XML URL provides raw data.
  • Processing: XML converted to JSON, items extracted, spreadsheet created, headers set, rows appended.
  • Output: New Google Sheets spreadsheet with header row and all XML food items as data rows.

Edge Cases and Common Failures

  • Wrong XML URL may cause “Empty or missing XML response” error.
  • Invalid XML format can break parsing in the XML node.
  • Incorrect JSON path in Item Lists node leads to missing data rows.
  • Missing or expired Google Sheets API credentials stop sheet creation or data writing.
  • Wrong spreadsheet ID or file permissions cause failures when writing data.
  • Improper Merge node settings may cause timing issues during the workflow.

Customization Ideas

  • Change XML URL in HTTP Request node to import data from different sources.
  • Modify the JSON path in the Item Lists node to suit other XML structures.
  • Edit the spreadsheet title in the Google Sheets node that creates the sheet.
  • Add filtering nodes like IF or Function node after parsing to limit or filter the food items.
  • Use an existing spreadsheet by skipping the creation node and providing its ID instead.

Summary of Benefits and Results

✓ Automates XML data import into Google Sheets to save time and reduce errors.

✓ Creates a new spreadsheet with dynamic headers that match XML data keys.

✓ Outputs clear rows of data ready for analysis without manual edits.

→ Faster monthly reporting and better accuracy.

→ More time for useful tasks instead of copying and pasting.


Automate XML to Google Sheets with n8n

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Update the URL parameter in the HTTP Request node named “Download XML File” to the new XML data source.
Failures happen if Google Sheets API credentials are missing, expired, or if the spreadsheet ID is incorrect.
Replace the Manual Trigger node with a Cron node to run the workflow on a defined schedule.
Check if the downloaded XML is valid and well-formed. Invalid XML can cause parsing failures.
Author
Written By
Ritu Sanjali

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.