n8n

How to Automate Shopify to Discord Stock Alerts?

Keep your store team updated the moment products run low or sell out. The setup listens to inventory changes from Shopify and posts clear alerts in Discord with the product name, image, and quantity. It fits ecommerce teams that want faster restock action and fewer missed orders.

An incoming webhook from Shopify starts the flow. A code step reads the available quantity and the inventory item id, then marks items as low stock or sold out based on a simple threshold you can edit. Two checks split the path. Each path calls the Shopify GraphQL API to pull variant details, title, image, and current quantity. The data is sent to Discord using rich embed messages, with one channel for low stock and another channel for sold out, so the right people see the right alerts.

Setup needs a Shopify admin API token and a Discord bot that can post to your channels. Point Shopify’s Inventory Level Update event to the n8n webhook URL, replace the store domain in the GraphQL endpoint, and confirm the inventory item id field matches your payload. Expect near instant alerts, less manual checking, and fewer oversell risks, especially for fast moving or limited drop items.

What are the key features?

  • Shopify webhook listener triggers on inventory level updates
  • Code step reads available quantity and inventory item id and sets low stock or sold out flags
  • Two condition checks route low stock and sold out into separate paths
  • GraphQL requests pull product title, variant, quantity, and image from Shopify
  • HTTP requests post Discord embeds with product details and color coded messages
  • Uses two Discord channels to separate urgency
  • Low stock threshold is easy to change in the code

What are the benefits?

  • Reduce manual stock checks from 60 minutes per day to 5 minutes
  • Cut alert time to under one minute after a change
  • Automate 100 percent of stock monitoring
  • Connect Shopify and Discord so teams act fast
  • Lower oversell risk by catching sold out events immediately

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Shopify and Discord. See the Tools Required section above for links to create accounts with these services.
  3. Open the Webhook node in n8n and copy the Production URL. You will paste this URL into Shopify for the Inventory Level Update event.
  4. In your Shopify admin, create a custom app and generate an Admin API access token with read products and read inventory scopes. Save the token in a secure place.
  5. In n8n, open each Shopify GraphQL node, click Create new credential in the Credential to connect with dropdown, choose a header or API key style, and add the X Shopify Access Token header with your token. Replace the store domain in the endpoint with your store’s myshopify domain.
  6. Double check the GraphQL query uses the correct inventory item id variable. If you see inventory_tem, change it to inventory_item to match your data field.
  7. Open the Code node and confirm it reads available and inventory_item_id from the incoming body. Adjust the low stock threshold if you want a different number.
  8. Create a Discord bot in the Discord Developer Portal, copy the bot token, and invite the bot to your server with permission to send messages.
  9. In n8n, open each HTTP Request node, click Create new credential, choose Discord Bot API, and paste the bot token. Set the request URL to the Discord channel messages endpoint for the correct channel and keep the JSON embed body as provided.
  10. In Shopify, add a webhook for the Inventory Level Update event and paste the n8n Webhook Production URL. Save and send a test notification from Shopify to confirm the webhook works.
  11. Run a low stock test by sending a sample payload with available set to 2 and confirm the low stock Discord channel receives an embed with the image and quantity. Repeat with available set to 0 to validate the sold out path and channel.
  12. If messages do not appear, verify the Shopify domain and API version in the GraphQL nodes, check the bot permissions and channel id, match payload field names in the Code node, and ensure the webhook event is the Inventory Level Update type.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Discord

Sign up

Free: $0 / mo (no API usage fees; standard rate limits apply)

Shopify

Sign up

Starter plan: $5 / mo

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.