{
  "name": "Insurance Renewal Reminder Emails",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -680,
        20
      ],
      "typeVersion": 1,
      "id": "489a05a3-d18f-4aca-a6a3-d709cc8f243f"
    },
    {
      "parameters": {
        "sendTo": "={{ $json.Email }}",
        "subject": "=Your Policy is Expiring Soon!",
        "emailType": "text",
        "message": "=Dear {{ $('Find Data').item.json.ClientName }},\n\nYour {{ $json.PolicyType }} policy with Policy No: {{ $('Find Data').item.json.PolicyNumber }}) is expiring on {{ $('Find Data').item.json[\"Expired Date\"] }}.\n\nPlease get in touch with us right away to renew and avoid any lapse in coverage.\n\nBest regards,\nForgent Systems Team",
        "options": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        -100,
        -60
      ],
      "id": "3fd30126-36f6-49a3-bfab-d90c9276ffa3",
      "name": "Alert For Renewal Insurance",
      "webhookId": "79009e5b-4065-44e2-b91a-23d031fc1235",
      "credentials": {
        "gmailOAuth2": {
          "id": "uDat96OaUczrGBW5",
          "name": "Gmail account"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "eff6fe23-651d-474d-8d77-3734e1ac4c13",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json['Expired Date'] }}",
              "rightValue": "={{ $('Schedule Trigger').item.json.timestamp }}"
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "22f470c0-0871-4af0-a06c-be93fc37bba8",
      "name": "Check Expired or Not",
      "type": "n8n-nodes-base.if",
      "position": [
        -320,
        20
      ],
      "typeVersion": 2.2
    },
    {
      "parameters": {
        "operation": "search",
        "base": {
          "__rl": true,
          "value": "appPpy7OlMovX9FcB",
          "mode": "list",
          "cachedResultName": "SaaS Support Management"
        },
        "table": {
          "__rl": true,
          "value": "tblBhCA68uGhUFOqG",
          "mode": "list",
          "cachedResultName": "Insurance"
        },
        "filterByFormula": "=AND(\n  {Expired Date},\n  DATETIME_DIFF({Expired Date}, TODAY(), 'days') <= 30\n)\n",
        "options": {}
      },
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2.1,
      "position": [
        -500,
        20
      ],
      "id": "2d1ef28a-67a7-4d75-823b-8560590de39c",
      "name": "Find Data",
      "credentials": {
        "airtableTokenApi": {
          "id": "BZ3w6czydL0CijHy",
          "name": "Airtable account"
        }
      }
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        -100,
        140
      ],
      "id": "db1ac6ae-4608-435c-9342-182dc6fb594f",
      "name": "No Operation, do nothing"
    }
  ],
  "pinData": {},
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Find Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Expired or Not": {
      "main": [
        [
          {
            "node": "Alert For Renewal Insurance",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Data": {
      "main": [
        [
          {
            "node": "Check Expired or Not",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ff5ec2b5-32c5-4b73-aa95-852d49cc40d8",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "f1c26778ec36097a9722a22c47c5e9c01f00b8862dadd0121ec118026a370fa6"
  },
  "id": "nTrjePFIRENF3Zin"
}