Automate Shopify to Google Sheets Product Sync with n8n

This n8n workflow automates syncing Shopify product details to Google Sheets, solving manual data entry errors and saving hours. It fetches product info in batches, updates sheets incrementally, and ensures your product catalog is always up-to-date effortlessly.
scheduleTrigger
googleSheets
graphql
+6
Learn how to Build this Workflow with AI:
Workflow Identifier: 1156
NODES in Use: scheduleTrigger, set, googleSheets, if, graphql, code, wait, noOp, stickyNote

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

Visit through Desktop for Best experience

Opening Problem Statement

Meet Sarah, the owner of a growing Shopify store with hundreds of products. Every week, she spends hours manually exporting product listings from Shopify and updating her team’s Google Sheets inventory tracker. With frequent product updates, price changes, and tagging tweaks, this manual process is tedious, error-prone, and wastes precious time Sarah could spend growing her business.

Each manual sync risks mistakes—missed product updates, outdated prices, and inconsistent tags—that confuse her sales and marketing teams. Over a month, this inefficient process costs Sarah approximately 15 hours in labor and leads to multiple miscommunications that affect customer experience.

This exact scenario is where the “Shopify to Google Sheets Product Sync Automation” workflow steps in to save the day with reliable, scheduled, and incremental syncing of product data.

What This Automation Does

When this n8n workflow runs, it seamlessly pulls your Shopify product data and updates a connected Google Sheets document with the latest details. Here’s what happens specifically:

  • Retrieves product titles, tags, descriptions, and prices using Shopify’s GraphQL API efficiently in batches.
  • Stores product data incrementally into Google Sheets so updates build on previous syncs without starting over.
  • Maintains synchronization cursor in Google Sheets to know exactly where to continue fetching next time.
  • Automatically triggers every day at 7:00 AM, keeping your product sheets fresh without manual intervention.
  • Handles large product sets elegantly by paginating through Shopify’s data using cursors and waits between batches.
  • Logs progress and handles edge cases such as first-run initialization and no remaining pages.

This workflow can save you over 10 hours a month by eliminating manual exports and data entry, while improving data accuracy.

Prerequisites ⚙️

  • n8n account (free cloud or self-hosted) 🔌
  • Shopify store with Admin API access and valid API token 🔑
  • Google Sheets account with an accessible spreadsheet 📊
  • Configured credentials in n8n for Shopify GraphQL API and Google Sheets with OAuth2 🔐

Step-by-Step Guide

Step 1: Set up Schedule Trigger node for daily sync

Navigate to the node called “Schedule Trigger”. Set it to trigger the workflow every day at 7:00 AM. This ensures regularly timed imports without manual runs.

You should see a daily interval configured for 7:00 AM. Mistake to avoid: forgetting to set the correct timezone or interval.

Step 2: Define Batch Size with a Set node

Find the “BatchSize” node and set a numeric value of 100. This tells Shopify to send product data in batches of 100 items per request, balancing API efficiency and completeness.

Common error: setting batches too large might hit Shopify limits; too small leads to many API calls and slower sync.

Step 3: Retrieve Last Sync Cursor from Google Sheets

Use the “LastCursor” Google Sheets node to read the last endCursor stored. This cursor enables fetching only new or updated products since last sync.

Check that the sheet and document ID point to your tracker sheet. If the cursor is empty, the workflow initiates an initial product fetch instead.

Step 4: Conditional check if cursor exists with IF node

Locate the “If” node checking if the cursor is empty. If no cursor is found, the workflow triggers the “shopify-initial” node to fetch the first product batch and cursor.

This logic ensures the workflow only fetches incrementally once it’s initialized.

Step 5: Fetch initial product batch with Shopify GraphQL node

The “shopify-initial” node runs a GraphQL query fetching one product and its cursor. This primes the system with a starting point.

Query example extracts title, tags, description, and price. Customize as needed but keep cursor info in results.

Step 6: Write first product data to Google Sheets

Output from “shopify-initial” writes its product details into the sheet using the “writing first product details” Google Sheets node.

This node appends new rows with product title, tags, description, and price, matching by title to avoid duplicates.

Step 7: Run a Code node to merge and manage batch size and cursor

The “Code” node merges data from BatchSize, LastCursor, and initial fetch result to construct the variables for the main paginated fetch.

JavaScript code inside merges JSON from different inputs and sets the Shopify GraphQL query variables like batchsize and endCursor.

let mergedJson = {};

try {
    const batch_size = $("BatchSize").all(0, 0);
    if (batch_size.length > 0 && batch_size[0].json) {
        Object.assign(mergedJson, batch_size[0].json);
    }
} catch (error) {
    console.log("BatchSize data not available");
}

let endCursorFound = false;
try {
    const last_cursor = $("LastCursor").all(0, 0);
    if (last_cursor.length > 0 && last_cursor[0].json) {
        Object.assign(mergedJson, last_cursor[0].json);
        if (last_cursor[0].json.endCursor) {
            mergedJson.endCursor = last_cursor[0].json.endCursor;
            endCursorFound = true;
        }
    }
} catch (error) {
    console.log("LastCursor data not available");
}

if (!endCursorFound) {
    try {
        const shopify_initial = $("shopify-initial").all(0, 0);
        if (shopify_initial.length > 0 && shopify_initial[0].json && shopify_initial[0].json.data && shopify_initial[0].json.data.products && shopify_initial[0].json.data.products.pageInfo) {
            mergedJson.endCursor = shopify_initial[0].json.data.products.pageInfo.endCursor;
        }
    } catch (error) {
        console.log("Shopify data not available");
    }
}

