{
  "name": "HireMind - Automatic Job Discovery",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "job-discovery",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "job-discovery-webhook",
      "name": "Job Discovery Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "resumeId",
              "value": "={{ $json.body.resumeId }}"
            },
            {
              "name": "userId",
              "value": "={{ $json.body.userId }}"
            },
            {
              "name": "userEmail",
              "value": "={{ $json.body.userEmail }}"
            }
          ],
          "array": [
            {
              "name": "skills",
              "value": "={{ $json.body.skills }}"
            }
          ],
          "object": [
            {
              "name": "preferences",
              "value": "={{ $json.body.preferences }}"
            }
          ]
        }
      },
      "id": "extract-discovery-params",
      "name": "Extract Discovery Parameters",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        470,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=http://localhost:5000/api/jobs/discover",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "skills",
              "value": "={{ $json.skills }}"
            },
            {
              "name": "preferences",
              "value": "={{ $json.preferences }}"
            },
            {
              "name": "limit",
              "value": "20"
            }
          ]
        },
        "options": {}
      },
      "id": "fetch-jobs-api",
      "name": "Fetch Jobs from APIs",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        690,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=http://localhost:5000/api/jobs/filter-and-match",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "jobs",
              "value": "={{ $json.jobs }}"
            },
            {
              "name": "resumeId",
              "value": "={{ $node['Extract Discovery Parameters'].json.resumeId }}"
            },
            {
              "name": "skills",
              "value": "={{ $node['Extract Discovery Parameters'].json.skills }}"
            }
          ]
        }
      },
      "id": "filter-match-jobs",
      "name": "Filter & Match Jobs",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        910,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=http://localhost:5000/api/jobs/save-discovered",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "userId",
              "value": "={{ $node['Extract Discovery Parameters'].json.userId }}"
            },
            {
              "name": "jobs",
              "value": "={{ $json.matchedJobs }}"
            }
          ]
        }
      },
      "id": "save-discovered-jobs",
      "name": "Save Discovered Jobs",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        1130,
        300
      ]
    },
    {
      "parameters": {
        "fromEmail": "hiremindagent@gmail.com",
        "toEmail": "={{ $node['Extract Discovery Parameters'].json.userEmail }}",
        "subject": "\ud83c\udfaf {{ $json.count }} Matching Jobs Found!",
        "text": "=Hi there,\n\nGreat news! We found {{ $json.count }} jobs matching your profile.\n\nTop matches:\n{{ $json.matchedJobs.slice(0, 3).map(job => `- ${job.title} at ${job.company} (${job.matchScore}% match)`).join('\\n') }}\n\nView all matches in your dashboard: http://localhost:3000/dashboard/job-discovery\n\nReady to apply? Click \"Apply\" on any job and we'll handle the rest!\n\nBest,\nHireMind Agent",
        "authentication": "gmail",
        "emailPassword": "dltz rdmm hibq zbbk"
      },
      "id": "send-discovery-email",
      "name": "Send Job Discovery Email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2,
      "position": [
        1350,
        300
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { \"success\": true, \"jobsFound\": $json.count, \"message\": \"Job discovery completed\" } }}"
      },
      "id": "discovery-response",
      "name": "Discovery Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        1570,
        300
      ]
    }
  ],
  "connections": {
    "Job Discovery Webhook": {
      "main": [
        [
          {
            "node": "Extract Discovery Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Discovery Parameters": {
      "main": [
        [
          {
            "node": "Fetch Jobs from APIs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Jobs from APIs": {
      "main": [
        [
          {
            "node": "Filter & Match Jobs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter & Match Jobs": {
      "main": [
        [
          {
            "node": "Save Discovered Jobs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Discovered Jobs": {
      "main": [
        [
          {
            "node": "Send Job Discovery Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Job Discovery Email": {
      "main": [
        [
          {
            "node": "Discovery Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 1,
  "updatedAt": "2026-01-13T00:00:00.000Z",
  "versionId": "1"
}