{
  "name": "HireMind - Skill Gap Analysis",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "skill-gap-analysis",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "skillgap-webhook",
      "name": "Skill Gap Analysis Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "applicationId",
              "value": "={{ $json.body.applicationId }}"
            },
            {
              "name": "jobId",
              "value": "={{ $json.body.jobId }}"
            },
            {
              "name": "userId",
              "value": "={{ $json.body.userId }}"
            }
          ]
        }
      },
      "id": "extract-analysis-params",
      "name": "Extract Analysis Parameters",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        470,
        300
      ]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "=http://localhost:5000/api/resumes/user/{{ $json.userId }}/latest"
      },
      "id": "get-user-resume",
      "name": "Get User Resume",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        690,
        200
      ]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "=http://localhost:5000/api/jobs/{{ $node['Extract Analysis Parameters'].json.jobId }}"
      },
      "id": "get-job-details",
      "name": "Get Job Details",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        690,
        400
      ]
    },
    {
      "parameters": {
        "jsCode": "// Merge resume and job data for analysis\nconst resume = $node['Get User Resume'].json;\nconst job = $node['Get Job Details'].json;\n\nreturn {\n  json: {\n    userId: resume.userId,\n    applicationId: $node['Extract Analysis Parameters'].json.applicationId,\n    resumeSkills: resume.extracted?.skills || [],\n    jobRequirements: job.requirements || [],\n    jobTitle: job.title,\n    company: job.company\n  }\n};"
      },
      "id": "merge-data",
      "name": "Merge Resume & Job Data",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        910,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=http://localhost:5000/api/skills/analyze-gap",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "resumeSkills",
              "value": "={{ $json.resumeSkills }}"
            },
            {
              "name": "jobRequirements",
              "value": "={{ $json.jobRequirements }}"
            }
          ]
        }
      },
      "id": "perform-gap-analysis",
      "name": "Perform Gap Analysis",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        1130,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=http://localhost:5000/api/skills/save-report",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "userId",
              "value": "={{ $node['Merge Resume & Job Data'].json.userId }}"
            },
            {
              "name": "applicationId",
              "value": "={{ $node['Merge Resume & Job Data'].json.applicationId }}"
            },
            {
              "name": "report",
              "value": "={{ $json }}"
            }
          ]
        }
      },
      "id": "save-gap-report",
      "name": "Save Gap Report",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        1350,
        300
      ]
    },
    {
      "parameters": {
        "fromEmail": "hiremindagent@gmail.com",
        "toEmail": "={{ $node['Get User Resume'].json.email }}",
        "subject": "\ud83d\udcca Skill Gap Analysis: {{ $node['Merge Resume & Job Data'].json.jobTitle }}",
        "text": "=Hi there,\n\nWe've completed your skill gap analysis for {{ $node['Merge Resume & Job Data'].json.jobTitle }} at {{ $node['Merge Resume & Job Data'].json.company }}.\n\n\u2705 Matching Skills: {{ $json.matchingSkills?.length || 0 }}\n\u274c Missing Skills: {{ $json.missingSkills?.length || 0 }}\n\ud83d\udcc8 Overall Match: {{ $json.matchPercentage }}%\n\n\ud83c\udfaf Skills to Improve:\n{{ $json.missingSkills?.slice(0, 5).map(skill => `- ${skill}`).join('\\n') }}\n\n\ud83d\udca1 Recommended Actions:\n{{ $json.recommendations?.slice(0, 3).map((rec, i) => `${i+1}. ${rec}`).join('\\n') }}\n\n\ud83d\udcda Learning Resources:\n- Online courses for missing skills\n- Practice projects\n- Certification programs\n\nView full report: http://localhost:3000/dashboard/skill-gap\n\nBest,\nHireMind Agent"
      },
      "id": "send-gap-report-email",
      "name": "Send Gap Report Email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2,
      "position": [
        1570,
        300
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { \"success\": true, \"message\": \"Skill gap analysis completed\", \"matchPercentage\": $json.matchPercentage } }}"
      },
      "id": "analysis-response",
      "name": "Analysis Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        1790,
        300
      ]
    }
  ],
  "connections": {
    "Skill Gap Analysis Webhook": {
      "main": [
        [
          {
            "node": "Extract Analysis Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Analysis Parameters": {
      "main": [
        [
          {
            "node": "Get User Resume",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Job Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get User Resume": {
      "main": [
        [
          {
            "node": "Merge Resume & Job Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Job Details": {
      "main": [
        [
          {
            "node": "Merge Resume & Job Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Resume & Job Data": {
      "main": [
        [
          {
            "node": "Perform Gap Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Perform Gap Analysis": {
      "main": [
        [
          {
            "node": "Save Gap Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Gap Report": {
      "main": [
        [
          {
            "node": "Send Gap Report Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Gap Report Email": {
      "main": [
        [
          {
            "node": "Analysis Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 1,
  "updatedAt": "2026-01-13T00:00:00.000Z",
  "versionId": "1"
}