n8n detects sales on Shopify or Amazon, then updates inventory across all platforms and a central Google Sheets tracker.
Prepare n8n Environment
Navigate to http://localhost:5678 (or your n8n hosted URL) and log in with your credentials.
In the sidebar, click “Workflows,” then select “+ New” and name it (e.g., “Campaign Tracker”). Click “+” on the canvas to open the node selector.
Trigger Node: Shopify Webhook
Node: Webhook
Settings:
Path: shopify-sale
Shopify Webhook: “Order Creation” at https://<n8n-host>/webhook/shopify-sale
Output: Sale data (e.g., {{ $json.body.line_items[0].sku }}).
Update Shopify Node: Shopify
Node: Shopify
Settings:
Credentials: Shopify API key
Resource: Inventory
Operation: Update
SKU: {{ $node["Webhook"].json.body.line_items[0].sku }}
Quantity: Decrease by {{ $node["Webhook"].json.body.line_items[0].quantity }}
Output: Shopify stock updated.
Update Amazon Node: HTTP Request
Node: HTTP Request
Settings:
URL: Amazon SP-API endpoint for inventory
Method: PUT
Authentication: Amazon API credentials
Body: { "sku": "{{ $node["Webhook"].json.body.line_items[0].sku }}", "quantity": "-{{ $node["Webhook"].json.body.line_items[0].quantity }}" }
Output: Amazon stock synced.
Log Node: Google Sheets
Node: Google Sheets
Settings:
Operation: Update
Spreadsheet ID: Inventory sheet
Range: A:C
Key: SKU column
Value: New quantity
Output: Centralized stock log.
Ready to transform your business with our technology solutions? Contact Us today to Leverage Our AI/ML Expertise.