{
  "name": "Automatic invoice due date reminders from Stripe to Google Calendar",
  "nodes": [
    {
      "id": "12db8aa7-301c-48e9-b2b8-c4d6c4952a97",
      "name": "Workflow Description",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2400,
        -96
      ],
      "parameters": {
        "width": 389,
        "height": 592,
        "content": "## 📋 Stripe Invoice to Google Calendar Automation\n\nThis workflow automatically monitors Stripe invoices and creates Google Calendar reminders for invoices due within the next 7 days.\n\n### Key Features"
      }
    },
    {
      "id": "c4e5fef2-e9a0-407e-9c33-a7d30025daba",
      "name": "Schedule Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1872,
        -288
      ],
      "parameters": {
        "width": 300,
        "height": 320,
        "content": "## ⏰ Daily Schedule Setup\n\nConfigured to run every day at 8:00 AM using cron expression `0 8 * * *`\n\n**Setup Instructions:**\n1. Adjust the cron expression if needed\n2. Consider your timezone settings\n"
      }
    },
    {
      "id": "58ec67ec-fb91-4c04-9cb9-da017afe3065",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1664,
        64
      ]
    },
    {
      "id": "8bfcbc60-3af3-4204-b631-d3adce6f7c3f",
      "name": "Stripe Setup Guide",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2288,
        -592
      ],
      "parameters": {
        "width": 300,
        "height": 424,
        "content": "## 💳 Stripe API Configuration\n\n**Setup Steps:**\n1. Go to n8n Credentials\n2. Add new Stripe API credential\n3. Enter your Stripe Secret Key\n4. Test the connection\n\n**Query Parameters:**\n- `status=draft`"
      }
    },
    {
      "id": "72b75afe-0fef-46a3-b999-da3ccf3b1691",
      "name": "Get Stripe Invoices",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1472,
        64
      ]
    },
    {
      "id": "f6695758-d333-446e-8379-81096965ad30",
      "name": "Array Processing",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1536,
        224
      ],
      "parameters": {
        "width": 280,
        "height": 376,
        "content": "## 📋 Processing Invoice Array\n\nThe Stripe API returns invoices in a `data` array. This node splits the array so we can process each invoice individually.\n\n**What it does:**\n- Takes the `data` field fr"
      }
    },
    {
      "id": "a6aade30-8cbf-44dc-96b4-ead84be48371",
      "name": "Split Invoices",
      "type": "n8n-nodes-base.itemLists",
      "position": [
        -1248,
        64
      ]
    },
    {
      "id": "0c63a347-c22e-45d3-a85d-8ce9c00a2569",
      "name": "Date Filter Logic",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1184,
        -384
      ],
      "parameters": {
        "width": 280,
        "height": 416,
        "content": "## 🔍 Invoice Due Date Filter\n\nFilters invoices based on due date criteria:\n\n**Conditions (ALL must be true):**\n1. Invoice has a due date\n2. Due within next 7 days\n3. Due date is today or later\n\n**Logi"
      }
    },
    {
      "id": "007ad07d-634c-4cc1-b8e0-ad6f1c77a6ca",
      "name": "Filter Due Invoices",
      "type": "n8n-nodes-base.if",
      "position": [
        -1040,
        64
      ]
    },
    {
      "id": "3309ccc7-bdd4-4582-a584-6f702ca74f9f",
      "name": "Calendar API Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        256
      ],
      "parameters": {
        "width": 300,
        "height": 352,
        "content": "## 📅 Google Calendar Setup\n\n**Configuration Steps:**\n1. Create Google Calendar OAuth2 credentials\n2. Select your target calendar\n3. Set time range (next 30 days)\n\n**Purpose:**\nFetches existing calenda"
      }
    },
    {
      "id": "07d2cba4-0897-4735-8c1d-5a9c9cb11006",
      "name": "Google Calendar Get Events",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        -832,
        64
      ]
    },
    {
      "id": "30f03054-10a8-4683-9db8-158e1959f139",
      "name": "Duplicate Prevention",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -736,
        -368
      ],
      "parameters": {
        "width": 280,
        "height": 384,
        "content": "## 🔄 Duplicate Detection\n\n**Logic:**\n1. Extracts invoice IDs from existing calendar events\n2. Looks for pattern `invoice_id:XXXXXX` in event descriptions\n3. Compares current invoice ID with existing o"
      }
    },
    {
      "id": "8b12c8ec-4252-4490-9a49-cba0c75f5b0d",
      "name": "Check Invoice Exists",
      "type": "n8n-nodes-base.set",
      "position": [
        -624,
        64
      ]
    },
    {
      "id": "c70a542d-d544-469e-8fd3-d29324727a45",
      "name": "New Invoice Check",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        224
      ],
      "parameters": {
        "width": 280,
        "height": 312,
        "content": "## ✅ New Invoice Validation\n\n**Conditions (OR logic):**\n1. Invoice ID not found in existing events\n2. Current invoice ID exists and is valid\n\n**Result:**\nOnly new invoices (not already in calendar) wi"
      }
    },
    {
      "id": "a9703708-0584-4daf-90b3-e23b5b27410a",
      "name": "IF Not Exists",
      "type": "n8n-nodes-base.if",
      "position": [
        -416,
        64
      ]
    },
    {
      "id": "f7570c80-326a-4248-85ff-6730f80a1168",
      "name": "Calendar Event Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        -352
      ],
      "parameters": {
        "width": 300,
        "height": 384,
        "content": "## 📅 Create Calendar Reminder\n\n**Event Details:**\n- **Title:** \"Pending Invoice\"\n- **Start Time:** Invoice due date\n- **Duration:** 1 hour\n- **Description:** Includes invoice ID for tracking\n\n**Custom"
      }
    },
    {
      "id": "f57610fa-52d1-48f5-9a21-ac533ffcb1ac",
      "name": "Google Calendar Create Event",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        -208,
        64
      ]
    }
  ],
  "connections": {
    "IF Not Exists": {
      "main": [
        [
          {
            "node": "Google Calendar Create Event",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Invoices": {
      "main": [
        [
          {
            "node": "Filter Due Invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Stripe Invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Due Invoices": {
      "main": [
        [
          {
            "node": "Google Calendar Get Events",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Stripe Invoices": {
      "main": [
        [
          {
            "node": "Split Invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Invoice Exists": {
      "main": [
        [
          {
            "node": "IF Not Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Calendar Get Events": {
      "main": [
        [
          {
            "node": "Check Invoice Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}