{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "626050e4-b462-47b3-b651-6dda3f9beb55",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -200,
        200
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 30
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e20c826a-9f8f-4f63-9dcd-09d1dd660f63",
      "name": "If Working Hours",
      "type": "n8n-nodes-base.if",
      "position": [
        -20,
        200
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "795a6d51-0ea0-4493-bc1e-a1807a2cbd77",
              "operator": {
                "type": "number",
                "operation": "gte"
              },
              "leftValue": "={{ $json.Hour }}",
              "rightValue": 9
            },
            {
              "id": "f9ba101d-226d-4d6a-aab8-62229762a046",
              "operator": {
                "type": "number",
                "operation": "lt"
              },
              "leftValue": "={{ $json.Hour }}",
              "rightValue": 17
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "5f19d4b6-0b28-4103-9427-a024849020d8",
      "name": "Assign parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        200,
        200
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b836ba12-262a-4fed-a31d-9e2f6514137a",
              "name": "startUrls",
              "type": "array",
              "value": "=[\n        {\n            \"url\": \"https://www.upwork.com/nx/search/jobs/?per_page=20&q=python\",\n            \"method\": \"GET\"\n        },\n        {\n            \"url\": \"https://www.upwork.com/nx/search/jobs/?per_page=20&q=chatgpt\",\n            \"method\": \"GET\"\n        }\n    ]"
            },
            {
              "id": "5f7ba5cc-a8fc-4f67-9feb-6243d08462f9",
              "name": "proxyCountryCode",
              "type": "string",
              "value": "US"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c746b85f-e116-4393-b04d-26976f06e5b7",
      "name": "Query For Upwork Job Posts",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        420,
        200
      ],
      "parameters": {
        "url": "=https://api.apify.com/v2/acts/arlusm~upwork-scraper-with-fresh-job-posts/run-sync-get-dataset-items",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "startUrls",
              "value": "={{ $json.startUrls }}"
            },
            {
              "name": "proxyCountryCode",
              "value": "={{ $json.proxyCountryCode }}"
            }
          ]
        },
        "genericAuthType": "httpQueryAuth"
      },
      "credentials": {
        "httpQueryAuth": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "bae08c70-e5c3-4772-8307-5ab5b2b5249a",
      "name": "Search In Airtable",
      "type": "n8n-nodes-base.airtable",
      "position": [
        620,
        80
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "appL9M6bCGUW9kytR"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "tblLpgBqujdHUbzWe"
        },
        "options": {},
        "operation": "search",
        "filterByFormula": "={Link}='{{ $json.link }}'"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "718c0c1f-2c1e-4b31-817f-66c12f3c2a9f",
      "name": "Output New Entries",
      "type": "n8n-nodes-base.merge",
      "position": [
        840,
        200
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "joinMode": "keepNonMatches",
        "fieldsToMatchString": "title, link"
      },
      "typeVersion": 3
    },
    {
      "id": "604c3bf8-208c-42e0-8c8d-0e2fd50c913e",
      "name": "Create New Entries In Airtable",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1280,
        80
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "appL9M6bCGUW9kytR"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "tblLpgBqujdHUbzWe"
        },
        "columns": {
          "value": {
            "link": "={{ $json.link }}",
            "title": "={{ $json.title }}"
          },
          "schema": [
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "link",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "paymentType",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "paymentType",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "budget",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "budget",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "projectLength",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "projectLength",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "shortBio",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "shortBio",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "skills",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "skills",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "publishedDate",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "publishedDate",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "normalizedDate",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "normalizedDate",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "searchUrl",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "searchUrl",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "create"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "a9dbb08d-9a9f-4929-b34d-d3768fdf8340",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        120,
        -180
      ],
      "parameters": {
        "color": 5,
        "width": 260,
        "height": 320,
        "content": "## Setup\n1. Add Airtable, Slack credentials\n2. Add a query auth credential where the key is 'token' and the value is your Apify token\n3. Modify the 'Assign parameters' node to include the Upwork URLs you want to query for\n4. Create an airtable table with two columns - 'title' (Single line text) and 'link' (Single line text)\n5. Connect this airtable table to your airtable nodes"
      },
      "typeVersion": 1
    },
    {
      "id": "38220a62-e5b2-448a-82a8-a83f03aa5cb3",
      "name": "Send message in #general",
      "type": "n8n-nodes-base.slack",
      "position": [
        1280,
        320
      ],
      "parameters": {
        "text": "=Job Title : {{ $json.title }}\nPublished : {{ $json.publishedDate }}\nLink : {{ $json.link }}\nPayment Type: {{ $json.paymentType }}\nBudget: {{ $json.budget }}\nSkills: {{ $json.skills }}\nBio: {{ $json.shortBio }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "#general"
        },
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "bef9f104-7012-4b55-9cc1-12dc6156cb43",
      "name": "reverse the order of posts",
      "type": "n8n-nodes-base.code",
      "position": [
        1060,
        320
      ],
      "parameters": {
        "jsCode": "\nreturn $input.all().reverse();"
      },
      "typeVersion": 2
    }
  ],
  "connections": {
    "If Working Hours": {
      "main": [
        [
          {
            "node": "Assign parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "If Working Hours",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Assign parameters": {
      "main": [
        [
          {
            "node": "Query For Upwork Job Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Output New Entries": {
      "main": [
        [
          {
            "node": "Create New Entries In Airtable",
            "type": "main",
            "index": 0
          },
          {
            "node": "reverse the order of posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search In Airtable": {
      "main": [
        [
          {
            "node": "Output New Entries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Query For Upwork Job Posts": {
      "main": [
        [
          {
            "node": "Search In Airtable",
            "type": "main",
            "index": 0
          },
          {
            "node": "Output New Entries",
            "type": "main",
            "index": 1
          }
        ],
        []
      ]
    },
    "reverse the order of posts": {
      "main": [
        [
          {
            "node": "Send message in #general",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}