đ¤ Automate e-commerce orders, inventory & feedback with Slack, Sheets & Gmail
⥠433 views ¡ đ¤ CRM & Sales Operations
Description
How It Works âď¸
This workflow acts as a central nervous system for your e-commerce operations, automating three critical areas:
A. Order Fulfillment Notification
- Webhook: New Order: đ The workflow is instantly triggered when a new order is placed on your e-commerce platform (e.g., Shopify, WooCommerce) via a webhook. This provides real-time data to initiate fulfillment.
- Extract Order Data (Function): đ§š This node parses the incoming JSON data from the new order, extracting crucial details such as Order ID, customer name, email, total amount, products purchased, and shipping address.
- Send Fulfillment Notification (Slack/Email): đ˘ A detailed, formatted notification containing all necessary order information is immediately sent to your designated fulfillment teamâs Slack channel or email inbox, ensuring prompt order processing.
B. Low Stock Alert
- Schedule Trigger (Daily Inventory Check): â° The workflow runs automatically once every 24 hours (or at your configured interval) to regularly monitor your product inventory levels.
- Read Inventory Data (Google Sheets/API): đ It connects to your chosen inventory data source (e.g., a Google Sheet configured with product IDs, names, and stock levels, or an e-commerce platform API) to retrieve current stock data for all products.
- Filter Low Stock (Function): đ§š This node processes the retrieved inventory data. It uses a defined threshold (e.g., 10 units) to identify and filter out any products whose current stock level falls below this critical limit.
- If Low Stock Items?: đŚ This conditional node checks if the previous step found any products that are low on stock. If yes, it proceeds to send an alert.
- Send Low Stock Alert (Slack/Email): đ¨ A warning notification is sent to your purchasing or inventory management team via Slack or email, providing details on the low-stock items and prompting them to reorder before stock runs out, preventing lost sales.
C. Post-Purchase Feedback Request
- Webhook: Order Fulfilled (Delayed): đŚ This branch is triggered when an order is marked as fulfilled or delivered in your e-commerce system. Crucially, this webhook should be sent by your e-commerce platform or a separate automation after a specific delay (e.g., 3-7 days post-delivery) to ensure the customer has received and experienced the product.
- Extract Customer Data (Feedback) (Function): đ§š This node extracts the customerâs name and email address from the fulfilled order data, preparing it for the feedback request.
- Send Feedback Request (Gmail/Email Service): đ§ A personalized email is sent to the customer. This email thanks them for their purchase and includes a direct link to your chosen customer feedback form (e.g., Google Form, Typeform). This systematic approach encourages valuable insights for continuous business improvement.
How to Set Up đ ď¸
Follow these steps carefully to get your âE-commerce Operations Hubâ workflow up and running in n8n:
-
Import Workflow JSON:
- Open your n8n instance.
- Click on âWorkflowsâ in the left sidebar.
- Click the â+â button or âNewâ to create a new workflow.
- Click the ââŚâ (More Options) icon in the top right.
- Select âImport from JSONâ and paste the entire JSON code for this workflow.
-
Configure Webhook: New Order (Branch A):
- Locate the âWebhook: New Orderâ node (1. Webhook: New Order).
- Activate the workflow. n8n will provide a unique âWebhook URLâ.
- Crucial Step: Go to your e-commerce platform (Shopify, WooCommerce, etc.) and configure a new webhook. Set it to trigger on âOrder Createdâ or âNew Orderâ events, and paste the n8n Webhook URL there. Ensure the data format sent by your platform is JSON (most do by default).
-
Configure Extract Order Data (Function - Branch A):
- Locate the âExtract Order Dataâ node (2. Extract Order Data).
- Adjust Field Names: Review the
functionCodeinside this node. You MUST adjust the variable assignments (e.g.,orderData.id,orderData.customer?.first_name) to accurately match the exact field names sent by your e-commerce platformâs new order webhook. Use the âTest Workflowâ feature in n8n (after sending a test order webhook from your platform) to inspect the incomingitems[0].json.bodydata structure and make precise adjustments.
-
Configure Send Fulfillment Notification (Slack - Branch A):
- Locate the âSend Fulfillment Notification (Slack)â node (3. Send Fulfillment Notification (Slack)).
- Credentials: Select your existing Slack API credential or click âCreate Newâ to set one up. Replace
YOUR_SLACK_CREDENTIAL_IDwith the actual ID or name of your credential from your n8n credentials. - Channel: Replace
YOUR_FULFILLMENT_SLACK_CHANNEL_ID_OR_NAMEwith the exact ID or name of the Slack channel where your fulfillment team receives notifications (e.g.,#order-fulfillment). - (Optional: Switch to Email for Fulfillment): Delete this Slack node and add a Gmail or SendGrid node. Configure its credentials, âTo Emailâ, âSubjectâ (e.g.,
New Order #{{ $json.orderId }}), and âHTMLâ body (e.g.,={{ $json.fulfillmentMessage }}).
-
Configure Schedule Trigger (Daily Inventory Check - Branch B):
- Locate the âSchedule Trigger (Daily Inventory Check)â node (4. Schedule Trigger (Daily Inventory Check)).
- Adjust âintervalâ, âvalueâ, and âtimezoneâ to your preferred daily check time (e.g., every 24 hours at 3 AM in your local timezone).
-
Configure Read Inventory Data (Google Sheets - Branch B):
- Locate the âRead Inventory Data (Google Sheets)â node (5. Read Inventory Data (Google Sheets)).
- Credentials: Select your existing Google Sheets OAuth2 credential or click âCreate Newâ. Replace
YOUR_GOOGLE_SHEETS_CREDENTIAL_IDwith the actual ID or name of your credential. - Sheet ID: Replace
YOUR_INVENTORY_GOOGLE_SHEET_IDwith the actual ID of your Google Sheet where your inventory data is stored. - Range: Ensure the ârangeâ (e.g.,
Inventory!A:C) correctly covers your product ID, name, and stock level columns. Crucially, ensure your Google Sheet has columns with exact names:ProductID,ProductName, andStockLevel(as numbers).
-
Configure Filter Low Stock (Function - Branch B):
- Locate the âFilter Low Stockâ node (6. Filter Low Stock).
- Set Threshold: Inside the
functionCode, adjustconst lowStockThreshold = 10;to your desired low stock alert level. - Adjust Field Names: Review the
functionCodeand adjust the variable assignments (e.g.,product.ProductID,product.StockLevel) if your Google Sheet uses different column headers.
-
Configure Send Low Stock Alert (Slack - Branch B):
- Locate the âSend Low Stock Alert (Slack)â node (8. Send Low Stock Alert (Slack)).
- Credentials: Ensure your Slack API credential is selected (same as in step 4).
- Channel: Replace
YOUR_INVENTORY_SLACK_CHANNEL_ID_OR_NAMEwith the exact ID or name of the Slack channel for inventory alerts (e.g.,#inventory-alerts). - (Optional: Switch to Email for Low Stock): Delete this Slack node and add a Gmail or SendGrid node. Configure its credentials, âTo Emailâ, âSubjectâ (e.g.,
Low Stock Alert!), and âHTMLâ body (e.g.,={{ $json.alertMessage }}).
-
Configure Webhook: Order Fulfilled (Delayed) (Branch C):
- Locate the âWebhook: Order Fulfilled (Delayed)â node (10. Webhook: Order Fulfilled (Delayed)).
- Activate the workflow. n8n will provide a unique âWebhook URLâ.
- Crucial Step: This webhook should be triggered when an order is fulfilled or delivered. You will need to set up a mechanism in your e-commerce platform or a separate automation tool to send a webhook to this n8n URL after a specific delay (e.g., 3-7 days after the order is marked as delivered). This allows customers time to receive their product before being asked for feedback.
-
Configure Extract Customer Data (Feedback) (Function - Branch C):
- Locate the âExtract Customer Data (Feedback)â node (11. Extract Customer Data (Feedback)).
- Adjust Field Names: Review the
functionCodeand adjust the variable assignments (e.g.,fulfilledOrderData.customer?.email) to accurately match the exact field names sent by your âOrder Fulfilledâ webhook. - Set Feedback Form URL: Replace
YOUR_GOOGLE_FORM_OR_SURVEY_LINKwith the actual public URL of your customer feedback survey (e.g., Google Form, Typeform, SurveyMonkey). - Set Store Name: Replace
[Your Store Name]in theemailBodywith your actual store name.
-
Configure Send Feedback Request (Gmail - Branch C):
- Locate the âSend Feedback Request (Gmail)â node (12. Send Feedback Request (Gmail)).
- Credentials: Select your existing Gmail OAuth2 credential or click âCreate Newâ. Replace
YOUR_GMAIL_CREDENTIAL_IDwith the actual ID or name of your credential. - From Email: Replace
YOUR_STORE_EMAIL@example.comwith the email address you want feedback requests to be sent from. - The âTo Emailâ, âSubjectâ, and âHTMLâ body fields are dynamically generated by the previous âFunctionâ node.
- (Optional: Switch to another Email Service): Delete this Gmail node and add a SendGrid or Mailgun node, configuring it similarly.
-
Review and Activate:
- Thoroughly review all node configurations. Ensure all placeholder values (like
YOUR_...) are replaced and settings are correct. - Click the âSaveâ button in the top right corner.
- Finally, toggle the âInactiveâ switch to âActiveâ to enable your workflow. đ˘ Your âE-commerce Operations Hubâ is now live, ready to automate and optimize your store!
- Thoroughly review all node configurations. Ensure all placeholder values (like
đ Nodes Used
Function, Google Sheets, Slack, Webhook, Gmail, Schedule Trigger
đĽ Import
Download workflow.json and import into n8n:
Workflow menu â Import from File