Bulk Shopify Product Creation and Inventory Sync from Google Sheets - n8n Workflow

Use this powerful n8n workflow to bulk create new Shopify products, set inventory levels, and manage product details directly from a Google Sheet. Ideal n8n template for data migration.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

E-commerce Managers needing to migrate large product catalogs into Shopify.
Technical users seeking advanced n8n templates for bulk data processing.
Developers who want a reliable n8n workflow for testing and staging store data population.
Anyone looking to leverage the Google Sheets n8n node with Shopify's GraphQL API.

Overview

Manually uploading or updating hundreds of products in Shopify is time-consuming and prone to errors. This specific n8n workflow solves this by providing a robust, automated solution that pulls product specifications, pricing, and initial stock quantities from a structured Google Sheet.

Crucially, this n8n template uses a check-and-create logic: it first checks if a product already exists in Shopify (using the product slug/handle). If the product exists, the n8n node skips it, preventing duplicates. If the product is new, the n8n workflow uses multiple GraphQL requests to create the product, enable inventory tracking, and assign stock to the default location. This is an essential n8n node sequence for efficient product management.

How it Works

This n8n workflow is activated by a manual n8n trigger and executes in several distinct phases:


  1. Initialize & Locate: The flow starts by running a GraphQL query via an n8n node to fetch the default location ID from Shopify. This ID is essential for setting inventory levels later in the n8n workflow.

  2. Data Ingestion: The Google Sheet n8n node reads all product rows from the specified spreadsheet, converting each row into an item for processing.

  3. Batch Processing: The Loop Over Items n8n node processes these items one by one or in small batches.

  4. Duplicate Check: For each product, the Shopify, ProductQuery GraphQL n8n node searches Shopify using the product's slug (handle).

  5. Conditional Logic: The If product exists n8n node evaluates the query results. If the product exists, the item loops back to the beginning to process the next row. If the product does not exist, the creation process begins.

  6. Product Creation: The Shopify, CreateProduct GraphQL n8n node creates the new product, mapping fields like title, description, vendor, and status from the Google Sheet data.

  7. Inventory Setup (Tracking): The Shopify, Enable InventoryTracking GraphQL n8n node updates the newly created inventory item to ensure it is tracked.

  8. Inventory Setup (Quantity): Finally, the Shopify, Set InventoryLevel GraphQL n8n node uses the previously stored location ID and the stockonhand value from the Google Sheet to set the initial inventory level for the new product. The flow then repeats for the next item.

Installation Guide

To deploy this n8n workflow, follow these steps:


  1. Import: Copy the JSON data and import it directly into your n8n instance using the 'New' button and selecting 'Import from JSON'.

  2. Google Sheets Credentials: Configure the Google Sheet, Fetch Products n8n node by setting up your Google Sheets OAuth2 API credentials and specifying the correct Document ID and Sheet Name containing your product data.

  3. Shopify API Credentials: You will need Shopify GraphQL Header Authentication credentials. This typically involves using a Custom App in Shopify with access to read/write products, inventory, and locations.

  4. Update Endpoints: Crucially, you must replace the placeholder store URL (https://store99563.myshopify.com/admin/api/2025-04/graphql.json) in all four GraphQL n8n node blocks with your actual Shopify store's admin API endpoint.

  5. Run: Execute the n8n trigger manually to start the bulk creation process.

Node Details

This n8n workflow leverages several specialized n8n nodes for e-commerce data handling:

Start Workflow (n8n trigger): A manual n8n trigger used to initiate the workflow on demand.

Shopify, GetLocations (GraphQL n8n node): Function: Fetches the primary Shopify location ID. Key Configuration: Uses a GraphQL query to retrieve locations(first:1, reverse:true), storing the ID for later inventory assignment.

Google Sheet, Fetch Products (Google Sheets n8n node): Function: Retrieves all rows of product data. Key Configuration: Configured to read the entire 'Products' sheet from the specified Google Sheet document.

Loop Over Items (Split In Batches n8n node): Function: Ensures each product row is processed sequentially, which is critical for API stability and dependency chaining (creating a product before setting its inventory).

Shopify, ProductQuery (GraphQL n8n node): Function: Checks for product existence. Key Configuration: Uses the handle variable, dynamically pulled from the Google Sheet's slug column ({{ $json.slug }}).

If product exists (If n8n node): Function: Directs the flow based on the existence check. Key Configuration: Checks if data.productByHandle exists in the previous n8n node output.

Shopify, CreateProduct (GraphQL n8n node): Function: Performs the product creation mutation. Key Configuration: Variables are mapped directly from the Google Sheet data, including title, descriptionHtml, vendor, productType, status, and handle.

Shopify, Enable InventoryTracking (GraphQL n8n node): Function: Sets the newly created inventory item to be tracked. Key Configuration: Targets the inventoryItem.id retrieved from the productCreate response.


  • Shopify, Set InventoryLevel (GraphQL n8n node): Function: Assigns the stock quantity. Key Configuration: Maps the inventoryItemId (from the prior step), the locationId (from the initial Shopify, GetLocations n8n node), and the quantity (from the Google Sheet stockonhand column).

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by
Richard Uren
Richard Uren

Featured*