{
  "name": "Escalate payment issues with Azure OpenAI, Google Sheets, Slack and Zendesk",
  "nodes": [
    {
      "id": "d0c674b9-2556-435a-b307-69d8a593423d",
      "name": "Webhook Listener for Incoming Data",
      "type": "n8n-nodes-base.webhook",
      "position": [
        224,
        -384
      ]
    },
    {
      "id": "bd25354e-a79f-465a-80b0-4eb4ac7a785a",
      "name": "Set Lead Data for Processing",
      "type": "n8n-nodes-base.set",
      "position": [
        528,
        -384
      ]
    },
    {
      "id": "63a74593-5336-4443-b2f7-da1a7fd223b8",
      "name": "Generate Escalation Analysis Email (AI)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        816,
        -384
      ]
    },
    {
      "id": "6fe62b76-13f2-4e98-8096-50baeb644ff9",
      "name": "Execute Trade Decision Reasoning with Azure OpenAI",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        944,
        -16
      ]
    },
    {
      "id": "c842004b-e169-44fc-98be-2ea8356a8022",
      "name": "Parse Structured AI Output for Email",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1152,
        -32
      ]
    },
    {
      "id": "f09b7fa3-6a2c-4e0a-8789-a9cfe90f80c5",
      "name": "Retrieve Transaction Data from Google Sheets",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        512,
        240
      ]
    },
    {
      "id": "16f7b528-f60f-47ce-8ece-a6e95da317a2",
      "name": "Send  Email to Customer",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2128,
        -736
      ]
    },
    {
      "id": "b556d356-90d5-4d4a-b7c6-a96e408a4a2e",
      "name": "Send Escalation Notification to Human Support",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1840,
        224
      ]
    },
    {
      "id": "784f005d-ec47-4468-a067-1c1996b3ac2b",
      "name": "Update Lead Record in Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2496,
        -48
      ]
    },
    {
      "id": "00f9f813-b89b-4cb2-a0d0-7a21fef6cc52",
      "name": "Log Human Escalation to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        1776,
        -48
      ]
    },
    {
      "id": "8e061674-0878-4dbf-b7c0-2a87e4b41596",
      "name": "Generate Customer-Facing Support Email (AI)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1664,
        -736
      ]
    },
    {
      "id": "7e081297-23d6-45c5-af87-a78d20210f5e",
      "name": "parse Customer Email Output for Sending",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1856,
        -496
      ]
    },
    {
      "id": "536164ae-c33d-4d86-bb3a-dd0f8d8541b2",
      "name": "Execute Trade Decision Reasoning for Customer Email (Azure)",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        1568,
        -512
      ]
    },
    {
      "id": "7bb960e2-f983-4b1b-a540-8e340ef8e64d",
      "name": "Set Lead data ",
      "type": "n8n-nodes-base.set",
      "position": [
        2288,
        -48
      ]
    },
    {
      "id": "897285c6-2ac4-4261-8d49-157b5c0a6545",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        496
      ],
      "parameters": {
        "width": 492,
        "height": 400,
        "content": "## ⚠️ Error Monitoring\n\nCatches any workflow failures and sends alerts to Slack's general-information channel. Helps maintain reliability and enables quick troubleshooting."
      }
    },
    {
      "id": "ca5adc13-5e50-466c-8cec-b1aee7696725",
      "name": "Error Trigger",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        368,
        688
      ]
    },
    {
      "id": "4eb43b0a-d12d-4494-9e98-4827c595214b",
      "name": "Alert on Workflow Failure",
      "type": "n8n-nodes-base.slack",
      "position": [
        624,
        688
      ]
    },
    {
      "id": "283f653a-3856-4df0-bda2-3572c93960af",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        -1280
      ],
      "parameters": {
        "width": 800,
        "height": 704,
        "content": "## 🧾 AI-Powered Chatbase Customer Support Escalation Workflow\n\n### How this workflow works\nThis workflow automates end-to-end handling of payment-related customer issues using a webhook-driven archite"
      }
    },
    {
      "id": "c5142dd1-3a60-49c2-a9ac-31cf65a88596",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        -592
      ],
      "parameters": {
        "width": 576,
        "height": 416,
        "content": "## 📥 Webhook Intake & Normalization\nReceives structured issue data from external systems\nand prepares it for downstream processing.\n\n• Webhook-based entry point  \n• Normalizes request body  \n• Ensures"
      }
    },
    {
      "id": "d5c569f3-4aea-4240-bdb5-32aa12fbed6b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        -64
      ],
      "parameters": {
        "width": 432,
        "height": 480,
        "content": "## 📊 Transaction Lookup (Source of Truth)\nFetches transaction and order details from\nGoogle Sheets to validate reported issues.\n\n• Payment and order verification  \n• Sheet treated as source of truth  "
      }
    },
    {
      "id": "bca79478-938d-4bdb-b991-0c34fd5166b7",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        784,
        -608
      ],
      "parameters": {
        "width": 544,
        "height": 752,
        "content": "## 🧠 AI Escalation Decision & Analysis\nAnalyzes issue details against transaction data\nto decide escalation status.\n\n• Confirms or rejects reported issues  \n• Applies strict escalation rules  \n• Produ"
      }
    },
    {
      "id": "a033718c-a1df-4a9b-a458-dc1326c626f5",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1488,
        -240
      ],
      "parameters": {
        "width": 576,
        "height": 640,
        "content": "## 🚨 Human Support Notification\nNotifies internal support teams when\nmanual intervention is required.\n\n• Sends escalation email to support  \n• Logs detailed context in Slack  \n• Enables fast human res"
      }
    },
    {
      "id": "26c5af23-d031-4f18-a967-19fb16129c6c",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1440,
        -912
      ],
      "parameters": {
        "width": 928,
        "height": 560,
        "content": "## ✉️ Customer-Facing Support Email\nGenerates and sends a calm, professional\nemail to the customer.\n\n• Acknowledges the issue  \n• Confirms payment receipt  \n• Reassures ongoing support review  \n"
      }
    },
    {
      "id": "b7e28558-d332-4830-ad15-e27f234f4bf3",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2224,
        -304
      ],
      "parameters": {
        "width": 464,
        "height": 464,
        "content": "## 📝 Record Update & Confirmation Tracking\nUpdates transaction records after customer\ncommunication is sent.\n\n• Marks confirmation email as sent  \n• Keeps transaction data in sync  \n• Maintains audit-"
      }
    },
    {
      "id": "75be893b-8215-4f1f-a258-ffe432fadbc9",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2752,
        -96
      ],
      "parameters": {
        "width": 432,
        "height": 304,
        "content": "## 🔐 Required Credentials & Access\nThis workflow requires the following integrations:\n\n• Webhook access for incoming issues  \n• Google Sheets OAuth2 (source of truth)  \n• Azure OpenAI for AI reasoning"
      }
    },
    {
      "id": "d83eaa8c-1d2e-4670-becf-9001411ce944",
      "name": "Create a ticket",
      "type": "n8n-nodes-base.zendesk",
      "position": [
        2464,
        688
      ]
    },
    {
      "id": "af7c52db-2f51-4329-8f04-2d357a49a8ee",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2368,
        256
      ],
      "parameters": {
        "width": 336,
        "height": 624,
        "content": "## 🎫 Zendesk Ticket Creation (Human Escalation)\n\nCreates a Zendesk support ticket when an issue\nis confirmed and requires manual intervention.\n\n• Uses AI-generated escalation summary  \n• Includes cust"
      }
    }
  ],
  "connections": {
    "Error Trigger": {
      "main": [
        [
          {
            "node": "Alert on Workflow Failure",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Lead data ": {
      "main": [
        [
          {
            "node": "Update Lead Record in Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a ticket": {
      "main": [
        []
      ]
    },
    "Alert on Workflow Failure": {
      "main": [
        []
      ]
    },
    "Set Lead Data for Processing": {
      "main": [
        [
          {
            "node": "Generate Escalation Analysis Email (AI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Human Escalation to Slack": {
      "main": [
        [
          {
            "node": "Set Lead data ",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create a ticket",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Listener for Incoming Data": {
      "main": [
        [
          {
            "node": "Set Lead Data for Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Structured AI Output for Email": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Escalation Analysis Email (AI)",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Generate Escalation Analysis Email (AI)": {
      "main": [
        [
          {
            "node": "Send Escalation Notification to Human Support",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate Customer-Facing Support Email (AI)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log Human Escalation to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "parse Customer Email Output for Sending": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Customer-Facing Support Email (AI)",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Generate Customer-Facing Support Email (AI)": {
      "main": [
        [
          {
            "node": "Send  Email to Customer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Transaction Data from Google Sheets": {
      "ai_tool": [
        [
          {
            "node": "Generate Escalation Analysis Email (AI)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Execute Trade Decision Reasoning with Azure OpenAI": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Escalation Analysis Email (AI)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Execute Trade Decision Reasoning for Customer Email (Azure)": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Customer-Facing Support Email (AI)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}