N
n8n Store
Workflow Market
Shopify VIP Alerts: AI Summary & Slack Notification for Big Orders

Shopify VIP Alerts: AI Summary & Slack Notification for Big Orders

by yaron-nofluff•0 views

Description

Categories

šŸ¤– AI & Machine LearningšŸ“¢ Marketing

Nodes Used

n8n-nodes-base.ifn8n-nodes-base.setn8n-nodes-base.setn8n-nodes-base.noOpn8n-nodes-base.slackn8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.httpRequest
PriceFree
Views0
Last Updated11/28/2025
workflow.json
{
  "meta": {
    "instanceId": "5aaf4236c70e34e423fbdb2c7b754d19253a933bb1476d548f75848a01e473cf"
  },
  "nodes": [
    {
      "id": "ac23a49a-4fc6-468a-ba0f-c520a4feb396",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        40,
        1540
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f3c6e47e-6784-47d8-a7a7-30f4c11e9ff3",
      "name": "New Shopify Order",
      "type": "n8n-nodes-base.shopifyTrigger",
      "position": [
        -720,
        1260
      ],
      "webhookId": "2969c4e3-fcbb-45d7-b783-256b55cf8088",
      "parameters": {
        "topic": "orders/create",
        "authentication": "accessToken"
      },
      "typeVersion": 1
    },
    {
      "id": "a694a77c-a1eb-4053-bc69-4f7048a1abbc",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -280,
        1260
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "c2b8d86f-a356-4ea4-b516-56abfeb2570f",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.total_price }}",
              "rightValue": 200
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "1a22c0cd-d1b1-45a7-8fc6-78ef21edb762",
      "name": "Fetch Customer Order History",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        40,
        1100
      ],
      "parameters": {
        "url": "=https://your-store.myshopify.com/admin/api/2023-07/orders.json?customer_id={{ $('New Shopify Order').item.json.id }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Shopify-Access-Token",
              "value": "shpat_abc123xyz..."
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "cfbfb38c-53b9-4c25-8eda-2090c4ef0738",
      "name": "Type conversion (Array to String)",
      "type": "n8n-nodes-base.set",
      "position": [
        260,
        1100
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3f2f5ff0-4bf6-4f2e-aecf-6de16ec91cf4",
              "name": "orders",
              "type": "string",
              "value": "={{ $json.orders }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "79f49ac3-b559-48e8-826b-ee7ae58dbe5f",
      "name": "Type conversion (String to Number)",
      "type": "n8n-nodes-base.set",
      "position": [
        -500,
        1260
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "9c3375fe-5ad9-46df-b892-f1e6696d1b0e",
              "name": "total_price",
              "type": "number",
              "value": "={{ $json.total_price }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "b69c46f9-67dd-4eec-a94e-72cc9a03ebbf",
      "name": "Summarize Order History",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        520,
        1100
      ],
      "parameters": {
        "text": "=Summarize the customer's order history for Slack. Here is their order data:\n{{ $json.orders }}",
        "options": {
          "systemMessage": "You are a helpful assistant"
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "f4812abe-d29d-4fc6-b9ea-705437c90d82",
      "name": "Send Slack Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        880,
        1100
      ],
      "webhookId": "577b78c7-df10-46f6-9025-8c5e64c332fe",
      "parameters": {
        "text": "=🚨 High-Value Order Alert!  \nCustomer: {{ $('New Shopify Order').item.json.billing_address.first_name }} {{ $('New Shopify Order').item.json.billing_address.last_name }}\nOrder Total: ${{ $('New Shopify Order').item.json.total_price }}  \nCustomer Order history Summary: {{ $json.output }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C08TTV0CC3E",
          "cachedResultName": "all-nathing"
        },
        "otherOptions": {
          "includeLinkToWorkflow": false
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "aa297625-1574-4105-a480-ace06e258cc3",
      "name": "Ignore Low-Value Order",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        460,
        1300
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "2ef2e96b-b299-43d6-92b1-65206d1a53b6",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2540,
        1340
      ],
      "parameters": {
        "color": 4,
        "width": 1289,
        "height": 2238,
        "content": "# šŸ”” High-Value Order Alert Workflow\n\n**Description:**  \nThis workflow is designed to monitor incoming orders from a Shopify store. When an order exceeds $200, it automatically fetches the customer's order history, summarizes it using AI, and sends a personalized alert to a Slack channel. This ensures that high-value customers receive attention from the sales or support team in real-time.\n\n---\n\n## 🟢 Section 1: Shopify Order Trigger & Pre-Processing\n\nThis section initiates the workflow whenever a new order is placed in the Shopify store. The first step is detecting the new order event using the Shopify integration. Once an order is detected, the workflow proceeds to extract essential fields such as the order total and the customer ID.\n\nThe extracted order total is then evaluated against a threshold. If the amount is greater than $200, the workflow proceeds to the next section. Otherwise, it is terminated early to avoid unnecessary operations on low-value orders.\n\nThis section helps focus the workflow only on high-priority events and minimizes overhead by filtering out low-impact transactions.\n\n---\n\n## 🧠 Section 3: Customer Insights via AI\n\nOnce a high-value order is confirmed, this section is responsible for gathering historical context about the customer. The process begins with fetching the customer’s past order history from Shopify or a connected database using their unique customer ID.\n\nThe raw data containing previous order details—such as dates, product categories, and order amounts—is then cleaned and formatted into a prompt. This structured prompt is designed to be fed into an AI model for summarization.\n\nAn OpenAI chat model processes the prompt and generates a concise summary of the customer's purchasing behavior. This might include insights like frequency of purchases, favorite product categories, and overall customer lifetime value.\n\nThis AI-generated summary equips the team with actionable insights at a glance, enabling better personalization and response when the order alert is sent.\n\n---\n\n## šŸ“£ Final Step: Slack Notification\n\nThe final section of the workflow sends a message to a designated Slack channel. The alert includes key details of the new high-value order along with the AI-generated summary of the customer. This ensures the team receives the context they need in real time, without having to dig through customer records manually.\n\n---\n\n## ā›” Fallback: Low-Value Order\n\nIf the order total is $200 or less, the workflow ends here. No further action is taken. This fallback ensures that only orders worthy of escalation are processed, keeping the workflow efficient and focused.\n\n---\n\n## šŸ” Full Workflow Logic Overview\n\n1. Detect a new order in Shopify.\n2. Extract order details including total amount and customer ID.\n3. Check if the order total exceeds $200.\n4. If yes:\n   - Fetch the customer’s past order history.\n   - Format the data for AI.\n   - Use OpenAI to summarize the customer’s behavior.\n   - Send a detailed alert to Slack.\n5. If not:\n   - Terminate the workflow without sending an alert.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b97d2bcb-56da-4973-8c51-f71f199bf67c",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2540,
        1000
      ],
      "parameters": {
        "color": 4,
        "width": 1300,
        "height": 320,
        "content": "=======================================\n            WORKFLOW ASSISTANCE\n=======================================\nFor any questions or support, please contact:\n    [email protected]\n\nExplore more tips and tutorials here:\n   - YouTube: https://www.youtube.com/@YaronBeen/videos\n   - LinkedIn: https://www.linkedin.com/in/yaronbeen/\n=======================================\n"
      },
      "typeVersion": 1
    },
    {
      "id": "3f072968-adae-412e-aad3-0244555e9732",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -760,
        500
      ],
      "parameters": {
        "width": 420,
        "height": 940,
        "content": "🟢 Shopify Order Trigger & Pre-Processing\nšŸŽÆ Purpose:\nTo detect new incoming orders from the Shopify store and extract key data, especially the order total, for conditional routing.\n\n🧩 Nodes Involved:\nNew Shopify Order\n\nType: Trigger Node\n\nFunction: Listens for new orders placed on the Shopify store.\n\nData Pulled: Order ID, Customer ID, Order Total, Line Items, etc.\n\nExtract Order Amount\n\nType: Field Editing Node\n\nFunction: Parses the incoming Shopify payload to isolate the order total and other relevant fields.\n\nOutput: Cleaned-up JSON or structured data (e.g., { customer_id: ..., total_amount: 215.00 })\n\nšŸ”„ Workflow Flow:\nA new order triggers the workflow.\n\nThe order's total amount is extracted and passed to the next stage for conditional evaluation.\n\nāœ… Why It Matters:\nExtracting the order amount early allows the workflow to make a smart decision: continue only for high-value transactions, saving processing resources and avoiding noise."
      },
      "typeVersion": 1
    },
    {
      "id": "8a494e6b-b7d8-473d-aca9-959ad758c769",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "color": 5,
        "width": 1060,
        "height": 1440,
        "content": "🧠 Customer Insights via AI\nšŸŽÆ Purpose:\nTo provide context on the customer's past purchase behavior using AI-generated summaries, so that the team receiving the alert understands the customer profile instantly.\n\n🧩 Nodes Involved:\nFetch Customer Order History\n\nType: HTTP Request\n\nFunction: Sends a request to your database or Shopify API to retrieve past orders for the customer.\n\nInput: Customer ID\n\nOutput: List of past orders with dates, values, and product categories.\n\nPrepare Order History Summary\n\nType: Edit Fields Node\n\nFunction: Formats and filters the fetched data into a prompt-friendly format for the AI model.\n\nExample Output:\n\nCustomer 123 has made 4 purchases:\n- $120 on June 10 (Shoes)\n- $75 on July 2 (Accessories)\n- $199 on August 15 (Electronics)\n- $240 on September 5 (Apparel)\nSummarize Order History\n\nType: OpenAI Chat Model\n\nFunction: Uses a language model (like GPT-4) to create a summary of the customer’s purchasing behavior.\n\nPrompt Example:\n\n\"Summarize this customer's buying behavior in 1–2 sentences. Highlight their spending habits and preferences.\"\n\nAI Summary Generator\n\nType: Tools Agent\n\nFunction: Manages the interaction between the workflow and the OpenAI model, ensuring context is handled correctly (e.g., memory or tools if needed).\n\nšŸ“‹ Example Output:\nā€œThis customer frequently purchases high-end fashion and electronics, with an increasing order value trend over the last 3 months.ā€\n\nāœ… Why It Matters:\nGives your sales or support team instant, intelligent insights.\n\nSaves time and reduces manual lookup of customer history.\n\nHelps personalize responses and identify VIP customers."
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Fetch Customer Order History",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Shopify Order": {
      "main": [
        [
          {
            "node": "Type conversion (String to Number)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ignore Low-Value Order": {
      "ai_languageModel": [
        [
          {
            "node": "Summarize Order History",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Order History": {
      "main": [
        [
          {
            "node": "Send Slack Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Customer Order History": {
      "main": [
        [
          {
            "node": "Type conversion (Array to String)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Type conversion (Array to String)": {
      "main": [
        [
          {
            "node": "Summarize Order History",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Type conversion (String to Number)": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

ē›øå…³å·„ä½œęµ