{
  "name": "Recover Shopify abandoned carts with email, SMS, WhatsApp & Facebook retargeting",
  "nodes": [
    {
      "id": "2af57041-a8fa-4b7f-a0fa-4b9f2e78d45d",
      "name": "Abandoned Cart Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -5328,
        208
      ]
    },
    {
      "id": "b8a225f1-7bb0-4e47-be3f-46bc83de07c8",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -5104,
        208
      ]
    },
    {
      "id": "83e8f42f-dc24-4682-b3df-f2502daaa081",
      "name": "Normalize Cart Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -5312,
        832
      ]
    },
    {
      "id": "0981e7c2-c0c9-4f9e-a05c-cda0fbbd5d62",
      "name": "Fetch Cart Details",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -5088,
        928
      ]
    },
    {
      "id": "45b42e77-b9d2-4527-ba22-349520cfce7e",
      "name": "Fetch Customer History",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -5088,
        736
      ]
    },
    {
      "id": "20ba8d41-0963-4a83-bdbf-3c7b50681a48",
      "name": "Predict Abandonment Reason",
      "type": "n8n-nodes-base.code",
      "position": [
        -4784,
        816
      ]
    },
    {
      "id": "888a5d08-3f58-43a3-bffa-9c1fea08c022",
      "name": "Personalization Engine",
      "type": "n8n-nodes-base.code",
      "position": [
        -4560,
        816
      ]
    },
    {
      "id": "b7acc79b-8942-46ca-9e14-4f3182c7f26a",
      "name": "Wait 1 Hour",
      "type": "n8n-nodes-base.wait",
      "position": [
        -3744,
        800
      ]
    },
    {
      "id": "c3fbf7d5-7845-470a-8caf-26df40901dc7",
      "name": "Check Order Completed (1h)",
      "type": "n8n-nodes-base.if",
      "position": [
        -3376,
        800
      ]
    },
    {
      "id": "a55f97b5-ab34-4d73-927f-1e76cccc2efc",
      "name": "Check Order Status (1h)",
      "type": "n8n-nodes-base.shopify",
      "position": [
        -3584,
        800
      ]
    },
    {
      "id": "b7084dab-ec4b-4b06-99ed-e733aec65e48",
      "name": "Generate Email 1 Content",
      "type": "n8n-nodes-base.code",
      "position": [
        -3184,
        912
      ]
    },
    {
      "id": "d8c4f4ab-136a-4c04-b9f6-79b7698b4ad1",
      "name": "Send Email 1",
      "type": "n8n-nodes-base.sendGrid",
      "position": [
        -2992,
        912
      ]
    },
    {
      "id": "6b2a3b61-c910-4a15-be6a-ba57203b47a4",
      "name": "Log Email 1 Touchpoint",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2832,
        912
      ]
    },
    {
      "id": "f60cee52-ea2b-4320-b944-0f7dbbc5e873",
      "name": "Attribution - Email 1",
      "type": "n8n-nodes-base.code",
      "position": [
        -2656,
        912
      ]
    },
    {
      "id": "c16bc685-afa8-4757-9846-916f64bb0441",
      "name": "Wait Until 4 Hours",
      "type": "n8n-nodes-base.wait",
      "position": [
        -2400,
        656
      ]
    },
    {
      "id": "60b06474-9d7c-4cac-a284-887af6791057",
      "name": "Check Order Status (4h)",
      "type": "n8n-nodes-base.shopify",
      "position": [
        -2208,
        656
      ]
    },
    {
      "id": "0775ea03-bf48-45dc-a6b1-f2c7b09cc9ba",
      "name": "Check Order Completed (4h)",
      "type": "n8n-nodes-base.if",
      "position": [
        -2000,
        656
      ]
    },
    {
      "id": "d9e7c858-3b17-4adf-a74d-516689624281",
      "name": "Prepare SMS Content",
      "type": "n8n-nodes-base.set",
      "position": [
        -1760,
        752
      ]
    },
    {
      "id": "62aaf0ff-fb0b-4667-a417-f9006ebc7afc",
      "name": "Send SMS with Discount",
      "type": "n8n-nodes-base.twilio",
      "position": [
        -1552,
        752
      ]
    },
    {
      "id": "96d01cc2-8522-4255-8d8b-1666c5a5d254",
      "name": "Log SMS Touchpoint",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1360,
        752
      ]
    },
    {
      "id": "fbe4c840-8a40-4cff-a5e5-41f3162ae7c1",
      "name": "Wait Until 24 Hours",
      "type": "n8n-nodes-base.wait",
      "position": [
        -1696,
        1200
      ]
    },
    {
      "id": "582cfd05-900a-4342-8b58-28ebc76a5f6e",
      "name": "Check Order Status (24h)",
      "type": "n8n-nodes-base.shopify",
      "position": [
        -1504,
        1200
      ]
    },
    {
      "id": "e637c2f3-eaf1-4275-92b3-85e8b97c38c1",
      "name": "Check Order Completed (24h)",
      "type": "n8n-nodes-base.if",
      "position": [
        -1264,
        1200
      ]
    },
    {
      "id": "1d4afe20-f9e2-489a-b521-80b462403213",
      "name": "Generate Email 2 Content",
      "type": "n8n-nodes-base.code",
      "position": [
        -1024,
        1216
      ]
    },
    {
      "id": "c99a81a4-6200-4efb-bf08-7deaec9b64dd",
      "name": "Send Email 2",
      "type": "n8n-nodes-base.sendGrid",
      "position": [
        -848,
        1216
      ]
    },
    {
      "id": "537b3a44-3679-48fd-a7c4-5034f7259e93",
      "name": "Log Email 2 Touchpoint",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -656,
        1216
      ]
    },
    {
      "id": "b0d91f66-829e-4ed6-b457-c7f1c83714c9",
      "name": "Wait Until 48 Hours",
      "type": "n8n-nodes-base.wait",
      "position": [
        -400,
        1216
      ]
    },
    {
      "id": "86dafe3f-b0f2-435b-bf2a-77f8a922db27",
      "name": "Check Order Completed (48h)",
      "type": "n8n-nodes-base.if",
      "position": [
        -208,
        1216
      ]
    },
    {
      "id": "1e23dd15-87cd-4a76-96ff-44bcd584db95",
      "name": "Generate WhatsApp Message",
      "type": "n8n-nodes-base.code",
      "position": [
        0,
        1312
      ]
    },
    {
      "id": "87950621-7664-485b-9a58-2e5ff8f4282e",
      "name": "Send WhatsApp Message",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        192,
        1312
      ]
    },
    {
      "id": "68396f90-df47-4791-a66b-750747145722",
      "name": "Add to Retargeting Audience",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        608,
        1312
      ]
    },
    {
      "id": "3c357ffd-ac8b-48c1-a818-b146eb0c2ced",
      "name": "Merge Attribution Data",
      "type": "n8n-nodes-base.merge",
      "position": [
        -2400,
        1088
      ]
    },
    {
      "id": "413e1e34-57b7-4297-bcc5-8d90298185ad",
      "name": "Notify High-Value Recovery",
      "type": "n8n-nodes-base.slack",
      "position": [
        -1952,
        1088
      ]
    },
    {
      "id": "f1669543-ea4d-42e4-bb72-6b06b9a05838",
      "name": "Check Cart Value Threshold",
      "type": "n8n-nodes-base.if",
      "position": [
        -2176,
        1088
      ]
    },
    {
      "id": "fce23508-83d3-4a6c-9ec4-24f0492b0373",
      "name": "Customer Segment Check",
      "type": "n8n-nodes-base.if",
      "position": [
        -4272,
        816
      ]
    },
    {
      "id": "b22392a5-9eab-4191-9ee0-5e43c4a93b68",
      "name": "Device Type Check",
      "type": "n8n-nodes-base.if",
      "position": [
        -4048,
        816
      ]
    },
    {
      "id": "e0caac6b-4ccb-43fb-a424-2461dc408103",
      "name": "Mark Success - Order Completed (1h)",
      "type": "n8n-nodes-base.set",
      "position": [
        -3184,
        720
      ]
    },
    {
      "id": "6a6a02ba-452f-47d1-b84d-a6860e6ac2bb",
      "name": "Mark Success - Order Completed (4h)",
      "type": "n8n-nodes-base.set",
      "position": [
        -1760,
        560
      ]
    },
    {
      "id": "46ffac66-0c1b-451b-adb9-924d3b070728",
      "name": "Mark Success - Order Completed (24h)",
      "type": "n8n-nodes-base.set",
      "position": [
        -1024,
        1040
      ]
    },
    {
      "id": "1dd40762-ebc5-493a-8263-72e0b506865c",
      "name": "Mark Success - Order Completed (48h)",
      "type": "n8n-nodes-base.set",
      "position": [
        0,
        1120
      ]
    },
    {
      "id": "d94b879e-70a0-441c-b6b0-a0caae8a165c",
      "name": "Merge Attribution - SMS",
      "type": "n8n-nodes-base.code",
      "position": [
        -1152,
        752
      ]
    },
    {
      "id": "28105702-e993-435d-a115-451b0cdad347",
      "name": "Merge Attribution - Email 2",
      "type": "n8n-nodes-base.code",
      "position": [
        -656,
        1456
      ]
    },
    {
      "id": "182084ce-93de-4d45-b100-e6c0218b2e87",
      "name": "Merge Attribution - WhatsApp",
      "type": "n8n-nodes-base.code",
      "position": [
        800,
        1312
      ]
    },
    {
      "id": "549131f5-1dba-4f46-ad89-ebcd87213891",
      "name": "Hash Customer Data for Facebook",
      "type": "n8n-nodes-base.code",
      "position": [
        400,
        1312
      ]
    },
    {
      "id": "22be27bd-d0b3-488c-bb41-4a834fab5bed",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4864,
        80
      ],
      "parameters": {
        "width": 1008,
        "height": 464,
        "content": "## How it works\nThis workflow recovers abandoned carts using a timed, multi-channel sequence (Email → SMS → Email → WhatsApp) and logs every touchpoint for multi-touch attribution.\n\nWhen a cart is aba"
      }
    },
    {
      "id": "d50e1660-2c7d-40c7-8e4a-b5ec068824ff",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -5360,
        80
      ],
      "parameters": {
        "width": 432,
        "height": 272,
        "content": "## Intake & Configuration\nReceives the abandoned cart event and loads global settings (API URLs, Shopify domain, Sheets ID, high-value threshold) used across the workflow."
      }
    },
    {
      "id": "5765c821-090b-42fb-810e-9d940539cc72",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -5360,
        624
      ],
      "parameters": {
        "width": 416,
        "height": 432,
        "content": "## Normalize & Enrich Cart Data\nNormalizes the incoming cart payload and fetches full cart details and customer purchase history to build a complete recovery context."
      }
    },
    {
      "id": "54dc8d9f-354a-460f-af5a-8e93df8e25cd",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4864,
        624
      ],
      "parameters": {
        "width": 448,
        "height": 432,
        "content": "## Reason Prediction & Personalization\nPredicts the likely abandonment reason, segments the customer, assigns A/B group, calculates a discount, and builds a checkout URL for personalized messaging."
      }
    },
    {
      "id": "7d49d894-3526-491d-8014-e3017a2ee754",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3776,
        624
      ],
      "parameters": {
        "width": 1248,
        "height": 432,
        "content": "## 1h Checkpoint & Email 1\nWaits 1 hour, checks if the order was completed, and if not, generates and sends the first email reminder. Logs the send as the first attribution touchpoint."
      }
    },
    {
      "id": "302de9e4-99b1-49f8-9088-ab239bc7077b",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4336,
        624
      ],
      "parameters": {
        "width": 480,
        "height": 432,
        "content": "## Routing Rules\nApplies simple routing logic based on customer segment and device type before starting the timed recovery sequence."
      }
    },
    {
      "id": "858bd62a-01f8-4f74-bdbd-dbe6ed0c95f7",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -464,
        960
      ],
      "parameters": {
        "width": 1664,
        "height": 672,
        "content": "## 48h Final Touchpoint & Retargeting\nAt 48 hours, checks completion one last time. If still not recovered, sends a final WhatsApp reminder, hashes customer identifiers, and adds the user to a Faceboo"
      }
    },
    {
      "id": "24f3d943-5a26-4169-a1fd-20228725663b",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2448,
        480
      ],
      "parameters": {
        "width": 1456,
        "height": 432,
        "content": "## 4h Checkpoint & SMS\nAfter additional waiting, re-checks order completion. If still not recovered, sends an SMS with a personalized discount and logs the SMS touchpoint."
      }
    },
    {
      "id": "086c5390-aaa0-455b-9c5c-e2d4dfb97bea",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2448,
        960
      ],
      "parameters": {
        "width": 672,
        "height": 304,
        "content": "## Attribution Merge & High-Value Alert\nMerges touchpoints into a single journey record and triggers a Slack notification when a recovered cart exceeds the configured high-value threshold."
      }
    },
    {
      "id": "2a06a916-dadb-444f-9843-e30ff45bc81b",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1744,
        960
      ],
      "parameters": {
        "width": 1232,
        "height": 672,
        "content": "## 24h Checkpoint & Email 2\nWaits until 24 hours, checks again for completion, and sends a second email focused on social proof and urgency. Logs the touchpoint and updates attribution."
      }
    }
  ],
  "connections": {
    "Wait 1 Hour": {
      "main": [
        [
          {
            "node": "Check Order Status (1h)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email 1": {
      "main": [
        [
          {
            "node": "Log Email 1 Touchpoint",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email 2": {
      "main": [
        [
          {
            "node": "Log Email 2 Touchpoint",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Device Type Check": {
      "main": [
        [
          {
            "node": "Wait 1 Hour",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Cart Details": {
      "main": [
        [
          {
            "node": "Predict Abandonment Reason",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log SMS Touchpoint": {
      "main": [
        [
          {
            "node": "Wait Until 24 Hours",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge Attribution - SMS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Until 4 Hours": {
      "main": [
        [
          {
            "node": "Check Order Status (4h)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Cart Data": {
      "main": [
        [
          {
            "node": "Fetch Cart Details",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Customer History",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare SMS Content": {
      "main": [
        [
          {
            "node": "Send SMS with Discount",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Until 24 Hours": {
      "main": [
        [
          {
            "node": "Check Order Status (24h)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Until 48 Hours": {
      "main": [
        [
          {
            "node": "Check Order Completed (48h)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Attribution - Email 1": {
      "main": [
        [
          {
            "node": "Wait Until 4 Hours",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge Attribution Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send WhatsApp Message": {
      "main": [
        [
          {
            "node": "Hash Customer Data for Facebook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Abandoned Cart Webhook": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Customer Segment Check": {
      "main": [
        [
          {
            "node": "Device Type Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Customer History": {
      "main": [
        [
          {
            "node": "Predict Abandonment Reason",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Email 1 Touchpoint": {
      "main": [
        [
          {
            "node": "Attribution - Email 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Email 2 Touchpoint": {
      "main": [
        [
          {
            "node": "Wait Until 48 Hours",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge Attribution - Email 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Attribution Data": {
      "main": [
        [
          {
            "node": "Check Cart Value Threshold",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Personalization Engine": {
      "main": [
        [
          {
            "node": "Customer Segment Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send SMS with Discount": {
      "main": [
        [
          {
            "node": "Log SMS Touchpoint",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Normalize Cart Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Order Status (1h)": {
      "main": [
        [
          {
            "node": "Check Order Completed (1h)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Order Status (4h)": {
      "main": [
        [
          {
            "node": "Check Order Completed (4h)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Attribution - SMS": {
      "main": [
        [
          {
            "node": "Merge Attribution Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Check Order Status (24h)": {
      "main": [
        [
          {
            "node": "Check Order Completed (24h)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Email 1 Content": {
      "main": [
        [
          {
            "node": "Send Email 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Email 2 Content": {
      "main": [
        [
          {
            "node": "Send Email 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate WhatsApp Message": {
      "main": [
        [
          {
            "node": "Send WhatsApp Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Cart Value Threshold": {
      "main": [
        [
          {
            "node": "Notify High-Value Recovery",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Order Completed (1h)": {
      "main": [
        [
          {
            "node": "Mark Success - Order Completed (1h)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate Email 1 Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Order Completed (4h)": {
      "main": [
        [
          {
            "node": "Mark Success - Order Completed (4h)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare SMS Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Predict Abandonment Reason": {
      "main": [
        [
          {
            "node": "Personalization Engine",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add to Retargeting Audience": {
      "main": [
        [
          {
            "node": "Merge Attribution - WhatsApp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Order Completed (24h)": {
      "main": [
        [
          {
            "node": "Mark Success - Order Completed (24h)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate Email 2 Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Order Completed (48h)": {
      "main": [
        [
          {
            "node": "Mark Success - Order Completed (48h)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate WhatsApp Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Attribution - Email 2": {
      "main": [
        [
          {
            "node": "Wait Until 24 Hours",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Hash Customer Data for Facebook": {
      "main": [
        [
          {
            "node": "Add to Retargeting Audience",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}