Description
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
- Shopify GraphQL Query → Shopify GraphQL Documentation
- Shopify Bulk Query → Shopify Bulk Query Documentation
- Shopify Bulk Mutation → Shopify Bulk Mutation Documentation
Credentials
This node uses the same credentials as the built-in Shopify integration in n8n.
To set them up, follow the instructions here:
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:
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:
- Preparing a .jsonl input file
- Uploading it to Shopify
- Executing the mutation referencing the uploaded file
- 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
- Bulk Query: Fetch all products and variants
- Transformation: Increase stock quantity by 1
- 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.
- Fetching Products:
- Updating Products: