← All posts
How-ToNovember 23, 2026 · 4 min

automate e-commerce order fulfillment n8n

To automate order fulfillment and inventory updates with n8n, start by creating a webhook node that captures new order events from Shopify's REST API. When an order is placed, the webhook triggers a series of nodes: a HTTP Request node fetches the order details in JSON, a Set node extracts line items, and a second HTTP Request node calls your inventory management system's API to decrement stock levels. After the inventory is adjusted, use another HTTP Request node to update the order's fulfillment status in Shopify, then add a Send Email node (or a Slack node) to notify the fulfillment team. By looping this process with a "Wait" or "IF" node you can handle back-order logic, ensuring both sales channels and inventory remain synchronized in real time.

What you need

ToolPlan/PriceRole
n8nFree (self-hosted) or $49/month (cloud)Orchestrator, workflow editor
ShopifyStarter plan $29/moe-commerce platform, API source
ZapierFree tier (limited runs) or paidOptional comparison for reference
Make.comFree tier (limited operations) or paidOptional comparison for reference
https://getaab.com/blog/N/AReference blog for additional n8n examples

How to build it

  1. Set up credentials: In n8n, create a new HTTP Request node named "Shopify Auth". Go to Shopify Admin > Settings > Apps and sales channels > Develop apps. Create a custom app with Admin API access scopes: read_orders, write_orders, read_products, and write_products. Grant the app access to your development store. Copy the Admin API access token. In n8n, add a new Credential of type "Header Auth" or "Basic Auth" (depending on your n8n version) and store this token.
  1. Configure the Webhook Receiver: Add an n8n Webhook node. Set the HTTP Method to POST. Set the Path to shopify_order_webhook. This endpoint listens for incoming events from Shopify. When enabled, n8n generates a unique URL. Copy this URL.
  1. Register the Webhook in Shopify: In Shopify Admin, navigate to the custom app you created. Under "Webhooks," add a new subscription. Set the topic to orders/created. Set the format to JSON. Paste the n8n Webhook URL into the "URL" field. Save. Shopify will now send a signed orders/created event to your n8n instance whenever a customer places an order.
  1. Map and Validate Data: Add an n8n Code node after the Webhook node. This step is critical for filtering noise and normalizing the json payload. Shopify sends the entire order object, which can be over 50KB. Extract only the fields needed for inventory synchronization: order_id, line_items (sku, quantity), and total_price. Use the following snippet to ensure you only act on valid, paid orders:
json
 [
 {
 "json": {
 "order_id": "1234567890",
 "line_items": [
 {
 "sku": "SHIRT-BLUE-M",
 "quantity": 2
 }
 ],
 "financial_status": "paid"
 }
 }
 ]
 

Note: In the actual Code node, you would use `$('Webhook').item.json.body.order` to access the root order object and filter `line_items` where `sku` is not null.

  1. Update Inventory via REST API: Add an n8n HTTP Request node. Set the Method to PUT. Set the URL to https://[your-shop-domain].myshopify.com/admin/api/2024-01/products/[product_id].json. Replace [product_id] with the dynamic value from the previous step. In the Body section, select json and construct the payload to decrease the inventory level. For example: {"product": {"inventory_items": [{"inventory_item_id": "[id]", "quantity": -2}]}}. This action directly updates the inventory management dashboard in Shopify.
  1. Handle Errors and Retry Logic: Add an n8n Error Trigger. If the Shopify API returns a 400-series error (such as insufficient stock), the workflow fails. Connect the Error Trigger to a Slack node to alert your ops team. Do not use silent retries for inventory decrements, as this can lead to overselling. Instead, log the specific sku and order_id that failed.
  1. Bidirectional Sync Considerations: This workflow currently handles orders/created to decrement stock. To make it truly bidirectional, you must handle manual inventory adjustments in Shopify (e.g., if a warehouse worker manually updates stock). Listen for the products/update webhook topic as well. When a product is manually edited, pause the automated decrement logic for that specific SKU for a short window to prevent race conditions.
  1. Testing and Deployment: Use the "Execute Workflow" button in n8n to test with a dummy order. Verify that the inventory count in Shopify Admin decreases by the correct amount. Check the execution details in n8n to ensure the HTTP status code is 200. Once verified, activate the workflow. Unlike zapier or make.com, n8n allows you to inspect the raw json response at every step, which is essential for debugging complex API interactions. For more advanced routing logic, consider reviewing our guide on advanced workflow patterns.

How do I trigger a Shopify webhook from n8n? Add a Webhook node in n8n and copy the generated URL into Shopify's admin under Settings → Notifications → Webhooks. Choose the event (e.g., order/create) and set the format to JSON; n8n will receive the payload whenever the event occurs.

Can n8n update inventory in an external system after a Shopify order? Yes. Use the HTTP Request node to call the external inventory management REST API, mapping Shopify's line_items[*].sku and quantity fields from the webhook JSON. Set the request method to PUT or POST as required by the target API.

Is it possible to sync data back to Shopify from n8n without using Zapier or Make.com? Absolutely. After processing data in n8n, add another HTTP Request node that calls Shopify's Admin API (e.g., POST /admin/api/2024-01/products.json) with an authentication header (X-Shopify-Access-Token). This creates or updates records directly, eliminating the need for Zapier or Make.com.

Get the full toolkit

Grab the free guide with the node-by-node build for all 10 automations.

By subscribing, you agree to receive this guide plus occasional AI Automation Blueprint educational and product emails. Unsubscribe anytime. Privacy policy.