npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-shopify-graphql

v0.1.10

Published

Shopify GraphQL Node for n8n

Readme

n8n-nodes-shopify-graphql

A custom n8n community node for performing Shopify GraqhQL Queries and bulk operations directly within your workflows.

With this node, you can manage any Shopify Admin resource — such as products, inventory, metafields, and store settings — through a native, code-free n8n interface.

It also supports Shopify Bulk Operations, allowing you to perform large-scale data operations asynchronously, without worrying about pagination or rate limits.

🎥 Video guide: Check out my YouTube walkthrough explaining the Shopify GraphQL node usage and setup.

n8n is a fair-code licensed workflow automation platform.

Installation

Follow the installation guide in the n8n community nodes documentation.

Operations

Credentials

This node uses the same credentials as the built-in Shopify integration in n8n.

To set them up, follow the instructions here:

👉 Shopify Credential Setup

Once configured, all your Shopify nodes (REST or GraphQL) can share these credentials.

Compatibility

  • Tested with n8n version 1.113+
  • Written in TypeScript
  • Compatible with both cloud and self-hosted n8n instances

Usage

Shopify GraphQL

Shopify provides two APIs to interact with store data:

  1. Admin REST API (Deprecated)
  2. Admin GraqhQL API (Recommended)

The GraphQL API is the recommended choice — it gives access to all store data and new platform features, while the REST API is no longer updated.

You can quickly prototype your queries using the Shopify GraphQL Explorer.

Once you have a working query, copy the GraphQL code into the Shopify GraphQL node in n8n.

Shopify Bulk Query

The standard GraphQL API requires pagination when working with large datasets. For example, you can’t fetch all products or variants in one call.

Additionally, rate-limiting applies to standard queries.

Bulk operations solve this by letting you run large queries asynchronously on Shopify’s servers. Once complete, Shopify provides a download URL to retrieve the results.

This node provides a simple interface to trigger and handle these bulk operations from n8n.

[!NOTE] Fetching 5,000 products using a bulk query took only 7 seconds. The result is returned in JSONL format — which is line-delimited JSON — making it easy to handle large datasets efficiently. You can also enable the Hierarchy option to automatically reconstruct parent–child relationships in the result.

Shopify Bulk Mutation

Bulk Mutations allow you to create or update thousands of resources (e.g., products, inventory items, metafields) with one operation.

These mutations usually involve:

  1. Preparing a .jsonl input file
  2. Uploading it to Shopify
  3. Executing the mutation referencing the uploaded file
  4. Waiting for Shopify to finalize the bulk job

[!NOTE] Example: You can use Shopify’s productSet mutation to create or update products in bulk depending on whether the ID or handle exists.

Advanced Example: Update the Inventory of All Products Using Bulk Query and Mutation

This example demonstrates the full potential of Shopify Bulk Operations in n8n:

Workflow Overview

  1. Bulk Query: Fetch all products and variants
  2. Transformation: Increase stock quantity by 1
  3. Bulk Mutation: Push updated inventory back to Shopify

Total Execution Time: Fetch, transform, and update 5,242 products → ~12 minutes (726 seconds)

Step 1: Fetch All Products (Bulk Query)

When building queries, include __typename fields to maintain parent–child relationships when “hierarchy mode” is enabled in n8n.

query VideoBulkProducts {
  products {
    edges {
      node {
        id
        handle
        title
        totalInventory
        options {
          name
          values
        }
        __typename
        variants {
          edges {
            node {
              id
              title
              inventoryQuantity
              price
              __typename
              selectedOptions {
                name
                value
              }
              metafields {
                edges {
                  node {
                    id
                    key
                    value
                    __typename
                  }
                }
              }
            }
          }
        }
        metafields {
          edges {
            node {
              id
              key
              value
              __typename
            }
          }
        }
      }
    }
  }
}

Step 2: Prepare Bulk Mutation Input

Use the bulk mutation option to generate bulk input data:

Step 3: Execute Bulk Mutation in n8n

Finally, pass the generated .jsonl data into the Shopify Bulk Mutation node and execute the workflow to apply updates.

Expression:

{
  "input": {
    "id": "{{ $json.id }}",
    "productOptions": {{ JSON.stringify($json.options?.map((option) => ({
      "name": option.name,
      "values": option.values.map((value) => ({
        "name": value
      }))
    })))}},
    "variants": {{ JSON.stringify($json.productVariants?.map((variant) => ({
        "optionValues": variant.selectedOptions?.map((option) => ({
          "optionName": option.name,
          "name": option.value
        })),
        "price": variant.price,
        "metafields": variant.metafields?.map((metafield) => ({
          "id": metafield.id,
          "key": metafield.key,
          "value": metafield.value
        })),
        "inventoryItem": {
          "tracked": true
        },
        "inventoryQuantities": [
          {
            "locationId": "gid://shopify/Location/1234567890",
            "name": "available",
            "quantity": variant.inventoryQuantity + 1
          }
        ]
      })))
    }}
  }
}

Shopify GraphQL Explorer for Prototyping

Before creating the n8n workflow, use the Shopify GraphQL Explorer to test your queries and mutations.

  1. Fetching Products:

n8n-graphql-inventory-query

  1. Updating Products:

n8n-graphql-inventory-mutation

Resources