N
n8n Store
Workflow Market
AI-Driven Tax Deadline Reminder & Compliance Alerts for Accounting

AI-Driven Tax Deadline Reminder & Compliance Alerts for Accounting

by oneclick-ai0 views

Description

Categories

🤖 AI & Machine Learning

Nodes Used

n8n-nodes-base.ifn8n-nodes-base.ifn8n-nodes-base.coden8n-nodes-base.coden8n-nodes-base.coden8n-nodes-base.coden8n-nodes-base.slackn8n-nodes-base.emailSendn8n-nodes-base.stickyNoten8n-nodes-base.stickyNote
PriceKostenlos
Views0
Last Updated11/28/2025
workflow.json
{
  "id": "hZXFMMh3gVl4u3K4",
  "meta": {
    "instanceId": "dd69efaf8212c74ad206700d104739d3329588a6f3f8381a46a481f34c9cc281",
    "templateCredsSetupCompleted": true
  },
  "name": "AI-Driven Tax Deadline Reminder & Compliance Alerts for Accounting",
  "tags": [],
  "nodes": [
    {
      "id": "ec99697c-9837-4945-8743-ad1099286938",
      "name": "Daily Tax Check",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2752,
        2336
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "566f5199-04e1-4bb4-9fb3-19eab294368a",
      "name": "Fetch Tax Calendar",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2528,
        2240
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "TaxCalendar"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_TAX_CALENDAR_ID"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "id": "ScSS2KxGQULuPtdy",
          "name": "Google Sheets- test"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "9f0f080c-568d-4145-a82f-39bf2849d72e",
      "name": "Fetch Company Config",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2528,
        2432
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "CompanyConfig"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_CONFIG_ID"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "id": "ScSS2KxGQULuPtdy",
          "name": "Google Sheets- test"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "fda19308-3460-4416-b4c2-d1dafb8a053e",
      "name": "Analyze Deadlines",
      "type": "n8n-nodes-base.code",
      "position": [
        -2304,
        2336
      ],
      "parameters": {
        "jsCode": "const taxCalendar = $('Fetch Tax Calendar').all();\nconst companyConfig = $('Fetch Company Config').first().json;\nconst now = new Date();\nconst today = now.toISOString().split('T')[0];\n\nconst getDaysDifference = (date1, date2) => {\n  const diffTime = new Date(date1) - new Date(date2);\n  return Math.ceil(diffTime / (1000 * 60 * 60 * 24));\n};\n\nconst jurisdictions = (companyConfig.Jurisdictions || 'Federal').split(',').map(j => j.trim());\nconst entityType = companyConfig.EntityType || 'Corporation';\n\nconst upcomingDeadlines = [];\nconst criticalDeadlines = [];\nconst overdueDeadlines = [];\n\ntaxCalendar.forEach(item => {\n  const deadline = item.json;\n  const deadlineDate = new Date(deadline.DeadlineDate);\n  const daysUntil = getDaysDifference(deadlineDate, now);\n  \n  if (deadline.IsActive !== 'TRUE' && deadline.IsActive !== true) return;\n  \n  const jurisdictionMatch = !deadline.Jurisdiction || jurisdictions.includes(deadline.Jurisdiction);\n  const entityMatch = !deadline.EntityType || deadline.EntityType === entityType || deadline.EntityType === 'All';\n  \n  if (!jurisdictionMatch || !entityMatch) return;\n  \n  const deadlineInfo = {\n    id: deadline.DeadlineID || `TAX-${Date.now()}`,\n    name: deadline.DeadlineName,\n    description: deadline.Description || '',\n    deadlineDate: deadline.DeadlineDate,\n    daysUntil: daysUntil,\n    jurisdiction: deadline.Jurisdiction || 'Federal',\n    category: deadline.Category || 'General',\n    assignedTo: deadline.AssignedTo || 'Finance Team',\n    penalties: deadline.Penalties || 'Standard penalties',\n    priority: 'Normal'\n  };\n  \n  if (daysUntil < 0) {\n    deadlineInfo.priority = 'Critical';\n    overdueDeadlines.push(deadlineInfo);\n  } else if (daysUntil <= 3) {\n    deadlineInfo.priority = 'Critical';\n    criticalDeadlines.push(deadlineInfo);\n    upcomingDeadlines.push(deadlineInfo);\n  } else if (daysUntil <= 7) {\n    deadlineInfo.priority = 'High';\n    upcomingDeadlines.push(deadlineInfo);\n  } else if (daysUntil <= 30) {\n    deadlineInfo.priority = 'Medium';\n    upcomingDeadlines.push(deadlineInfo);\n  }\n});\n\nreturn {\n  date: today,\n  timestamp: now.toISOString(),\n  jurisdictions: jurisdictions.join(', '),\n  entityType: entityType,\n  totalUpcoming: upcomingDeadlines.length,\n  criticalCount: criticalDeadlines.length,\n  overdueCount: overdueDeadlines.length,\n  next7Days: upcomingDeadlines.filter(d => d.daysUntil <= 7).length,\n  upcomingDeadlines: upcomingDeadlines,\n  criticalDeadlines: criticalDeadlines,\n  overdueDeadlines: overdueDeadlines,\n  requiresImmediateAction: overdueDeadlines.length > 0 || criticalDeadlines.length > 0,\n  alertLevel: overdueDeadlines.length > 0 ? 'CRITICAL' : criticalDeadlines.length > 0 ? 'HIGH' : 'MEDIUM'\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "18f3d827-6ffb-4ef9-9080-13a5bf65773b",
      "name": "AI Analysis",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2080,
        2336
      ],
      "parameters": {
        "url": "https://api.openai.com/v1/chat/completions",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"model\": \"gpt-4\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a tax compliance advisor. Analyze deadlines and provide insights.\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"Analyze these tax deadlines for {{ $json.date }}: {{ JSON.stringify($json.upcomingDeadlines) }}. Provide risk assessment and recommendations.\"\n    }\n  ]\n}",
        "sendBody": true,
        "specifyBody": "json"
      },
      "typeVersion": 4.2
    },
    {
      "id": "f077e19c-408e-48da-9bd8-51ce5332459f",
      "name": "Merge AI Insights",
      "type": "n8n-nodes-base.code",
      "position": [
        -1856,
        2336
      ],
      "parameters": {
        "jsCode": "const deadlineData = $('Analyze Deadlines').first().json;\nconst aiResponse = $input.first().json;\n\nlet aiInsights = 'AI analysis completed';\ntry {\n  aiInsights = aiResponse.choices[0].message.content;\n} catch (e) {\n  aiInsights = 'AI analysis unavailable';\n}\n\nreturn {\n  ...deadlineData,\n  aiInsights: aiInsights\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "5d987c19-ccb9-48cc-8070-11c355c8f55f",
      "name": "Has Deadlines",
      "type": "n8n-nodes-base.if",
      "position": [
        -1632,
        2336
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "number": [
            {
              "value1": "={{ $json.totalUpcoming }}",
              "value2": 0,
              "operation": "larger"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "db1f10ec-9594-4446-9c9d-c42321165efa",
      "name": "Is Critical",
      "type": "n8n-nodes-base.if",
      "position": [
        -1408,
        2240
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "boolean": [
            {
              "value1": "={{ $json.requiresImmediateAction }}",
              "value2": true
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "a8409e3e-720e-4163-b730-cfdfeb22a1b8",
      "name": "Format Email",
      "type": "n8n-nodes-base.code",
      "position": [
        -1184,
        2144
      ],
      "parameters": {
        "jsCode": "const data = $input.first().json;\n\nconst emailHtml = `\n<html>\n<body style=\"font-family: Arial; padding: 20px;\">\n  <div style=\"background: #1e3c72; color: white; padding: 30px; text-align: center;\">\n    <h1>Tax Compliance Alert</h1>\n    <p>${data.date} | Alert: ${data.alertLevel}</p>\n  </div>\n  <div style=\"padding: 20px;\">\n    <h3>Summary</h3>\n    <p><strong>Overdue:</strong> ${data.overdueCount}</p>\n    <p><strong>Critical (≤3 days):</strong> ${data.criticalCount}</p>\n    <p><strong>Next 7 Days:</strong> ${data.next7Days}</p>\n    <p><strong>Total Upcoming:</strong> ${data.totalUpcoming}</p>\n    ${data.overdueDeadlines.length > 0 ? `\n      <div style=\"background: #ffebee; padding: 15px; margin: 20px 0;\">\n        <h3 style=\"color: #c62828;\">OVERDUE DEADLINES</h3>\n        ${data.overdueDeadlines.map(dl => `\n          <p><strong>${dl.name}</strong><br>\n          Due: ${dl.deadlineDate} (${Math.abs(dl.daysUntil)} days overdue)<br>\n          Assigned: ${dl.assignedTo}</p>\n        `).join('')}\n      </div>\n    ` : ''}\n    ${data.criticalDeadlines.length > 0 ? `\n      <div style=\"background: #fff3e0; padding: 15px; margin: 20px 0;\">\n        <h3 style=\"color: #f57c00;\">CRITICAL DEADLINES</h3>\n        ${data.criticalDeadlines.map(dl => `\n          <p><strong>${dl.name}</strong><br>\n          Due: ${dl.deadlineDate} (${dl.daysUntil} days)<br>\n          Assigned: ${dl.assignedTo}</p>\n        `).join('')}\n      </div>\n    ` : ''}\n    <h3>AI Insights</h3>\n    <p>${data.aiInsights}</p>\n  </div>\n</body>\n</html>\n`;\n\nreturn {\n  ...data,\n  emailHtml: emailHtml,\n  emailSubject: `${data.alertLevel} Tax Alert - ${data.overdueCount} Overdue, ${data.criticalCount} Critical`\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "3153af6e-e5eb-4560-a406-14b85781064a",
      "name": "Send Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        -960,
        2144
      ],
      "webhookId": "cf96020d-2cb8-4a71-b6f6-d211a2c56dcd",
      "parameters": {
        "options": {},
        "subject": "={{ $json.emailSubject }}",
        "toEmail": "[email protected]",
        "fromEmail": "[email protected]"
      },
      "credentials": {
        "smtp": {
          "id": "G1kyF8cSWTZ4vouN",
          "name": "SMTP -test"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "a57f0035-73a4-4720-8de1-9315d6a28c3a",
      "name": "Format Slack",
      "type": "n8n-nodes-base.code",
      "position": [
        -1184,
        2336
      ],
      "parameters": {
        "jsCode": "const data = $input.first().json;\n\nconst blocks = [\n  {\n    type: \"header\",\n    text: {\n      type: \"plain_text\",\n      text: `Tax Alert - ${data.date}`,\n      emoji: true\n    }\n  },\n  {\n    type: \"section\",\n    fields: [\n      { type: \"mrkdwn\", text: `*Overdue:* ${data.overdueCount}` },\n      { type: \"mrkdwn\", text: `*Critical:* ${data.criticalCount}` },\n      { type: \"mrkdwn\", text: `*Next 7 Days:* ${data.next7Days}` },\n      { type: \"mrkdwn\", text: `*Total:* ${data.totalUpcoming}` }\n    ]\n  }\n];\n\nif (data.overdueDeadlines.length > 0) {\n  blocks.push({\n    type: \"section\",\n    text: {\n      type: \"mrkdwn\",\n      text: `*OVERDUE:*\\n${data.overdueDeadlines.map(dl => `• ${dl.name} - ${Math.abs(dl.daysUntil)} days overdue`).join('\\n')}`\n    }\n  });\n}\n\nif (data.criticalDeadlines.length > 0) {\n  blocks.push({\n    type: \"section\",\n    text: {\n      type: \"mrkdwn\",\n      text: `*CRITICAL:*\\n${data.criticalDeadlines.map(dl => `• ${dl.name} - ${dl.daysUntil} days left`).join('\\n')}`\n    }\n  });\n}\n\nreturn { ...data, slackBlocks: blocks };"
      },
      "typeVersion": 2
    },
    {
      "id": "12d16c58-99c9-4b5c-b35c-6ed7474f64a1",
      "name": "Send to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        -960,
        2336
      ],
      "webhookId": "65d9c2b2-262e-4881-aa9b-2979175cf756",
      "parameters": {
        "text": "=Tax Alert",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "C12345678"
        },
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "id": "MQ0fgwuS8AzfwFvy",
          "name": "Slack account - test "
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "6612a7be-3eb9-4283-b95f-e82867780a3c",
      "name": "Log to Sheet1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1408,
        2432
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "ComplianceLog"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_LOG_ID"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "id": "ScSS2KxGQULuPtdy",
          "name": "Google Sheets- test"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "67ad55a3-bd1e-4bab-bf9a-1787565461b7",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2784,
        2192
      ],
      "parameters": {
        "width": 182,
        "height": 304,
        "content": "**Daily Trigger** - Runs at 8:00 AM every morning\n"
      },
      "typeVersion": 1
    },
    {
      "id": "7f4c325c-81be-4e9c-ab74-400d75704a90",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2560,
        2048
      ],
      "parameters": {
        "color": 4,
        "width": 182,
        "height": 560,
        "content": "**Fetch Data** - Pulls tax calendar and company configuration from Google Sheets\n"
      },
      "typeVersion": 1
    },
    {
      "id": "8002d149-5674-4f60-a5c7-2ad68a0d2f10",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2336,
        2176
      ],
      "parameters": {
        "width": 182,
        "height": 304,
        "content": "**Analyze Deadlines** - Calculates days remaining, filters by jurisdiction/entity type, categorizes by priority\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e4d30c91-ff1a-4463-81e7-a88ee1175514",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2128,
        2176
      ],
      "parameters": {
        "color": 4,
        "width": 182,
        "height": 304,
        "content": "**AI Analysis** - GPT-4 provides strategic insights and risk assessment on upcoming deadlines\n"
      },
      "typeVersion": 1
    },
    {
      "id": "1402e736-4cbb-47a7-be96-237c269c5d19",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1888,
        2160
      ],
      "parameters": {
        "width": 614,
        "height": 400,
        "content": "**Smart Routing** - Only sends alerts if overdue or critical deadlines exist\n\n**Logging** - Records compliance check results to Google Sheets for audit trail\n"
      },
      "typeVersion": 1
    },
    {
      "id": "4ed27c59-2e95-471f-89ea-c5309aaa6afc",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        1856
      ],
      "parameters": {
        "color": 4,
        "width": 390,
        "height": 640,
        "content": "**Critical Alerts** - HTML email to executives + Slack alert for urgent items\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "1853f22a-7d32-4bf5-a7da-329e185512f5",
  "connections": {
    "AI Analysis": {
      "main": [
        [
          {
            "node": "Merge AI Insights",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Critical": {
      "main": [
        [
          {
            "node": "Format Email",
            "type": "main",
            "index": 0
          },
          {
            "node": "Format Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Email": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Slack": {
      "main": [
        [
          {
            "node": "Send to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has Deadlines": {
      "main": [
        [
          {
            "node": "Is Critical",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log to Sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Tax Check": {
      "main": [
        [
          {
            "node": "Fetch Tax Calendar",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Company Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Deadlines": {
      "main": [
        [
          {
            "node": "AI Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge AI Insights": {
      "main": [
        [
          {
            "node": "Has Deadlines",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Tax Calendar": {
      "main": [
        [
          {
            "node": "Analyze Deadlines",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Company Config": {
      "main": [
        [
          {
            "node": "Analyze Deadlines",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

相关工作流