{
  "id": "7NkQptpKQCLwxZkz",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Screen job applicants with AI and schedule interviews via Gmail",
  "tags": [],
  "nodes": [
    {
      "id": "f6c58ed9-fc3b-4465-8266-bd329aa583e7",
      "name": "Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2480,
        0
      ],
      "parameters": {
        "width": 540,
        "height": 520,
        "content": "## \ud83d\udcca Workflow Overview\nThis workflow automates the screening process for new job applications. It analyzes resumes using AI, evaluates skills and culture fit, records data, and handles interview scheduling.\n\n## How it works\n1.  **Ingest**: Receives application data via Webhook.\n2.  **Extract**: Downloads resumes/CVs and extracts text.\n3.  **Analyze**: Uses GPT-4 to score skills/culture fit and generate interview questions.\n4.  **Action**: Logs results to Google Sheets and emails the candidate.\n5.  **Notify**: Alerts the hiring team via Slack.\n\n## Setup steps\n1.  **Credentials**: Configure OpenAI, Google (Sheets/Gmail), and Slack.\n2.  **Webhook**: Register the Production URL with your job board.\n3.  **Spreadsheet**: Create a Google Sheet with columns matching the `evaluation` object.\n4.  **Email**: Customize the Gmail template with your scheduling link logic."
      },
      "typeVersion": 1
    },
    {
      "id": "6517d927-2eda-46c3-a98c-483782e734b2",
      "name": "Group: Intake",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1744,
        528
      ],
      "parameters": {
        "color": 7,
        "width": 880,
        "height": 436,
        "content": "## 1. Intake & Validation\nReceives applicant data and validates essential fields. Sends an error notification to Slack if data is missing."
      },
      "typeVersion": 1
    },
    {
      "id": "a63420dd-5a12-4121-a33d-45dda3eb6623",
      "name": "Group: Docs",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -848,
        528
      ],
      "parameters": {
        "color": 7,
        "width": 840,
        "height": 452,
        "content": "## 2. Document Processing\nDownloads Resume and CV files from URLs and extracts text content for AI analysis."
      },
      "typeVersion": 1
    },
    {
      "id": "faa56a0f-d7df-4a0c-b22a-a43d3880ba41",
      "name": "Group: AI",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        32,
        528
      ],
      "parameters": {
        "color": 7,
        "width": 1140,
        "height": 468,
        "content": "## 3. AI Evaluation\nUses GPT-4 to evaluate the candidate against the job description and generate tailored interview questions."
      },
      "typeVersion": 1
    },
    {
      "id": "798ebced-bc19-42ae-baad-1ccc3062bce3",
      "name": "Group: Outreach",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1232,
        528
      ],
      "parameters": {
        "color": 7,
        "width": 840,
        "height": 452,
        "content": "## 4. Recording & Outreach\nSaves evaluation scores to Google Sheets and sends an automated interview invitation email to the candidate."
      },
      "typeVersion": 1
    },
    {
      "id": "40df0d63-2f5b-49c2-85b4-3b4f50ead117",
      "name": "Group: Notify",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2144,
        528
      ],
      "parameters": {
        "color": 7,
        "width": 540,
        "height": 452,
        "content": "## 5. Team Notification\nPrepares a summary report and notifies the recruitment team via Slack with a call to action."
      },
      "typeVersion": 1
    },
    {
      "id": "d0fcfc60-b447-422c-a8f7-02591e44b4b3",
      "name": "Webhook: New Application",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1696,
        656
      ],
      "parameters": {
        "path": "recruitment-application",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "lastNode"
      },
      "typeVersion": 1.1
    },
    {
      "id": "f3902f6c-17d8-4928-9c43-e71db59ef8b6",
      "name": "Normalize Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -1424,
        656
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "a8df8a1f-a734-425a-afe0-1f218b2404b9",
      "name": "Check Required Fields",
      "type": "n8n-nodes-base.if",
      "position": [
        -1168,
        656
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "condition1",
              "operator": {
                "type": "string",
                "operation": "notEmpty"
              },
              "leftValue": "={{ $json.applicant.email }}",
              "rightValue": ""
            },
            {
              "id": "condition2",
              "operator": {
                "type": "string",
                "operation": "notEmpty"
              },
              "leftValue": "={{ $json.documents.resume_url }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "4450edc3-6ac0-4d32-ad47-12da0b59abb0",
      "name": "HTTP: Download Resume",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -816,
        592
      ],
      "parameters": {
        "url": "={{ $json.documents.resume_url }}",
        "options": {
          "timeout": 30000,
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e6fd9199-8ebc-4c4c-aef5-0e40f973f76c",
      "name": "HTTP: Download CV",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -816,
        736
      ],
      "parameters": {
        "url": "={{ $json.documents.cv_url }}",
        "options": {
          "timeout": 30000,
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c5cbfdb5-afc5-415d-9ee6-869df926b029",
      "name": "Code: Extract PDF Text",
      "type": "n8n-nodes-base.code",
      "position": [
        -528,
        656
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "language": "javascript"
      },
      "typeVersion": 2
    },
    {
      "id": "8c98bf55-7d3b-47df-99e9-fa3e1c8de6c1",
      "name": "Code: Prepare Data for AI",
      "type": "n8n-nodes-base.code",
      "position": [
        -272,
        656
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "language": "javascript"
      },
      "typeVersion": 2
    },
    {
      "id": "d3e87632-1529-4c91-913b-d06752824b84",
      "name": "OpenAI: Evaluate Skill & Culture",
      "type": "n8n-nodes-base.openAi",
      "position": [
        80,
        656
      ],
      "parameters": {
        "model": "gpt-4",
        "options": {
          "maxTokens": 2000,
          "temperature": 0.3
        },
        "resource": "chat",
        "requestOptions": {}
      },
      "typeVersion": 1
    },
    {
      "id": "9091bb07-f96a-4649-83bf-32d26326d99c",
      "name": "Code: Parse Evaluation",
      "type": "n8n-nodes-base.code",
      "position": [
        352,
        656
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "language": "javascript"
      },
      "typeVersion": 2
    },
    {
      "id": "23f8cfaf-6602-41c7-af98-2aacdcce3e28",
      "name": "OpenAI: Generate Questions",
      "type": "n8n-nodes-base.openAi",
      "position": [
        640,
        656
      ],
      "parameters": {
        "model": "gpt-4",
        "options": {
          "maxTokens": 2000,
          "temperature": 0.5
        },
        "resource": "chat",
        "requestOptions": {}
      },
      "typeVersion": 1
    },
    {
      "id": "0c054f0c-13ce-4ab9-8952-6e90814c00c3",
      "name": "Code: Parse Questions",
      "type": "n8n-nodes-base.code",
      "position": [
        912,
        656
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "language": "javascript"
      },
      "typeVersion": 2
    },
    {
      "id": "99680ab3-83b6-4728-b8bc-a7ead7bcb240",
      "name": "G Sheets: Save Evaluation",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1280,
        656
      ],
      "parameters": {
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "79a2af28-6c20-4d35-b62c-445909482772",
      "name": "Code: Generate Scheduling Link",
      "type": "n8n-nodes-base.code",
      "position": [
        1536,
        656
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "language": "javascript"
      },
      "typeVersion": 2
    },
    {
      "id": "062b3fca-2187-4e3f-a06b-2f298e5b18e3",
      "name": "Gmail: Send Invite",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1792,
        656
      ],
      "parameters": {
        "sendTo": "={{ $json.applicant.email }}",
        "message": "<h3>Dear {{ $json.applicant.name }},</h3>\n\n<p>Thank you for applying for the <strong>{{ $json.job.title }}</strong> position.</p>\n\n<p>Based on your application, we would like to invite you to a first-round interview.</p>\n\n<h4>\u25a0 Scheduling Your Interview</h4>\n<p>Please choose a convenient time from the link below:</p>\n<p><a href=\"{{ $json.scheduling.link }}\">Select Interview Time</a></p>\n\n<p>\u203b Please register by {{ new Date($json.scheduling.deadline).toLocaleDateString('en-US') }}.</p>\n\n<h4>\u25a0 Interview Details</h4>\n<ul>\n<li>Format: Online (Zoom)</li>\n<li>Duration: Approx. 60 minutes</li>\n<li>Agenda: Review of your experience and motivation</li>\n</ul>\n\n<p>If you have any questions, please feel free to contact us.</p>\n\n<p>Best regards,</p>\n\n<hr>\n<p>Recruitment Team<br>\nEmail: user@example.com</p>",
        "options": {},
        "subject": "[{{ $json.job.title }}] First Interview Invitation: {{ $json.applicant.name }}"
      },
      "typeVersion": 2.1
    },
    {
      "id": "c25feff9-72fd-463c-984f-698d5e0068aa",
      "name": "Code: Prepare Report",
      "type": "n8n-nodes-base.code",
      "position": [
        2176,
        656
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "language": "javascript"
      },
      "typeVersion": 2
    },
    {
      "id": "33f9a46b-2090-4600-87c2-67783230572a",
      "name": "Slack: Notify Team",
      "type": "n8n-nodes-base.slack",
      "position": [
        2432,
        656
      ],
      "parameters": {
        "blocksUi": {
          "blocksValues": [
            {
              "text": {
                "text": "*\ud83c\udfaf New Application Evaluated*",
                "type": "mrkdwn"
              },
              "type": "section"
            },
            {
              "type": "section",
              "fields": [
                {
                  "text": "*Candidate:*\n{{ $json.applicant.name }}",
                  "type": "mrkdwn"
                },
                {
                  "text": "*Position:*\n{{ $json.job.title }}",
                  "type": "mrkdwn"
                },
                {
                  "text": "*Skill Score:*\n{{ $json.evaluation.skill_match_score }}/100",
                  "type": "mrkdwn"
                },
                {
                  "text": "*Culture Score:*\n{{ $json.evaluation.culture_fit_score }}/100",
                  "type": "mrkdwn"
                }
              ]
            },
            {
              "text": {
                "text": "*Recommendation:* `{{ $json.evaluation.overall_recommendation }}`\n\n*Summary:*\n{{ $json.evaluation.career_summary }}",
                "type": "mrkdwn"
              },
              "type": "section"
            },
            {
              "type": "actions",
              "elements": [
                {
                  "url": "{{ $json.report.report_url }}",
                  "text": {
                    "text": "View Report",
                    "type": "plain_text"
                  },
                  "type": "button"
                },
                {
                  "url": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID",
                  "text": {
                    "text": "Applicant List",
                    "type": "plain_text"
                  },
                  "type": "button"
                }
              ]
            }
          ]
        },
        "messageType": "block",
        "otherOptions": {}
      },
      "typeVersion": 2.1
    },
    {
      "id": "5cc30994-0bed-42fe-b870-1f17507fd850",
      "name": "Slack: Error Notification",
      "type": "n8n-nodes-base.slack",
      "position": [
        -1168,
        816
      ],
      "parameters": {
        "text": "\u26a0\ufe0f Error Processing Application\n\nEmail: {{ $json.email || 'Unknown' }}\nJob ID: {{ $json.job_id || 'Unknown' }}\n\nError: Missing required data (Email or Resume URL).\n\nPlease check manually.",
        "otherOptions": {}
      },
      "typeVersion": 2.1
    }
  ],
  "active": false,
  "settings": {
    "callerPolicy": "workflowsFromSameOwner",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "0930312c-df31-4809-8954-32a232f35f7a",
  "connections": {
    "Normalize Data": {
      "main": [
        [
          {
            "node": "Check Required Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP: Download CV": {
      "main": [
        [
          {
            "node": "Code: Extract PDF Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail: Send Invite": {
      "main": [
        [
          {
            "node": "Code: Prepare Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code: Prepare Report": {
      "main": [
        [
          {
            "node": "Slack: Notify Team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Required Fields": {
      "main": [
        [
          {
            "node": "HTTP: Download Resume",
            "type": "main",
            "index": 0
          },
          {
            "node": "HTTP: Download CV",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Slack: Error Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code: Parse Questions": {
      "main": [
        [
          {
            "node": "G Sheets: Save Evaluation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP: Download Resume": {
      "main": [
        [
          {
            "node": "Code: Extract PDF Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code: Extract PDF Text": {
      "main": [
        [
          {
            "node": "Code: Prepare Data for AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code: Parse Evaluation": {
      "main": [
        [
          {
            "node": "OpenAI: Generate Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook: New Application": {
      "main": [
        [
          {
            "node": "Normalize Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code: Prepare Data for AI": {
      "main": [
        [
          {
            "node": "OpenAI: Evaluate Skill & Culture",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "G Sheets: Save Evaluation": {
      "main": [
        [
          {
            "node": "Code: Generate Scheduling Link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI: Generate Questions": {
      "main": [
        [
          {
            "node": "Code: Parse Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code: Generate Scheduling Link": {
      "main": [
        [
          {
            "node": "Gmail: Send Invite",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI: Evaluate Skill & Culture": {
      "main": [
        [
          {
            "node": "Code: Parse Evaluation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}