{
  "name": "New roles at target companies to Slack (ATS Job Changes Feed)",
  "flow": [
    {
      "id": 1,
      "module": "apify:runActorNew",
      "version": 1,
      "parameters": {},
      "mapper": {
        "actor_search_type": "store",
        "actorId": "f8Fuu7hdQCdqIacme",
        "runSync": true,
        "inputBodyf8Fuu7hdQCdqIacme": "{\n  \"companies\": [\n    \"greenhouse:stripe\",\n    \"https://jobs.lever.co/palantir\",\n    \"https://jobs.ashbyhq.com/openai\"\n  ],\n  \"monitorId\": \"make-slack-alerts\",\n  \"mode\": \"changes\",\n  \"emitBaseline\": false,\n  \"includeClosed\": false,\n  \"includeDescription\": false,\n  \"emitCompanySummaries\": false,\n  \"titleKeywords\": [\n    \"engineer\",\n    \"data\"\n  ]\n}",
        "maxTotalChargeUsd": "1"
      },
      "metadata": {
        "designer": {
          "x": 0,
          "y": 0
        },
        "restore": {
          "expect": {
            "actor_search_type": {
              "label": "Apify Store Actors"
            },
            "runSync": {
              "mode": "chose"
            },
            "actorId": {
              "mode": "chose",
              "label": "ATS Job Changes Feed — Greenhouse, Lever & Ashby (agitools/ats-jobs-delta)"
            }
          }
        }
      }
    },
    {
      "id": 2,
      "module": "apify:fetchDatasetItems",
      "version": 1,
      "parameters": {},
      "mapper": {
        "datasetId": "{{1.defaultDatasetId}}",
        "type": "clean",
        "format": "json",
        "limit": "100000"
      },
      "metadata": {
        "designer": {
          "x": 300,
          "y": 0
        },
        "restore": {
          "expect": {
            "type": {
              "label": "Clean"
            },
            "format": {
              "label": "JSON"
            }
          }
        }
      }
    },
    {
      "id": 3,
      "module": "json:TransformToJSON",
      "version": 1,
      "parameters": {
        "space": ""
      },
      "mapper": {
        "object": "{{if(2.changeType = \"reopened\"; \"Reopened\"; \"New\")}} role at {{ifempty(2.companyName; 2.companySlug)}}: {{2.title}} {{2.url}}"
      },
      "metadata": {
        "designer": {
          "x": 600,
          "y": 0
        }
      },
      "filter": {
        "name": "New or reopened jobs",
        "conditions": [
          [
            {
              "a": "{{2.recordType}}",
              "b": "job",
              "o": "text:equal"
            },
            {
              "a": "{{2.changeType}}",
              "b": "new",
              "o": "text:equal"
            }
          ],
          [
            {
              "a": "{{2.recordType}}",
              "b": "job",
              "o": "text:equal"
            },
            {
              "a": "{{2.changeType}}",
              "b": "reopened",
              "o": "text:equal"
            }
          ]
        ]
      }
    },
    {
      "id": 4,
      "module": "http:MakeRequest",
      "version": 4,
      "parameters": {
        "authenticationType": "noAuth",
        "tlsType": ""
      },
      "mapper": {
        "url": "https://hooks.slack.com/services/REPLACE/WITH/YOUR_WEBHOOK",
        "method": "post",
        "contentType": "json",
        "inputMethod": "jsonString",
        "jsonStringBodyContent": "{\"text\": {{3.json}}}",
        "parseResponse": false,
        "stopOnHttpError": true,
        "timeout": "40",
        "allowRedirects": true,
        "shareCookies": false,
        "requestCompressedContent": true
      },
      "metadata": {
        "designer": {
          "x": 900,
          "y": 0
        }
      }
    }
  ],
  "metadata": {
    "instant": false,
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true,
      "autoCommitTriggerLast": true,
      "sequential": true,
      "confidential": false,
      "dataloss": false,
      "dlq": false,
      "freshVariables": false
    },
    "designer": {
      "orphans": []
    }
  }
}
