{
  "name": "Automate employee reimbursement workflow with Gmail, Google Drive & AI validation",
  "nodes": [
    {
      "id": "62704744-327d-4ba6-9c50-27aabe2fbca5",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -1060,
        -920
      ]
    },
    {
      "id": "03b7edb5-2f55-48a4-9fbb-9c230f45df70",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        -420,
        -940
      ]
    },
    {
      "id": "6393835a-0680-482d-86eb-fd9703a562ff",
      "name": "if Bill Exists",
      "type": "n8n-nodes-base.if",
      "position": [
        -660,
        -1080
      ]
    },
    {
      "id": "548f0d70-643c-4ef5-861a-5ad584a40321",
      "name": "Download Existing Bill",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -280,
        -1100
      ]
    },
    {
      "id": "0127a1b4-5a2e-42a6-b2bc-7476dd7bf817",
      "name": "Mail Invalid Claim",
      "type": "n8n-nodes-base.gmail",
      "position": [
        720,
        -1180
      ]
    },
    {
      "id": "13253bbd-890a-49b2-a89e-821575f298dc",
      "name": "Mail Valid Claim",
      "type": "n8n-nodes-base.gmail",
      "position": [
        880,
        -980
      ]
    },
    {
      "id": "ca855f2a-c40e-4dec-845c-8b7b0d81b330",
      "name": "MergeInputs",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        100,
        -1100
      ]
    },
    {
      "id": "de6eb222-2e33-4277-8cfb-45042e6902e3",
      "name": "Validate False Claims",
      "type": "n8n-nodes-base.code",
      "position": [
        260,
        -1100
      ]
    },
    {
      "id": "34b61b4d-a314-4d3d-9e9a-806c5a747ce4",
      "name": "Upload_Bills",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -260,
        -940
      ]
    },
    {
      "id": "bf47788d-8326-4524-b0e4-58cfc453da72",
      "name": "Download_Bills",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -100,
        -940
      ]
    },
    {
      "id": "b9ae6568-76dd-4605-8402-765a25e850ed",
      "name": "Search_Bill",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -840,
        -1080
      ]
    },
    {
      "id": "b9a932ea-9404-453d-b45d-1ced96120d57",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        420,
        -1100
      ]
    },
    {
      "id": "7182bbde-016f-4ff0-abb9-43dcf82f9bf2",
      "name": "Add Request",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        720,
        -980
      ]
    },
    {
      "id": "64793a3d-e3d1-462a-8870-4af280f81423",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1300,
        -1000
      ],
      "parameters": {
        "width": 380,
        "height": 220,
        "content": "## Submit Form\nThis form will get all required information from the user and pass it to other nodes\n"
      }
    },
    {
      "id": "cb6b5988-9eb9-4686-9f5b-3a2ce92179d9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        -1260
      ],
      "parameters": {
        "width": 360,
        "height": 340,
        "content": "## Validate User Uploaded Bills.\n\nValidate if the user uploaded bill already exists into the system.\n\nIf **Yes** then reuse and download for proccesing.\n**Else** -- Upload the bill and then use for pr"
      }
    },
    {
      "id": "b1501bda-4ad4-45a0-9b95-322d307b3688",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        -1180
      ],
      "parameters": {
        "width": 520,
        "height": 560,
        "content": "## Uploads and Downloads\nIf **Bills Already Exist]** Download the file and send to next node for OCR.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nIf **Bills Does not Exists**\n- **Merge** - This node will get the user "
      }
    },
    {
      "id": "46d1de94-b727-450e-adc2-10e424f39291",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        60,
        -1300
      ],
      "parameters": {
        "width": 500,
        "height": 360,
        "content": "## Extract, Validate\nThese nodes will \n- Extract the content from the bill\n- Validate if the claim made by the user is correct. Whether the amount claimed and the amount from the bill match.\n- If **fa"
      }
    },
    {
      "id": "45aa008a-5f9f-41ed-b7ba-0473edf9a597",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        680,
        -1240
      ],
      "parameters": {
        "width": 280,
        "height": 220,
        "content": "## Invalid Claim\n\n"
      }
    },
    {
      "id": "5391e33a-7b73-43d6-9a13-444ccf6840e8",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        680,
        -1000
      ],
      "parameters": {
        "width": 380,
        "height": 300,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Valid Claim\n- Notify User with the request id.\n- Notify Finance Team to proceed with review."
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Mail Invalid Claim",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Upload_Bills",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Request": {
      "main": [
        [
          {
            "node": "Mail Valid Claim",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MergeInputs": {
      "main": [
        [
          {
            "node": "Validate False Claims",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search_Bill": {
      "main": [
        [
          {
            "node": "if Bill Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload_Bills": {
      "main": [
        [
          {
            "node": "Download_Bills",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download_Bills": {
      "main": [
        [
          {
            "node": "MergeInputs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "if Bill Exists": {
      "main": [
        [
          {
            "node": "Download Existing Bill",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mail Valid Claim": {
      "main": [
        []
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Search_Bill",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Validate False Claims": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Existing Bill": {
      "main": [
        [
          {
            "node": "MergeInputs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}