{
  "name": "Score job applications and write AI feedback with OpenAI and Notion",
  "nodes": [
    {
      "id": "ec2e79fe-ba71-4527-868d-b02b2d37bb6b",
      "name": "Fetch Job Description",
      "type": "n8n-nodes-base.notion",
      "position": [
        -2192,
        3040
      ]
    },
    {
      "id": "657437dd-9166-4439-bfd4-aa71e9041b02",
      "name": "Get Pending Candidate",
      "type": "n8n-nodes-base.notion",
      "position": [
        -3104,
        3040
      ]
    },
    {
      "id": "da1129f4-d252-4c3b-a2e7-d958b3b66156",
      "name": "Stop",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -2656,
        3232
      ]
    },
    {
      "id": "fe8dcd59-4ef8-42fd-a46b-71d0c05c7bc4",
      "name": "On New Candidate",
      "type": "n8n-nodes-base.notionTrigger",
      "position": [
        -3328,
        3040
      ]
    },
    {
      "id": "e59001d4-2464-45f1-b0d8-1baed1068fab",
      "name": "Extract PDF Content",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -1104,
        3072
      ]
    },
    {
      "id": "18d738b1-d7ae-4afb-9c14-509da07d0a2c",
      "name": "OpenAI PDF Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -576,
        3232
      ]
    },
    {
      "id": "fff487e1-4695-4abf-8ed9-8e24bf5e4bd9",
      "name": "Analyze Candidate (PDF)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -592,
        3072
      ]
    },
    {
      "id": "d8992980-7a8c-4ad9-8df2-73a4a4a94ab9",
      "name": "OpenAI DOCX Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -576,
        2832
      ]
    },
    {
      "id": "a2ae1018-34fa-4ba7-a7ae-c1544dd06c53",
      "name": "Analyze Candidate (DOCX)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -592,
        2672
      ]
    },
    {
      "id": "19e03b19-82fe-4fc8-bcf2-1a4b0c5e59fe",
      "name": "Format DOCX Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -832,
        2672
      ]
    },
    {
      "id": "661cd80f-a9f7-4420-bd33-c1269678126b",
      "name": "Check Processing Status",
      "type": "n8n-nodes-base.if",
      "position": [
        -2880,
        3040
      ]
    },
    {
      "id": "511b0ee0-631d-4dd2-8fb9-96ea8551e233",
      "name": "Get Full Record",
      "type": "n8n-nodes-base.notion",
      "position": [
        -2656,
        3040
      ]
    },
    {
      "id": "e5c5e096-cd23-44eb-9a0c-9be66f103df5",
      "name": "Prepare Resume URL",
      "type": "n8n-nodes-base.set",
      "position": [
        -2384,
        3040
      ]
    },
    {
      "id": "fe3d34f2-20d3-43fe-84cd-af25e38b69fe",
      "name": "Download Resume",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1984,
        3040
      ]
    },
    {
      "id": "4f5b079d-c346-4083-a6a4-9115c1d296dd",
      "name": "Identify File Type",
      "type": "n8n-nodes-base.code",
      "position": [
        -1760,
        3040
      ]
    },
    {
      "id": "fc76e4a8-742d-423e-9bff-700b78a3a7ae",
      "name": "Route by Extension",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1536,
        3040
      ]
    },
    {
      "id": "e80ecc43-c4c8-4cac-8b6b-1702a00728d5",
      "name": "Convert DOCX to Text",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        -1312,
        2672
      ]
    },
    {
      "id": "6032f72c-58c7-4e95-8d0f-e58e53256c47",
      "name": "Extract DOCX Content",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -1072,
        2672
      ]
    },
    {
      "id": "1d93f999-0ff9-4225-ae08-7cd7cf30c52e",
      "name": "Format PDF Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -832,
        3072
      ]
    },
    {
      "id": "3f908df7-2927-4b33-af16-0738809f8efe",
      "name": "Format AI Output (DOCX)",
      "type": "n8n-nodes-base.code",
      "position": [
        -208,
        2672
      ]
    },
    {
      "id": "788996eb-3b98-4f00-84c0-d3b689908917",
      "name": "Format AI Output (PDF)",
      "type": "n8n-nodes-base.code",
      "position": [
        -208,
        3072
      ]
    },
    {
      "id": "f313d8f5-72a2-4a11-97ac-7f116106dcd7",
      "name": "Update Notion (DOCX)",
      "type": "n8n-nodes-base.notion",
      "position": [
        80,
        2672
      ]
    },
    {
      "id": "6ab4b958-d5ef-4c93-9db8-8872056c2c85",
      "name": "Update Notion (PDF)",
      "type": "n8n-nodes-base.notion",
      "position": [
        80,
        3072
      ]
    },
    {
      "id": "198ad01f-ca8d-4919-a871-f37edc0eba38",
      "name": "Sticky Note18",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3776,
        2848
      ],
      "parameters": {
        "width": 379,
        "height": 570,
        "content": "## How it works\n1. **Watches Notion** for new job applications in the \"TD Careers\" database.\n2. **Checks Status** to ensure the candidate hasn't already been processed (looks for empty AI comments).\n3"
      }
    },
    {
      "id": "bd3950c1-6f5a-4661-a728-e0971ca7fcf8",
      "name": "Sticky Note19",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3376,
        2960
      ],
      "parameters": {
        "width": 900,
        "height": 260,
        "content": "### 1. Trigger & Validation\nDetects new items and ensures we don't process the same candidate twice."
      }
    },
    {
      "id": "2fbccbea-5621-4b11-9978-7d5d4fb0e08d",
      "name": "Sticky Note20",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2416,
        2960
      ],
      "parameters": {
        "width": 1100,
        "height": 260,
        "content": "### 2. Data Preparation\nFetches the full job description and downloads the resume file."
      }
    },
    {
      "id": "5ebf07ff-cb7a-46ad-8a93-0246314626be",
      "name": "Sticky Note21",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1168,
        2592
      ],
      "parameters": {
        "width": 1400,
        "height": 300,
        "content": "### 3. DOCX Processing Branch\nConverts DOCX to text, analyzes via AI, and updates Notion."
      }
    },
    {
      "id": "8ac30c6d-42a5-48a6-8c10-42e9f5efa138",
      "name": "Sticky Note22",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1168,
        2992
      ],
      "parameters": {
        "width": 1400,
        "height": 300,
        "content": "### 4. PDF Processing Branch\nExtracts PDF text, analyzes via AI, and updates Notion."
      }
    }
  ],
  "connections": {
    "Download Resume": {
      "main": [
        [
          {
            "node": "Identify File Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format PDF Data": {
      "main": [
        [
          {
            "node": "Analyze Candidate (PDF)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Full Record": {
      "main": [
        [
          {
            "node": "Prepare Resume URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format DOCX Data": {
      "main": [
        [
          {
            "node": "Analyze Candidate (DOCX)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On New Candidate": {
      "main": [
        [
          {
            "node": "Get Pending Candidate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI PDF Model": {
      "ai_languageModel": [
        [
          {
            "node": "Analyze Candidate (PDF)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI DOCX Model": {
      "ai_languageModel": [
        [
          {
            "node": "Analyze Candidate (DOCX)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Identify File Type": {
      "main": [
        [
          {
            "node": "Route by Extension",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Resume URL": {
      "main": [
        [
          {
            "node": "Fetch Job Description",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Extension": {
      "main": [
        [
          {
            "node": "Convert DOCX to Text",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract PDF Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract PDF Content": {
      "main": [
        [
          {
            "node": "Format PDF Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert DOCX to Text": {
      "main": [
        [
          {
            "node": "Extract DOCX Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract DOCX Content": {
      "main": [
        [
          {
            "node": "Format DOCX Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Job Description": {
      "main": [
        [
          {
            "node": "Download Resume",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Pending Candidate": {
      "main": [
        [
          {
            "node": "Check Processing Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format AI Output (PDF)": {
      "main": [
        [
          {
            "node": "Update Notion (PDF)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Candidate (PDF)": {
      "main": [
        [
          {
            "node": "Format AI Output (PDF)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Processing Status": {
      "main": [
        [
          {
            "node": "Get Full Record",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Stop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format AI Output (DOCX)": {
      "main": [
        [
          {
            "node": "Update Notion (DOCX)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Candidate (DOCX)": {
      "main": [
        [
          {
            "node": "Format AI Output (DOCX)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}