{
  "name": "AI Resume Screener",
  "nodes": [
    {
      "parameters": {
        "options": {
          "filter": {
            "subject": "New Application"
          }
        }
      },
      "name": "New Application Email",
      "type": "n8n-nodes-base.emailReadImap",
      "typeVersion": 1,
      "position": [
        450,
        300
      ],
      "notes": "Triggers on new emails with \"New Application\" in the subject. **ACTION REQUIRED:** Configure email credentials and refine the filter.",
      "credentials": {
        "imap": {
          "id": "placeholder",
          "name": "Email Account"
        }
      }
    },
    {
      "parameters": {
        "binaryPropertyName": "={{ $json.attachments[0].id }}"
      },
      "name": "Read Resume PDF",
      "type": "n8n-nodes-base.readPdf",
      "typeVersion": 1,
      "position": [
        650,
        300
      ],
      "notes": "Extracts text from the PDF attachment of the email."
    },
    {
      "parameters": {
        "url": "https://api.example.com/v1/chat/completions",
        "options": {},
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-4"
            },
            {
              "name": "messages",
              "value": "={{ [ { \"role\": \"system\", \"content\": \"You are an expert resume parser. Extract the following fields from the resume text and respond with only a valid JSON object: name, email, phone, skills (as an array), and a 2-sentence summary of their experience.\" }, { \"role\": \"user\", \"content\": \"Here is the resume text: \" + $json[\"text\"] + \"\" } ] }}"
            }
          ]
        },
        "authentication": "headerAuth"
      },
      "name": "Parse Resume",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        850,
        300
      ],
      "notes": "Sends resume text to an LLM to extract structured data. **ACTION REQUIRED:** Configure LLM URL and authentication.",
      "credentials": {
        "httpHeaderAuth": {
          "id": "placeholder",
          "name": "LLM API Key"
        }
      }
    },
    {
      "parameters": {
        "sheetId": "YOUR_SHEET_ID",
        "fields": {
          "columns": [
            {
              "name": "Name",
              "value": "={{ JSON.parse($json.choices[0].message.content).name }}"
            },
            {
              "name": "Email",
              "value": "={{ JSON.parse($json.choices[0].message.content).email }}"
            },
            {
              "name": "Phone",
              "value": "={{ JSON.parse($json.choices[0].message.content).phone }}"
            },
            {
              "name": "Skills",
              "value": "={{ JSON.parse($json.choices[0].message.content).skills.join(', ')}}"
            },
            {
              "name": "Summary",
              "value": "={{ JSON.parse($json.choices[0].message.content).summary }}"
            }
          ]
        }
      },
      "name": "Add to Applicant Tracker",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "position": [
        1050,
        300
      ],
      "notes": "Adds the extracted applicant data to a Google Sheet. **ACTION REQUIRED:** Configure Google Sheets credentials and enter your Sheet ID.",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "placeholder",
          "name": "Google Sheets Account"
        }
      }
    },
    {
      "parameters": {
        "fromEmail": "your-email@example.com",
        "toEmail": "={{ JSON.parse($node[\"Parse Resume\"].json.choices[0].message.content).email }}",
        "subject": "Thank you for your application",
        "text": "Hello {{ JSON.parse($node[\"Parse Resume\"].json.choices[0].message.content).name }},

Thank you for applying for the position. We have received your application and will be in touch shortly.

Best regards,
Your Company"
      },
      "name": "Send Confirmation Email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 1,
      "position": [
        1250,
        300
      ],
      "notes": "Sends a confirmation email to the applicant. **ACTION REQUIRED:** Configure your email credentials.",
      "credentials": {
        "smtp": {
          "id": "placeholder",
          "name": "Email Account"
        }
      }
    }
  ],
  "connections": {
    "New Application Email": {
      "main": [
        [
          {
            "node": "Read Resume PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Resume PDF": {
      "main": [
        [
          {
            "node": "Parse Resume",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Resume": {
      "main": [
        [
          {
            "node": "Add to Applicant Tracker",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add to Applicant Tracker": {
      "main": [
        [
          {
            "node": "Send Confirmation Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}