if (Object.keys(mergedJson).length === 0 || mergedJson.hasOwnProperty('error')) {
    return [{ json: { error: "No data available. Ensure relevant nodes have been executed." } }];
}

return [{ json: mergedJson }];

This code ensures the workflow fetches the correct next batch depending on previous runs.

Step 8: Fetch Shopify product batches via Shopify GraphQL node

The “Shopify get products” GraphQL node uses variables set by the Code node to fetch up to 100 products after the cursor. Pagination info is included.

Errors to avoid: Make sure your Shopify API credentials have read access to products.

Step 9: Split batch of products into individual items using Code node

Use the “Split output” Python Code node to iterate through the GraphQL batch results, extracting each product into a separate workflow item.

Sample Python code snippet:

new_output = []
for item in _input.all():
    products = item.json['data']['products']['edges']
    for product in products:
        new_item = {
            "data": {
                "product": product['node']
            }
        }
        new_output.append(new_item)
return new_output

This node allows subsequent Google Sheets nodes to process each product row independently.

Step 10: Append individual product data to Google Sheets

“writing remaning product info to google sheets” node appends each product’s title, tags, description, and price to the sheet, matching by title to avoid duplicates.

Step 11: Check if there is a next page using IF node

“Check if there is next page” node verifies if Shopify has more products to fetch.

If yes, the “Wait1” node pauses the workflow for 10 seconds before continuing to update the cursor and fetch more products, ensuring Shopify API rate limits are respected.

If no, the workflow does nothing further, ending the sync.

Step 12: Update cursor value for next batch fetching

The “Set cursor” node updates the endCursor for the next GraphQL call using the Shopify pageInfo.endCursor.

Then “update Curser” Google Sheets node updates the cursor stored in your Google Sheets tracker for next runs.

Step 13: Handle cursor conditions to keep sync smooth

“Check cursor is not empty” IF node guards against empty cursor states, avoiding errors by ensuring the cursor only updates when a valid value is present.

Customizations ✏️

  • Adjust batch size: Change the number in the “BatchSize” node to fetch more or fewer products per API call based on your Shopify store size and API limits.
  • Expand product details: Modify the GraphQL queries in “shopify-initial” and “Shopify get products” nodes to retrieve additional fields like SKU, inventory levels, or product images.
  • Change sync schedule: In the “Schedule Trigger” node, update the time and frequency (e.g., every hour, every Monday) to better fit your business needs.
  • Switch Google Sheets document or sheet: Update the “documentId” and “sheetName” parameters in Google Sheets nodes to write to a different spreadsheet or sheet tab.
  • Add error handling: Incorporate a Telegram or Slack notification node triggered from the “No Operation” branch when no next page exists or errors occur to get alerts.

Troubleshooting 🔧

Problem: “Shopify get products” node returns authentication errors.
Cause: Invalid or expired Shopify API token.
Solution: Go to credentials in n8n, refresh or recreate Shopify API credentials, ensure proper header authorization setup.

Problem: Google Sheets node fails to append data.
Cause: Incorrect documentId, sheetName, or missing permissions.
Solution: Verify spreadsheet IDs, confirm sharing and OAuth2 permissions in Google Cloud Console for n8n integration.

Problem: Workflow stuck or skipping next page processing.
Cause: Cursor not updating or IF conditions incorrectly configured.
Solution: Check “Set cursor” and “update Curser” nodes are running correctly and ensure proper JSON paths in IF nodes.

Pre-Production Checklist ✅

  • Ensure Shopify API credentials have “read_products” scope enabled.
  • Google Sheets OAuth2 configured with edit permissions to target spreadsheet.
  • Test the initial run to confirm cursor creation and product sync for at least one batch.
  • Verify data formats in Google Sheets match schema (title, description, tags, price).
  • Backup the Google Sheets data before first large sync to avoid accidental overwrites.

Deployment Guide

After building and testing the workflow, simply activate it in n8n. Your automation will trigger daily at 7:00 AM and continue incrementally fetching new or updated products from Shopify.

Monitor execution logs in n8n for failures and review Google Sheets data for correctness. Adjust batch size or wait times if API rate limits cause throttling.

FAQs

Q: Can I use this workflow with multiple Shopify stores?
A: Yes, duplicate the workflow, create new credentials for each store, and update the GraphQL endpoint accordingly.

Q: Does this consume Shopify API credits?
A: Yes, each GraphQL request counts toward your Shopify API call limit, so batch size tuning helps manage usage.

Q: Is my product data secure?
A: Data stays within secured APIs and Google Sheets under your account credentials—ensure your n8n and Google credentials are kept private.

Q: Can I extend this workflow to sync inventory or orders?
A: Absolutely—customize the GraphQL queries and add nodes to handle other Shopify objects.

Conclusion

You’ve just built a powerful automation syncing your Shopify product catalog directly to Google Sheets using n8n, eliminating tedious manual exports. This workflow intelligently fetches product batches, maintains sync state with cursors, and updates your spreadsheet daily to keep your data fresh.

By implementing this, you save approximately 10-15 hours monthly and reduce human errors in your product data management. Next, consider expanding this automation to include inventory tracking, order syncing, or price monitoring integrations.

Keep refining your automation, and your store management will become increasingly streamlined and efficient.

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation in n8n (Beginner Guide)

A complete beginner guide to building an AI-powered SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free