{
  "name": "Send Stripe expired charge recovery reminders with OpenAI",
  "nodes": [
    {
      "id": "51e8deea-68e5-48e5-97bf-81bf43732b3f",
      "name": "Charge Expired Event",
      "type": "n8n-nodes-base.stripeTrigger",
      "position": [
        352,
        -48
      ]
    },
    {
      "id": "c4411bfd-e3ac-4b27-92e5-e6fbf665278c",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        576,
        -48
      ]
    },
    {
      "id": "c11a0736-62f3-45be-b67a-3335b82db498",
      "name": "Extract Customer & Payment Data",
      "type": "n8n-nodes-base.set",
      "position": [
        800,
        -48
      ]
    },
    {
      "id": "418a2afb-c6f2-47b1-8dc1-39323267dc52",
      "name": "Generate Payment Reminder",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1024,
        -48
      ]
    },
    {
      "id": "bf61a8fe-ec12-48c7-88d8-9b51a521e027",
      "name": "Create New Invoice",
      "type": "n8n-nodes-base.stripe",
      "position": [
        1376,
        -48
      ]
    },
    {
      "id": "55b5ed7b-2759-4683-9b2d-fce31b7a6ed9",
      "name": "Send Reminder Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1600,
        -48
      ]
    },
    {
      "id": "19340ba5-67d4-4691-b5cb-a6ef87a956d5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -240
      ],
      "parameters": {
        "width": 432,
        "height": 624,
        "content": "## Overview\nThis workflow automatically handles expired or failed Stripe payments. When a charge expires, it triggers the workflow, drafts a professional AI-generated payment reminder, creates a new S"
      }
    },
    {
      "id": "30ffcfa8-684b-4019-81bd-68c87db774db",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        -256
      ],
      "parameters": {
        "width": null,
        "height": 464,
        "content": "## Stripe\n\nListen for 'charge.expired' or 'invoice.payment_failed' events in Stripe. Make sure the credentials are connected.\n"
      }
    },
    {
      "id": "a0df4841-bc5e-4bf2-a6cd-03b64aaa30fe",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        -256
      ],
      "parameters": {
        "width": 384,
        "height": 480,
        "content": "## Configure \n\nMap the following fields:\n- Customer name\n- Customer email\n- Charge amount\n- Previous invoice ID\n- Currency\n"
      }
    },
    {
      "id": "1dae3263-6b77-4965-be05-c29eab19ba86",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        -256
      ],
      "parameters": {
        "width": 368,
        "height": 480,
        "content": "## AI prompt example:\n\"Write a professional, friendly payment reminder for {customer_name} regarding their expired charge of {amount} {currency}. Mention that a new invoice has been generated. Keep it"
      }
    },
    {
      "id": "b3ae0fd4-53d5-4351-b905-f734d29b499d",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1344,
        -256
      ],
      "parameters": {
        "width": null,
        "height": 480,
        "content": "## New Invoice\n\nCreate a new invoice for the customer with the same amount and currency. Use previous invoice metadata to reference subscription or product.\n"
      }
    },
    {
      "id": "bc7fac2b-ea52-4537-9a2e-21be273b78fa",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        -256
      ],
      "parameters": {
        "width": null,
        "height": 480,
        "content": "## Send\n\nSend the AI-generated reminder to the customer via email or alert internal staff on Slack. Ensure no sensitive data is exposed.\n"
      }
    }
  ],
  "connections": {
    "Create New Invoice": {
      "main": [
        [
          {
            "node": "Send Reminder Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Charge Expired Event": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Extract Customer & Payment Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Payment Reminder": {
      "main": [
        [
          {
            "node": "Create New Invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Customer & Payment Data": {
      "main": [
        [
          {
            "node": "Generate Payment Reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}