Description
n8n-nodes-shopify-graphql

This is an n8n community node that lets you interact with Shopify’s GraphQL Admin API in your n8n workflows.
Use this node to execute custom GraphQL queries against your Shopify store, retrieve products, orders, and access the full power of Shopify’s Admin API. Perfect for building custom e-commerce automation workflows.
n8n is a fair-code licensed workflow automation platform.
Installation
Operations
Credentials
Compatibility
Usage
Troubleshooting
Resources
Installation
Follow the installation guide in the n8n community nodes documentation.
npm installation
1. Go to Settings > Community Nodes
2. Select Install
3. Enter @cafeasp/n8n-nodes-shopify-graphql in Enter npm package name
4. Agree to the risks of using community nodes
5. Select Install
Manual installation (for local development)
For local n8n installation:
Clone or download this repository
git clone https://github.com/cafeasp/n8n-shopify-graphql.git
cd n8n-shopify-graphqlInstall dependencies
npm installBuild the node
npm run buildLink to n8n (Unix/Mac)
npm link
cd ~/.n8n/nodes
npm link @cafeasp/n8n-nodes-shopify-graphqlLink to n8n (Windows)
npm link
cd %USERPROFILE%.n8nnodes
npm link @cafeasp/n8n-nodes-shopify-graphql
For Docker installations, see the included docker-compose.yml file.
Compatibility
- n8n version: 1.0.0 or higher
- Shopify API: Admin API 2024-10 or higher
- Node.js: 18.x or higher (for development)
- Execute Query: Execute a custom GraphQL query
- Get Collection by Name: Retrieve a collection by name and get all product SKUs in that collection
- Get Product by SKU: Retrieve a product by its variant SKU
- Get Products: Retrieve a list of products from your store (with status filtering, image inclusion, and pagination support)
- Get Orders: Retrieve a list of orders from your store (with pagination support)
- Update Inventory: Update inventory quantities for multiple items in a single API call (max 250 items)
- Shop Name: Your store name (the part before
.myshopify.com) - Access Token: The Admin API access token you just created
- API Version: The API version to use (e.g.,
2024-10)
Operations
This node supports the following operations:
Credentials
You’ll need to create a Shopify Admin API access token:
1. Log into your Shopify admin panel
2. Go to Settings > Apps and sales channels
3. Click Develop apps (you may need to enable this first)
4. Click Create an app
5. Give your app a name and click Create app
6. Go to Configuration and configure your Admin API scopes
7. Click Install app
8. Reveal your Admin API access token and save it
In n8n, configure the credentials with:
Usage
Example 1: Get Shop Information
1. Add the Shopify GraphQL node
2. Select Execute Query operation
3. Enter this query:
{
shop {
name
email
currencyCode
primaryDomain {
url
}
}
}
Example 2: Get Collection by Name
1. Add the Shopify GraphQL node
2. Select Get Collection by Name operation
3. Enter the exact collection name as it appears in Shopify (e.g., Shop All name of your collection)
4. The node will return the collection details with all products and their variant SKUs (up to 250 products)
Use case: Perfect for exporting all SKUs in a specific collection, syncing inventory, or analyzing collection contents.
Note: Use the exact collection title as shown in your Shopify admin under Products > Collections.
Example 3: Get Product by SKU
1. Add the Shopify GraphQL node
2. Select Get Product by SKU operation
3. Enter the SKU (e.g., ABC-123)
4. The node will return the product with all its variants, pricing, inventory, and images
Returned data includes:
Example 4: Get Products with Status Filter
1. Add the Shopify GraphQL node
2. Select Get Products operation
3. Choose status filters: Active, Archived, or Draft (can select multiple)
4. (Optional) Enter Exclude Tags to filter out products with specific tags (e.g., skip, discontinued)
5. (Optional) Enable Include Images to return up to 5 images per product (disabled by default to keep responses lightweight)
6. Choose retrieval mode:
– Return All = OFF: Set a limit (default: 10) to get a specific number of products
– Return All = ON: Automatically fetch all products using pagination (no limit needed)
7. The node will return filtered product details including variants
Returned data includes:
Filtering options:
skip, test will exclude all products tagged with either “skip” or “test”.Note: All product operations (Get Products, Get Product by SKU) return the inventoryItem.id field for each variant, which is required for Shopify’s Inventory API operations.
Example 5: Get All Products with Pagination
1. Add the Shopify GraphQL node
2. Select Get Products operation
3. Enable Return All toggle
4. Optionally filter by status (Active, Archived, Draft)
5. Optionally add Exclude Tags to skip products with specific tags
5. The node will automatically paginate through all results and return ALL products matching your filters
Note: When “Return All” is enabled, the node makes multiple API requests (250 products per request) until all products are retrieved. This is useful for bulk operations or data exports.
Example 6: Custom Query with Variables
1. Add the Shopify GraphQL node
2. Select Execute Query operation
3. Enter a query with variables:
query GetProduct($id: ID!) {
product(id: $id) {
id
title
description
}
}
4. Add variables in JSON format:
{
"id": "gid://shopify/Product/1234567890"
}
Example 7: Update Inventory for Multiple Items
1. Add the Shopify GraphQL node
2. Select Update Inventory operation
3. Enter your Location ID (e.g., gid://shopify/Location/59462222017)
4. Select a Reason for the adjustment (correction, restock, etc.)
5. Enter Inventory Items as a JSON array:
[
{
"inventoryItemId": "gid://shopify/InventoryItem/123456",
"quantity": 100
},
{
"inventoryItemId": "gid://shopify/InventoryItem/789012",
"quantity": 50
},
{
"inventoryItemId": "gid://shopify/InventoryItem/345678",
"quantity": 75
}
]
Use case: Perfect for batch inventory updates from external systems, syncing stock levels, or applying bulk adjustments after physical counts.
Key points:
available and on_hand inventory changesResponse structure:
The operation returns detailed information about what was updated:
inventoryAdjustmentGroup.id – Unique ID for this adjustment batchchanges[] – Array of all inventory changes made – name – Type of inventory (available or on_hand)
– delta – How much the inventory changed (e.g., +50, -10)
– quantityAfterChange – Final quantity (may be null with ignoreCompareQuantity)
– item.id – Inventory item ID that was updated
– item.sku – SKU of the variant (for easy identification)
Troubleshooting
Node doesn’t appear in n8n
1. Make sure you’ve run npm run build before linking or installing
2. Restart n8n after installation
3. Check that the dist folder exists in the package directory
4. For Docker: Verify the volume mount and N8NCUSTOMEXTENSIONS environment variable
Authentication errors
1. Verify your Shop Name doesn’t include .myshopify.com (just the store name)
2. Ensure your access token has the required API scopes
3. Check that your API version is correct (format: YYYY-MM)
4. Test your credentials using the “Test” button in n8n
GraphQL errors
1. Verify your query syntax using Shopify’s GraphQL Explorer
2. Check that you have the required scopes for the data you’re querying
3. Ensure variables are valid JSON format
4. Review Shopify’s rate limits
Common issues
npm install in the package directoryDevelopment
Install dependencies
npm installBuild and watch for changes
npm run devFormat code
npm run formatLint code
npm run lintFix linting issues
npm run lintfix