{
  "name": "Score every new ATS applicant against the job and send the verdict back to the ATS",
  "nodes": [
    {
      "name": "About this template",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "parameters": {
        "content": "## Score every new applicant from your ATS and send the verdict back\n\nWhen your ATS posts a new applicant to the webhook, SourceGeek saves them in a sheet, scores them against the job description and writes a dossier. The score, the main reason and the dossier link go back to your ATS as a note.\n\nPoint your ATS (or its automation) at the webhook URL with a JSON body: `name`, `profileUrl`, `email`, `candidateId` and `jobDescription`. Then set **Settings → atsNoteUrl** and the authentication of the last node to your ATS's notes endpoint.\n\nCredits: a profile lookup and a score per applicant.\n\n### Set up\n1. Install the community node **n8n-nodes-sourcegeek** (Settings → Community nodes).\n2. In SourceGeek, create an API key under Settings → Connected apps → API keys, and add it as a **SourceGeek API** credential. No account yet? [Start a free 14-day trial](https://chat.sourcegeek.com/sign-up?utm_source=n8n&utm_medium=template&utm_campaign=n8n_templates&utm_content=score-ats-applicants).\n\nMore SourceGeek templates: https://www.sourcegeek.com/en/templates#score-ats-applicants",
        "height": 520,
        "width": 440,
        "color": 5
      },
      "id": "a46e8478-066f-4111-a7d0-271fa4161dfd",
      "position": [
        0,
        120
      ]
    },
    {
      "name": "New applicant",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "parameters": {
        "httpMethod": "POST",
        "path": "sourcegeek-new-applicant",
        "options": {}
      },
      "webhookId": "3d0b96b3-5203-4f37-a7c9-a12a34539296",
      "id": "c0a07a32-f7ee-43ed-af78-63ff48426657",
      "position": [
        520,
        300
      ]
    },
    {
      "name": "Settings",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "95fe26ba-377f-4f9a-a9f8-30ec1fe8982f",
              "name": "atsNoteUrl",
              "value": "https://your-ats.example.com/api/candidates/notes",
              "type": "string"
            },
            {
              "id": "6781e3a0-84c3-40c5-a794-0e3b4989b354",
              "name": "candidateId",
              "value": "={{ $json.body.candidateId }}",
              "type": "string"
            },
            {
              "id": "015ae17c-9c9c-405f-a285-1cc4c28ea4da",
              "name": "jobDescription",
              "value": "={{ $json.body.jobDescription }}",
              "type": "string"
            },
            {
              "id": "c8a34500-d2fb-4d36-a836-302f3e1f5db1",
              "name": "csv",
              "value": "=Name,Profile URL,Email\n\"{{ $json.body.name }}\",{{ $json.body.profileUrl }},{{ $json.body.email }}",
              "type": "string"
            },
            {
              "id": "9f454860-64d4-4187-a5f3-bf0125c261a9",
              "name": "name",
              "value": "={{ $json.body.name }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "c9f9e966-ac7f-446b-afad-9fed17dd33c0",
      "position": [
        760,
        300
      ]
    },
    {
      "name": "Save the applicant",
      "type": "n8n-nodes-sourcegeek.sourcegeek",
      "typeVersion": 2,
      "parameters": {
        "resource": "sheet",
        "operation": "create_sheet",
        "title": "=Applicant: {{ $json.name }}",
        "csv": "={{ $json.csv }}"
      },
      "id": "b4f1454b-8378-4d1a-a3a2-0b735e09debd",
      "position": [
        1000,
        300
      ]
    },
    {
      "name": "Score against the job",
      "type": "n8n-nodes-sourcegeek.sourcegeek",
      "typeVersion": 2,
      "parameters": {
        "resource": "sheet",
        "operation": "score_leads",
        "artifactId": "={{ $json.artifactId }}",
        "targetDescription": "={{ $('Settings').item.json.jobDescription }}"
      },
      "id": "e7e2d07a-4740-46d8-a9e1-fad43a20aecf",
      "position": [
        1240,
        300
      ]
    },
    {
      "name": "Wait for the score",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "parameters": {
        "amount": 2,
        "unit": "minutes"
      },
      "webhookId": "4a20cd46-9a47-467b-a17f-cd1c161dea45",
      "id": "4247c772-e69b-4b61-a8c0-dd7c3f50a339",
      "position": [
        1480,
        300
      ]
    },
    {
      "name": "Write the dossier",
      "type": "n8n-nodes-sourcegeek.sourcegeek",
      "typeVersion": 2,
      "parameters": {
        "resource": "sheet",
        "operation": "create_shortlist",
        "artifactId": "={{ $('Save the applicant').item.json.artifactId }}",
        "additionalFields": {
          "limit": 1
        }
      },
      "id": "8ce90167-cac0-42d1-a915-996d8fdd4bd4",
      "position": [
        1720,
        300
      ]
    },
    {
      "name": "Add a note in the ATS",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "parameters": {
        "method": "POST",
        "url": "={{ $('Settings').item.json.atsNoteUrl }}",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ candidateId: $('Settings').item.json.candidateId, note: `SourceGeek score ${$json.candidates[0]?.score ?? 'n/a'}/100: ${$json.candidates[0]?.reason ?? 'no score yet'}\\nDossier: ${$json.url}` }) }}",
        "options": {}
      },
      "id": "7fb0414b-6d1b-4700-ac5f-1b1aa8e939df",
      "position": [
        1960,
        300
      ]
    }
  ],
  "pinData": {},
  "connections": {
    "New applicant": {
      "main": [
        [
          {
            "node": "Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Settings": {
      "main": [
        [
          {
            "node": "Save the applicant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save the applicant": {
      "main": [
        [
          {
            "node": "Score against the job",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Score against the job": {
      "main": [
        [
          {
            "node": "Wait for the score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for the score": {
      "main": [
        [
          {
            "node": "Write the dossier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write the dossier": {
      "main": [
        [
          {
            "node": "Add a note in the ATS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}
