{
  "id": "W8p4kQ8pVnmKUUAq",
  "name": "Resume Intake Automation",
  "tags": [],
  "nodes": [
    {
      "id": "a3007648-4297-4fc0-a8ea-a26f0537355a",
      "name": "New Resume Email Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -1488,
        48
      ],
      "parameters": {
        "simple": false,
        "filters": {
          "q": "has:attachment (filename:pdf OR filename:doc OR filename:docx)"
        },
        "options": {
          "downloadAttachments": true,
          "dataPropertyAttachmentsPrefixName": "attachment_"
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "typeVersion": 1.4
    },
    {
      "id": "7c00bf12-464a-4bb5-b04f-5e765752c086",
      "name": "Check Candidate Name Exists",
      "type": "n8n-nodes-base.if",
      "position": [
        -576,
        32
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "3e878a0f-8067-4030-b7cb-4cd9ab1ab178",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              },
              "leftValue": "={{ $json[\"Candidate Name\"] }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "2a7e5758-3a96-4ab2-a3a4-699f99030ae4",
      "name": "Skip - Invalid/Empty Extraction",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -320,
        272
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "7106b2ee-9924-447c-ba4c-0701f0d90be3",
      "name": "Generate Filename & Document ID",
      "type": "n8n-nodes-base.code",
      "position": [
        -320,
        16
      ],
      "parameters": {
        "jsCode": "const candidateName = ($json[\"Candidate Name\"] || \"Candidate\").replace(/\\s+/g, \"_\");\nconst positionRole = ($json[\"Position Applied For\"] || \"Role\").replace(/\\s+/g, \"_\");\n\n// File ka base name build kar rahe hain\nconst generatedName = `${candidateName}_${positionRole}`;\n\nreturn {\n  json: {\n    ...$json,\n    baseFilename: generatedName\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "a9326eed-27f9-4ae4-8db3-f8db3a5a7b1e",
      "name": "AI Fit Score Generator",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -144,
        -64
      ],
      "parameters": {
        "text": "=You are an HR screening assistant. Based on the candidate details below, give a single fit score from 1 (poor fit) to 10 (excellent fit) for the applied position. Reply with ONLY the number, nothing else \u2014 no words, no punctuation.\n\nCandidate Name: {{ $json[\"Candidate Name\"] }}\nPosition Applied For: {{ $json[\"Position Applied For\"] }}\nYears of Experience: {{ $json[\"Years of Experience\"] }}\nKey Skills: {{ $json[\"Key Skills\"] }}",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 3.1
    },
    {
      "id": "06c2320e-a344-4aca-94b0-ee075a118ea9",
      "name": "Groq LLM (Scoring Model)",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        -144,
        176
      ],
      "parameters": {
        "model": "openai/gpt-oss-20b",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "cae995c3-cb8d-4bfb-af70-6dc2cc43f1a3",
      "name": "Download Original Resume File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        240,
        -64
      ],
      "parameters": {
        "url": "=https://app.parseur.com/api/v1/documents/{{ $('Parseur Trigger').item.json.DocumentID }}/download",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        },
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.4
    },
    {
      "id": "c7afc42e-7947-4e64-81f4-f39fdbf7670b",
      "name": "Upload Resume to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        496,
        -64
      ],
      "parameters": {
        "name": "={{ $('Generate Filename & Document ID').item.json.baseFilename }}.docx",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultName": "/ (Root folder)"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "6d750778-f598-4a87-b42a-c4edc67cb7a2",
      "name": "Log Candidate to Tracker Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        768,
        -64
      ],
      "parameters": {
        "columns": {
          "value": {
            "Email": "={{ $('Generate Filename & Document ID').item.json.Email || $('Parseur Trigger').item.json.Email }}",
            "Phone": "={{ \"'\" + $('Generate Filename & Document ID').item.json[\"Phone\"] }}",
            "Fit Score": "={{ Number($('AI Fit Score Generator').item.json.output) }}",
            "Key Skills": "={{ $('Generate Filename & Document ID').item.json[\"Key Skills\"] }}",
            "Resume Link": "={{ $json.webViewLink }}",
            "Date Applied": "={{ $now.format(\"yyyy-MM-dd\") }}",
            "Candidate Name": "={{ $('Generate Filename & Document ID').item.json[\"Candidate Name\"] }}",
            "Years of Experience": "={{ $('Parseur Trigger').item.json[\"Years of Experiance\"] || $('Generate Filename & Document ID').item.json[\"Years of Experience\"] || $('Generate Filename & Document ID').item.json[\"Years of Experiance\"] }}",
            "Position Applied For": "={{ $('Generate Filename & Document ID').item.json[\"Position Applied For\"] }}"
          },
          "schema": [
            {
              "id": "Candidate Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Candidate Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Phone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Position Applied For",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Position Applied For",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Years of Experience",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Years of Experience",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Key Skills",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Key Skills",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Resume Link",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Resume Link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Date Applied",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Date Applied",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Fit Score",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Fit Score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Email"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Nip6tllqsaDFq3hqzgs4_qqAXeinzH_byFYuc4IBgKI/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Nip6tllqsaDFq3hqzgs4_qqAXeinzH_byFYuc4IBgKI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Nip6tllqsaDFq3hqzgs4_qqAXeinzH_byFYuc4IBgKI/edit?usp=drivesdk",
          "cachedResultName": "Candidate Tracker"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "ce66060a-e234-4544-b0c8-d443e43fca07",
      "name": "Parseur Trigger",
      "type": "n8n-nodes-parseur.parseurTrigger",
      "position": [
        -896,
        48
      ],
      "parameters": {
        "parserId": 204614
      },
      "credentials": {},
      "typeVersion": 1
    },
    {
      "id": "7389c90a-284d-4ab6-a52f-4dd2557824b7",
      "name": "Parseur",
      "type": "n8n-nodes-parseur.parseur",
      "position": [
        -1200,
        80
      ],
      "parameters": {
        "parserId": 204614,
        "binaryPropertyName": "attachment_0"
      },
      "credentials": {},
      "typeVersion": 1
    },
    {
      "id": "ae87a2a9-5c5a-4e75-ac2e-cfb834c749e6",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2320,
        -272
      ],
      "parameters": {
        "width": 624,
        "height": 768,
        "content": "## Resume Intake Automation\n### How It Works\n* **Email Trigger:** Watches a Gmail inbox for new messages with a PDF/DOC/DOCX attachment.\n* **Parseur Upload:** Sends the resume to Parseur for extraction, then waits for Parseur's own webhook to fire once parsing is complete.\n* **AI Fit Scoring:** Once candidate details are validated, an LLM (via Groq) scores the candidate's fit for the applied position on a scale of 1\u201310.\n### Setup Checklist\n1. **Gmail:** Confirm the Gmail trigger's credentials and that the filter (`has:attachment` + pdf/doc/docx) matches how resumes actually arrive.\n2. **Parseur:** Connect Parseur credentials to both the upload node and the `Parseur Trigger` webhook node, and confirm the `parserId` matches your resume template.\n3. **Groq:** Verify the Groq API credentials and that the model (`openai/gpt-oss-20b`) is still available on your account.\n### Customization\n* **Fit score threshold:** Add a filter after the AI Fit Score Generator to auto-flag or notify on high-scoring candidates.\n* **File type:** The Drive upload is hardcoded to `.docx` \u2014 adjust the filename expression if resumes arrive as PDFs too.\n* **Empty extractions:** The \"Skip - Invalid/Empty Extraction\" branch currently does nothing further \u2014 consider logging skipped resumes somewhere for review."
      },
      "typeVersion": 1
    },
    {
      "id": "116e3d96-9eee-4a6f-8581-c8ea04cfa176",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1568,
        -256
      ],
      "parameters": {
        "color": 7,
        "width": 512,
        "height": 560,
        "content": "## 1. Capture & Parse Resume\nWatches the inbox for incoming resume emails and uploads any attached PDF/DOC/DOCX straight to Parseur for extraction."
      },
      "typeVersion": 1
    },
    {
      "id": "7898524d-07a6-4e8f-9c6f-bc629f739cea",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -976,
        -256
      ],
      "parameters": {
        "color": 7,
        "width": 1088,
        "height": 736,
        "content": "## 2. Validate & Score Candidate\nChecks that a candidate name was actually extracted, builds a filename, then uses an LLM to generate a 1\u201310 fit score based on experience and skills."
      },
      "typeVersion": 1
    },
    {
      "id": "058249dd-bb63-4739-ab0a-fe3937d1c319",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        -240
      ],
      "parameters": {
        "color": 7,
        "width": 848,
        "height": 480,
        "content": "## 3. Archive & Track\nDownloads the original resume file, uploads it to Google Drive, and logs the candidate's details, resume link, and fit score to the tracker sheet."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "c0aa496d-3a73-4462-ad07-10bcb0485c2a",
  "nodeGroups": [],
  "connections": {
    "Parseur Trigger": {
      "main": [
        [
          {
            "node": "Check Candidate Name Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Fit Score Generator": {
      "main": [
        [
          {
            "node": "Download Original Resume File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Groq LLM (Scoring Model)": {
      "ai_languageModel": [
        [
          {
            "node": "AI Fit Score Generator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "New Resume Email Trigger": {
      "main": [
        [
          {
            "node": "Parseur",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Candidate Name Exists": {
      "main": [
        [
          {
            "node": "Generate Filename & Document ID",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Skip - Invalid/Empty Extraction",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Original Resume File": {
      "main": [
        [
          {
            "node": "Upload Resume to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Resume to Google Drive": {
      "main": [
        [
          {
            "node": "Log Candidate to Tracker Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Filename & Document ID": {
      "main": [
        [
          {
            "node": "AI Fit Score Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}