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
Follow the installation guide in the n8n community nodes documentation.
- Go to Settings > Community Nodes
- Select Install
- Enter
@cafeasp/n8n-nodes-shopify-graphqlin Enter npm package name - Agree to the risks of using community nodes
- Select Install
For local n8n installation:
# Clone or download this repository
git clone https://github.com/cafeasp/n8n-shopify-graphql.git
cd n8n-shopify-graphql
# Install dependencies
npm install
# Build the node
npm run build
# Link to n8n (Unix/Mac)
npm link
cd ~/.n8n/nodes
npm link @cafeasp/n8n-nodes-shopify-graphql
# Link to n8n (Windows)
npm link
cd %USERPROFILE%\.n8n\nodes
npm link @cafeasp/n8n-nodes-shopify-graphqlFor Docker installations, see the included docker-compose.yml file.
- n8n version: 1.0.0 or higher
- Shopify API: Admin API 2024-10 or higher
- Node.js: 18.x or higher (for development)
This node supports the following operations:
- 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)
You'll need to create a Shopify Admin API access token:
- Log into your Shopify admin panel
- Go to Settings > Apps and sales channels
- Click Develop apps (you may need to enable this first)
- Click Create an app
- Give your app a name and click Create app
- Go to Configuration and configure your Admin API scopes
- Click Install app
- Reveal your Admin API access token and save it
In n8n, configure the credentials with:
- 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)
- Add the Shopify GraphQL node
- Select Execute Query operation
- Enter this query:
{
shop {
name
email
currencyCode
primaryDomain {
url
}
}
}- Add the Shopify GraphQL node
- Select Get Collection by Name operation
- Enter the exact collection name as it appears in Shopify (e.g.,
Shop All name of your collection) - 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.
- Add the Shopify GraphQL node
- Select Get Product by SKU operation
- Enter the SKU (e.g.,
ABC-123) - The node will return the product with all its variants, pricing, inventory, and images
Returned data includes:
- Product details (title, description, status, handle)
- Variant details (id, title, price, SKU)
- Inventory item IDs for each variant (useful for inventory management APIs)
- Product images
- Add the Shopify GraphQL node
- Select Get Products operation
- Choose status filters: Active, Archived, or Draft (can select multiple)
- (Optional) Enter Exclude Tags to filter out products with specific tags (e.g.,
skip, discontinued) - (Optional) Enable Include Images to return up to 5 images per product (disabled by default to keep responses lightweight)
- 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)
- The node will return filtered product details including variants
Returned data includes:
- Product details (title, description, handle, status, dates)
- Up to 10 variants per product (id, title, price, SKU)
- Inventory item IDs for each variant (for inventory management integrations)
- Product images (id, url, altText) — up to 5 per product, when Include Images is enabled
Filtering options:
- Status: Filter by product status (Active, Archived, Draft)
- Exclude Tags: Comma-separated list of tags to exclude. Products with ANY of these tags will be filtered out. For example, entering
skip, testwill exclude all products tagged with either "skip" or "test". - Include Images: Toggle to include product images in the response. Disabled by default for faster, smaller responses.
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.
- Add the Shopify GraphQL node
- Select Get Products operation
- Enable Return All toggle
- Optionally filter by status (Active, Archived, Draft)
- Optionally add Exclude Tags to skip products with specific tags
- 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.
- Add the Shopify GraphQL node
- Select Execute Query operation
- Enter a query with variables:
query GetProduct($id: ID!) {
product(id: $id) {
id
title
description
}
}- Add variables in JSON format:
{
"id": "gid://shopify/Product/1234567890"
}- Add the Shopify GraphQL node
- Select Update Inventory operation
- Enter your Location ID (e.g.,
gid://shopify/Location/59462222017) - Select a Reason for the adjustment (correction, restock, etc.)
- 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:
- Updates up to 250 items in a single API call
- Sets absolute quantity values (not deltas)
- Returns the adjustment group with delta changes and final quantities
- Returns both
availableandon_handinventory changes - Each change includes the inventory item ID and SKU for easy identification
- Inventory item IDs can be obtained from any "Get Products" or "Get Product by SKU" operation
Response structure: The operation returns detailed information about what was updated:
inventoryAdjustmentGroup.id- Unique ID for this adjustment batchchanges[]- Array of all inventory changes madename- Type of inventory (availableoron_hand)delta- How much the inventory changed (e.g., +50, -10)quantityAfterChange- Final quantity (may be null withignoreCompareQuantity)item.id- Inventory item ID that was updateditem.sku- SKU of the variant (for easy identification)
- Make sure you've run
npm run buildbefore linking or installing - Restart n8n after installation
- Check that the
distfolder exists in the package directory - For Docker: Verify the volume mount and
N8N_CUSTOM_EXTENSIONSenvironment variable
- Verify your Shop Name doesn't include
.myshopify.com(just the store name) - Ensure your access token has the required API scopes
- Check that your API version is correct (format:
YYYY-MM) - Test your credentials using the "Test" button in n8n
- Verify your query syntax using Shopify's GraphQL Explorer
- Check that you have the required scopes for the data you're querying
- Ensure variables are valid JSON format
- Review Shopify's rate limits
- "Cannot find module 'n8n-workflow'": Run
npm installin the package directory - Empty results: Check your store has data and your API version supports the query
- Timeout errors: Reduce the limit parameter or optimize your query
# Install dependencies
npm install
# Build and watch for changes
npm run dev
# Format code
npm run format
# Lint code
npm run lint
# Fix linting issues
npm run lintfix