{
  "name": "Weekday ATS hiring signals with Apify",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                1,
                2,
                3,
                4,
                5
              ],
              "triggerAtHour": 8
            }
          ]
        }
      },
      "id": "ats-schedule",
      "name": "Weekday schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -620,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.apify.com/v2/actors/benthepythondev~ats-jobs-aggregator/run-sync-get-dataset-items",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "application/json",
        "body": "{\"sources\":[\"greenhouse\"],\"greenhouseCompanies\":[\"stripe\",\"figma\",\"cloudflare\"],\"keywords\":[\"sales\",\"marketing\",\"business development\"],\"includeDescription\":false,\"maxResults\":50}",
        "options": {
          "timeout": 300000
        }
      },
      "id": "ats-apify",
      "name": "Run ATS Jobs Actor",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -360,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "const input = $input.all().map(item => item.json);\nconst rows = input.length === 1 && Array.isArray(input[0]) ? input[0] : input;\nconst jobs = rows.filter(job => job && job.job_url);\nconst companies = [...new Set(jobs.map(job => job.company_name || job.company).filter(Boolean))];\nconst lines = jobs.slice(0, 50).map((job, index) => {\n  const remote = job.remote ? ' | remote' : '';\n  return `${index + 1}. ${job.job_title || 'Untitled role'} at ${job.company_name || job.company || 'Unknown company'}\\n${job.location || 'Location unavailable'}${remote} | ${job.source || 'ATS'}\\n${job.job_url}`;\n});\nreturn [{ json: { subject: `Hiring signals: ${jobs.length} roles across ${companies.length} companies`, digest: lines.join('\\n\\n') || 'No matching roles were returned today.' } }];"
      },
      "id": "ats-digest",
      "name": "Build hiring signal digest",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -100,
        0
      ]
    },
    {
      "parameters": {
        "fromEmail": "alerts@example.com",
        "toEmail": "you@example.com",
        "subject": "={{ $json.subject }}",
        "emailFormat": "text",
        "text": "={{ $json.digest }}",
        "options": {}
      },
      "id": "ats-email",
      "name": "Email hiring signals",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        160,
        0
      ]
    }
  ],
  "connections": {
    "Weekday schedule": {
      "main": [
        [
          {
            "node": "Run ATS Jobs Actor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run ATS Jobs Actor": {
      "main": [
        [
          {
            "node": "Build hiring signal digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build hiring signal digest": {
      "main": [
        [
          {
            "node": "Email hiring signals",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ats-hiring-signals-v1",
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}