{
  "name": "Generate HR offer letters and contracts with GPT-4.1-mini and Google Docs",
  "nodes": [
    {
      "id": "f18976c8-bd79-424f-8bf3-10f6f2d003c7",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        16
      ],
      "parameters": {
        "width": 480,
        "height": 176,
        "content": "## AI Generation & Google Docs Save\n\nAI fills all template placeholders with actual\ncandidate data while preserving formatting, then\nsaves the final document to Google Docs."
      }
    },
    {
      "id": "ff59c2fb-009b-4615-8f1f-232d3af40913",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        16
      ],
      "parameters": {
        "width": 576,
        "height": 240,
        "content": "## Template Selection & Loading\n\nChecks if the user selected \"Offer Letter\" or\n\"Contract\", then loads the appropriate template\nwith all placeholders ready for AI filling."
      }
    },
    {
      "id": "d88f0685-9b44-454e-a6ac-316f51d11ab8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1072,
        16
      ],
      "parameters": {
        "width": 512,
        "height": 192,
        "content": "## Form Submission & Document Processing\n\nReceives candidate details via form, splits\nuploaded Indentity card and Resume files, then extracts\ntext from both PDFs and merges the data."
      }
    },
    {
      "id": "681a25ee-79db-4803-817e-037961a3c2c5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1744,
        -160
      ],
      "parameters": {
        "width": 432,
        "height": 832,
        "content": "## AI-Powered HR Document Generator\n\nThis workflow automatically generates professional Offer Letters\nor Employment Contracts for new hires. HR submits a form with\nthe candidate's documents (Identity "
      }
    },
    {
      "id": "3a9e1ad1-867e-41a4-aa5a-0895b12b45d1",
      "name": "Save Document to Google Docs",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        656,
        144
      ]
    },
    {
      "id": "78e62aa7-6027-442c-a9b5-f2ef49ec12c8",
      "name": "OpenAI GPT-4.1 Mini Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        272,
        384
      ]
    },
    {
      "id": "5b3b0775-cfac-48bd-a60c-1a27dcc40ba5",
      "name": "Fill Template with AI",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        272,
        144
      ]
    },
    {
      "id": "fcb486d1-484b-465b-a3aa-8b72e1d52c5a",
      "name": "Load Contract Template",
      "type": "n8n-nodes-base.set",
      "position": [
        0,
        256
      ]
    },
    {
      "id": "5695158d-2afe-4006-a864-6cf8ec723671",
      "name": "Load Offer Letter Template",
      "type": "n8n-nodes-base.set",
      "position": [
        0,
        48
      ]
    },
    {
      "id": "0b868d5a-8ca7-4ba0-baa7-44d940fc8b1a",
      "name": "Check Document Type Selection",
      "type": "n8n-nodes-base.if",
      "position": [
        -480,
        160
      ]
    },
    {
      "id": "a0061fac-29cb-4bb1-b007-1d9361b4351e",
      "name": "Merge Extracted Document Texts",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -656,
        160
      ]
    },
    {
      "id": "c9657af8-bc03-4456-8e30-8f1d9e1b05cc",
      "name": "Extract Text from Aadhar and Resume",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -864,
        160
      ]
    },
    {
      "id": "8019d0ae-1771-4407-914f-d5b0595a7733",
      "name": "Split Documents and Calculate Dates",
      "type": "n8n-nodes-base.code",
      "position": [
        -1072,
        160
      ]
    },
    {
      "id": "6ae56a05-adc8-4efa-ae15-eb501f691482",
      "name": "Receive Candidate Details via Form",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -1280,
        160
      ]
    }
  ],
  "connections": {
    "Fill Template with AI": {
      "main": [
        [
          {
            "node": "Save Document to Google Docs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load Contract Template": {
      "main": [
        [
          {
            "node": "Fill Template with AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI GPT-4.1 Mini Model": {
      "ai_languageModel": [
        [
          {
            "node": "Fill Template with AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Load Offer Letter Template": {
      "main": [
        [
          {
            "node": "Fill Template with AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Document Type Selection": {
      "main": [
        [
          {
            "node": "Load Offer Letter Template",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Load Contract Template",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Extracted Document Texts": {
      "main": [
        [
          {
            "node": "Check Document Type Selection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Candidate Details via Form": {
      "main": [
        [
          {
            "node": "Split Documents and Calculate Dates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Text from Aadhar and Resume": {
      "main": [
        [
          {
            "node": "Merge Extracted Document Texts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Documents and Calculate Dates": {
      "main": [
        [
          {
            "node": "Extract Text from Aadhar and Resume",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}