{
  "name": "Handle failed payment renewals with AI analysis, Jira tickets and Slack alerts",
  "nodes": [
    {
      "id": "83f1bf6b-b2d4-40eb-8cbc-bf9a4dd13e10",
      "name": "Section - Validation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        560
      ],
      "parameters": {
        "width": 528,
        "height": 456,
        "content": "## Validation & Routing\n\nValidates payload. If valid, passes to AI for analysis."
      }
    },
    {
      "id": "46f341fc-77ad-4620-acec-a821de6e5754",
      "name": "Section - AI & Logic",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        512
      ],
      "parameters": {
        "width": 648,
        "height": 450,
        "content": "## AI & Logic\n\n1. **AI Analysis**: Determines Churn Risk & drafts email.\n2. **Switch**: Routes High Value (>$500) to High Priority."
      }
    },
    {
      "id": "35fc16ae-d215-4210-9b63-9ceac1c88387",
      "name": "AI Analysis",
      "type": "n8n-nodes-base.openAi",
      "position": [
        1296,
        656
      ]
    },
    {
      "id": "6a23440a-6af1-48a7-ade8-1f71e716bdaf",
      "name": "Priority Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        1504,
        656
      ]
    },
    {
      "id": "b650de29-af79-4dad-8ccc-0adf2e948df7",
      "name": "Set High Priority",
      "type": "n8n-nodes-base.set",
      "position": [
        1696,
        560
      ]
    },
    {
      "id": "a36b4305-311a-4a10-90c9-df916dc628e1",
      "name": "Set Standard Priority",
      "type": "n8n-nodes-base.set",
      "position": [
        1696,
        768
      ]
    },
    {
      "id": "f755de36-c8d1-4a20-9d32-d1d3c6386292",
      "name": "Main Overview1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        64
      ],
      "parameters": {
        "width": 550,
        "height": 550,
        "content": "## How it works\n\nThis workflow handles failed payment renewal notifications. It now includes **AI Analysis** to determine urgency and draft recovery emails.\n\n1. **Webhook**: Receives payload.\n2. **Val"
      }
    },
    {
      "id": "a85de952-f857-48e1-82af-e38cac66d2cc",
      "name": "Section - Success Path1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1904,
        512
      ],
      "parameters": {
        "width": 536,
        "height": 446,
        "content": "## Success Path\n\nCreates Jira ticket with AI-enhanced data and notifies Slack."
      }
    },
    {
      "id": "d6344515-73bb-40f3-9881-ce6b723d1e6f",
      "name": "Section - Error Path1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1216,
        1008
      ],
      "parameters": {
        "width": 384,
        "height": 296,
        "content": "## Error Path"
      }
    },
    {
      "id": "bbb3248a-d8cd-48b2-a9cd-d1d8c3c418d5",
      "name": "Webhook - Payment Failed",
      "type": "n8n-nodes-base.webhook",
      "position": [
        256,
        752
      ]
    },
    {
      "id": "f885e35c-e699-4219-98b1-51479703bb99",
      "name": "Validate Payload",
      "type": "n8n-nodes-base.function",
      "position": [
        640,
        752
      ]
    },
    {
      "id": "2e751337-57d9-45a6-ade4-6b2e3d76cd18",
      "name": "Payload Valid?",
      "type": "n8n-nodes-base.if",
      "position": [
        896,
        752
      ]
    },
    {
      "id": "7c943f69-8f7f-424f-b0b7-2705c8eebc3c",
      "name": "Slack Error Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        1344,
        1120
      ]
    },
    {
      "id": "510ca07e-c8ca-4315-a7cd-d947764068c4",
      "name": "Create Jira Finance Ticket",
      "type": "n8n-nodes-base.jira",
      "position": [
        1952,
        656
      ]
    },
    {
      "id": "6361af2f-cfa3-48dc-ab18-3ccf4f825000",
      "name": "Slack Finance Notification",
      "type": "n8n-nodes-base.slack",
      "position": [
        2192,
        656
      ]
    }
  ],
  "connections": {
    "AI Analysis": {
      "main": [
        [
          {
            "node": "Priority Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Payload Valid?": {
      "main": [
        [
          {
            "node": "AI Analysis",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Slack Error Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Priority Switch": {
      "main": [
        [
          {
            "node": "Set High Priority",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Standard Priority",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Payload": {
      "main": [
        [
          {
            "node": "Payload Valid?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set High Priority": {
      "main": [
        [
          {
            "node": "Create Jira Finance Ticket",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Standard Priority": {
      "main": [
        [
          {
            "node": "Create Jira Finance Ticket",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook - Payment Failed": {
      "main": [
        [
          {
            "node": "Validate Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Jira Finance Ticket": {
      "main": [
        [
          {
            "node": "Slack Finance Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}