{
  "name": "Generating tax summaries from Stripe, storing in Google Sheets, and sending Slack alerts",
  "nodes": [
    {
      "id": "1ef1afae-2f4e-42b4-bcbe-04879dc757fc",
      "name": "Tax Summary Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        -112
      ],
      "parameters": {
        "width": 389,
        "height": 704,
        "content": "## 📊 Stripe Tax Summary Reporting Automation\n\nThis workflow automatically generates comprehensive tax summaries from your Stripe invoices, providing detailed breakdowns by country, state, and tax rate"
      }
    },
    {
      "id": "83f6e13b-315c-4bcd-a2af-9aeba3d657da",
      "name": "Processing Schedule",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        768,
        -512
      ],
      "parameters": {
        "width": 300,
        "height": 508,
        "content": "## ⏰ Daily Tax Processing Schedule\n\nRuns every day at 2 AM to process tax data from the previous 30 days.\n\n**Cron Expression:** `0 2 * * *`\n- 0: minute (0)\n- 2: hour (2 AM)\n- *: any day of month\n- *: "
      }
    },
    {
      "id": "acac1ac0-6818-4dc4-9d97-52ab8a45103e",
      "name": "Daily Tax Processing Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        944,
        16
      ]
    },
    {
      "id": "9ea1dc34-54b0-431a-a99b-d8b034a035c6",
      "name": "Stripe Data Fetch",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1008,
        224
      ],
      "parameters": {
        "width": 300,
        "height": 580,
        "content": "## 💳 Stripe Invoice Data Retrieval\n\nFetches paid invoices with expanded tax information from Stripe API.\n\n**Current Issues:**\n- Using HTTP Request instead of native Stripe node\n- Manual API endpoint m"
      }
    },
    {
      "id": "99ff779c-2996-40b0-ac06-849a83de75f1",
      "name": "Fetch Paid Invoices with Tax Data",
      "type": "n8n-nodes-base.stripe",
      "position": [
        1168,
        16
      ]
    },
    {
      "id": "601354df-03e6-4009-8315-103cf865a3e3",
      "name": "Data Validation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1248,
        -528
      ],
      "parameters": {
        "width": 300,
        "height": 504,
        "content": "## ✅ Data Validation Check\n\nValidates that invoice data was successfully retrieved before processing.\n\n**Validation Logic:**\n- Checks if data array exists\n- Verifies data array has length > 0\n- Preven"
      }
    },
    {
      "id": "350fd6f2-70d7-4857-b7d5-9dfb3429e161",
      "name": "Validate Invoice Data Exists",
      "type": "n8n-nodes-base.if",
      "position": [
        1376,
        16
      ]
    },
    {
      "id": "6f79bead-6312-47ce-90de-aed6ebb86e61",
      "name": "Tax Processing Logic",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1568,
        -704
      ],
      "parameters": {
        "width": 300,
        "height": 616,
        "content": "## 🧮 Tax Data Processing Engine\n\nAdvanced tax calculation and summary generation from Stripe invoice data.\n\n**Processing Logic:**\n1. **Period Grouping**: Groups by year-month (YYYY-MM)\n2. **Jurisdicti"
      }
    },
    {
      "id": "d4547ae7-4cff-465e-9502-982ab05be9e9",
      "name": "Calculate Tax Summary by Jurisdiction",
      "type": "n8n-nodes-base.code",
      "position": [
        1600,
        -64
      ]
    },
    {
      "id": "1b14a11e-dabf-40c4-88af-cbde96cfe81b",
      "name": "Data Preparation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1776,
        96
      ],
      "parameters": {
        "width": 300,
        "height": 536,
        "content": "## 📋 Data Preparation for Sheets\n\nFormats tax summary data for Google Sheets logging.\n\n**Data Mapping:**\n- Period: YYYY-MM format\n- Country: ISO country code\n- State: State/province code\n- Tax Rate: P"
      }
    },
    {
      "id": "67fc5b14-e826-488c-9bfa-ef2573af3fa7",
      "name": "Format Data for Google Sheets",
      "type": "n8n-nodes-base.set",
      "position": [
        1824,
        -64
      ]
    },
    {
      "id": "c56bec91-eb1f-4194-92be-7c300542359b",
      "name": "Sheets Integration",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1952,
        -704
      ],
      "parameters": {
        "width": 300,
        "height": 576,
        "content": "## 📊 Google Sheets Tax Report\n\n**Security Issues:**\n- Hardcoded Google Sheets document ID exposed\n- Personal email in credential name\n\n**Fix Required:**\nReplace hardcoded values with environment varia"
      }
    },
    {
      "id": "92c6ab15-5988-417a-8622-4f531c18f2d8",
      "name": "Update Tax Summary Spreadsheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2048,
        -64
      ]
    },
    {
      "id": "489bb7df-223a-462a-9526-3f7caa35eb8d",
      "name": "Success Notification",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2272,
        112
      ],
      "parameters": {
        "width": 300,
        "height": 540,
        "content": "## 📢 Success Notification Setup\n\n**Security Issues:**\n- Hardcoded Slack channel ID exposed\n- Personal credential reference\n\n**Fix Required:**\nReplace hardcoded values with environment variables:\n- `$e"
      }
    },
    {
      "id": "ab64553d-7549-46b3-8b2d-1e7867f2d992",
      "name": "Send Success Notification to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        2272,
        -64
      ]
    },
    {
      "id": "257f1d24-e589-404e-8ab6-5f0e42ef95db",
      "name": "Error Handling",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1424,
        320
      ],
      "parameters": {
        "width": 300,
        "height": 504,
        "content": "## ❌ Error Notification Setup\n\n**Security Issues:**\n- Hardcoded Slack channel ID exposed\n- Personal credential reference\n\n**Fix Required:**\nReplace with environment variables:\n- `$env.SLACK_CHANNEL_ID"
      }
    },
    {
      "id": "8fcfa5cf-9d4c-4e36-b18e-0bb8450854aa",
      "name": "Send Error Notification to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        1600,
        144
      ]
    }
  ],
  "connections": {
    "Daily Tax Processing Trigger": {
      "main": [
        [
          {
            "node": "Fetch Paid Invoices with Tax Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Invoice Data Exists": {
      "main": [
        [
          {
            "node": "Calculate Tax Summary by Jurisdiction",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Error Notification to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Data for Google Sheets": {
      "main": [
        [
          {
            "node": "Update Tax Summary Spreadsheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Tax Summary Spreadsheet": {
      "main": [
        [
          {
            "node": "Send Success Notification to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Paid Invoices with Tax Data": {
      "main": [
        [
          {
            "node": "Validate Invoice Data Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Tax Summary by Jurisdiction": {
      "main": [
        [
          {
            "node": "Format Data for Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}