{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "249178ff-d3c8-4964-9773-0d129a016680",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -624,
        -96
      ],
      "parameters": {
        "options": {
          "appendAttribution": false
        },
        "formTitle": "Resume Analysis",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Describe the Analysis to be done",
              "placeholder": "I want you to analyse these 3 resume and give the best qualified candidate",
              "requiredField": true
            },
            {
              "fieldType": "file",
              "fieldLabel": "Attach the resumes"
            }
          ]
        },
        "formDescription": "Upload the Candindates Resume/Cover letters"
      },
      "typeVersion": 2.3
    },
    {
      "id": "9ace62a7-b6fe-44c8-a001-85999a74126b",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        288,
        128
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "bf048711-8f47-46d9-9327-462106382092",
      "name": "Append row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        624,
        -96
      ],
      "parameters": {
        "columns": {
          "value": {
            "AI summary": "={{ $json.output }}"
          },
          "schema": [
            {
              "id": "AI summary",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "AI summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "AI summary"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 786529288,
          "cachedResultUrl": "https://docs.google.com/YOUR_AWS_SECRET_KEY_HERE-PVmGefaAlwOwR980Jk/edit#gid=786529288",
          "cachedResultName": "AI Summary"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1XbMRGqX6N2xP92ZF73LFd09f-PVmGefaAlwOwR980Jk",
          "cachedResultUrl": "https://docs.google.com/YOUR_AWS_SECRET_KEY_HERE-PVmGefaAlwOwR980Jk/edit?usp=drivesdk",
          "cachedResultName": "Job pool sheet HR"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "848dfe51-f24d-454d-aebb-6ea4f275ac25",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        48,
        -96
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "text"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "99ac0bc9-3c9f-4365-985a-b485a2c3bd30",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -176,
        -96
      ],
      "parameters": {
        "options": {},
        "operation": "pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "a6077573-0cd1-49e2-ae44-46930de22be9",
      "name": "Resume analysis Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        272,
        -96
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemMessage": "={{ $('On form submission').item.json['Describe the Analysis to be done'] }} *Summarize the analysis into brief solid insights. \nOffer a general overall summary, based on all key aspects\nYour output response should capture indentity details and clean\n\nYour output must be plain texts no bold no #, no symbols, and less than 200words, easy to read through"
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "386cd86a-67b8-476e-919e-f27578c00b7e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        -336
      ],
      "parameters": {
        "width": 304,
        "height": 496,
        "content": "### How it works\nYou have several resumes you need to review manually? well this workflows allows you to upload upto 20 bunches pdf at once. AI does the heavy lifting, saving time, reducing repetive tasks and achieving high accuracy.\n\nThe job description and qualificattion goes under the agent System message.\n\n### Setup steps.\n**n8n Form** Allow multiple files submission\n**JavaScript Code** allow mapping of each file individually\n**System message** adjust the system message to fit the job description and qualification.\n**Google Sheet** [make a copy](https://docs.google.com/spreadsheets/d/1XbMRGqX6N2xP92ZF73LFd09f-PVmGefaAlwOwR980Jk/edit?gid=0#gid=0)"
      },
      "typeVersion": 1
    },
    {
      "id": "f50c8c14-57f3-45bc-922a-4a73f62bb53d",
      "name": "map files independently",
      "type": "n8n-nodes-base.code",
      "position": [
        -400,
        -96
      ],
      "parameters": {
        "jsCode": "const output = [];\n\nfor (const [key, value] of Object.entries(items[0].binary || {})) {\n  // Get original extension if available, fallback to mime type-derived\n  const originalName = value.fileName || 'unknown';\n  const extension = originalName.includes('.')\n    ? originalName.split('.').pop()\n    : (value.mimeType?.split('/')[1] || 'bin');\n  const fileName = originalName.includes('.')\n    ? originalName\n    : `unknown.${extension}`;\n\n  output.push({\n    binary: {\n      data: value\n    },\n    json: {\n      originalKey: key,\n      fileName: fileName,\n      mimeType: value.mimeType || 'unknown'\n    }\n  });\n}\n\nreturn output;\n"
      },
      "typeVersion": 2
    }
  ],
  "connections": {
    "Aggregate": {
      "main": [
        [
          {
            "node": "Resume analysis Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "map files independently",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Resume analysis Agent": {
      "main": [
        [
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "map files independently": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Resume analysis Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}