{
  "name": "Daily remote job alerts with Apify",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                1,
                2,
                3,
                4,
                5
              ],
              "triggerAtHour": 8
            }
          ]
        }
      },
      "id": "jobs-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~remote-jobs-aggregator/run-sync-get-dataset-items",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "application/json",
        "body": "{\"searchKeywords\":\"python developer\",\"platforms\":[\"arbeitnow\",\"jobicy\",\"himalayas\",\"remoteok\"],\"maxJobsPerPlatform\":10,\"maxTotalJobs\":30,\"debugMode\":false}",
        "options": {
          "timeout": 300000
        }
      },
      "id": "jobs-apify",
      "name": "Run Remote 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.url || job.title));\nconst lines = jobs.slice(0, 30).map((job, index) => {\n  const title = job.title || 'Untitled role';\n  const company = job.company || 'Unknown company';\n  const location = job.location || 'Remote';\n  const source = job.platform || 'job board';\n  const url = job.url || '';\n  return `${index + 1}. ${title} at ${company} | ${location} | ${source}\\n${url}`;\n});\nreturn [{ json: { count: jobs.length, subject: `Remote job alert: ${jobs.length} matching roles`, digest: lines.join('\\n\\n') || 'No matching jobs were returned today.' } }];"
      },
      "id": "jobs-digest",
      "name": "Build job 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": "jobs-email",
      "name": "Email job alert",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        160,
        0
      ]
    }
  ],
  "connections": {
    "Weekday schedule": {
      "main": [
        [
          {
            "node": "Run Remote Jobs Actor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Remote Jobs Actor": {
      "main": [
        [
          {
            "node": "Build job digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build job digest": {
      "main": [
        [
          {
            "node": "Email job alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "jobs-alerts-v1",
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}