{
  "name": "AutoScout24 Car Search Across 9 European Markets (long runs)",
  "nodes": [
    {
      "id": "03bfc316-a437-4675-ae25-7998143520c3",
      "name": "Run by hand",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "parameters": {}
    },
    {
      "id": "0c7e22ae-ea73-4b53-a8e1-7f6ae335582b",
      "name": "Every day",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        200
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 8
            }
          ]
        }
      },
      "notes": "Activate the workflow to run on this schedule."
    },
    {
      "id": "3bd94b42-ac48-4826-a833-7e3b8fe98ddb",
      "name": "Start Apify run",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        260,
        100
      ],
      "parameters": {
        "method": "POST",
        "url": "https://api.apify.com/v2/actors/nimbryxo-studio~autoscout24-car-search-across-9-european-markets/runs?waitForFinish=60",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"mode\": \"searchCars\",\n  \"make\": \"BMW\",\n  \"country\": \"de\",\n  \"powerUnit\": \"kw\",\n  \"vatDeductibleOnly\": false,\n  \"includeDetails\": false,\n  \"includeSellerProfile\": false,\n  \"maxItems\": 3\n}",
        "options": {
          "timeout": 90000
        }
      },
      "notes": "Actor: nimbryxo-studio/autoscout24-car-search-across-9-european-markets. Starts the run and waits up to 60 s for it. Header Auth credential: name Authorization, value Bearer + your Apify token."
    },
    {
      "id": "d5be2406-5f89-47af-aa86-b08a7005054b",
      "name": "Run finished?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        520,
        100
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "ae75781e-04ab-44c9-a421-953c68fbe133",
              "leftValue": "={{ ['SUCCEEDED', 'FAILED', 'ABORTED', 'TIMED-OUT'].includes($json.data.status) }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "112a7682-9fa7-47f6-aeb4-a9eba2059a17",
      "name": "Check the run again",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        520,
        320
      ],
      "parameters": {
        "method": "GET",
        "url": "=https://api.apify.com/v2/actor-runs/{{ $json.data.id }}?waitForFinish=60",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {
          "timeout": 90000
        }
      },
      "notes": "Waits up to 60 s per check, then loops back."
    },
    {
      "id": "dd289c16-431c-43dd-a960-31d01887ba1b",
      "name": "Run succeeded?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        780,
        0
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "a7dfdf4e-3301-4013-a62f-0c66916f5f03",
              "leftValue": "={{ $json.data.status === 'SUCCEEDED' }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "5b0cc312-087a-4eba-a6fc-f11b4ab9c6bf",
      "name": "Get the results",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1040,
        -100
      ],
      "parameters": {
        "method": "GET",
        "url": "=https://api.apify.com/v2/datasets/{{ $json.data.defaultDatasetId }}/items?clean=true",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {
          "timeout": 120000
        }
      },
      "notes": "Each record of the run's dataset becomes one n8n item. Connect your destination after this node."
    },
    {
      "id": "773747de-e997-489f-a69c-35fa49e0f14b",
      "name": "Run did not succeed",
      "type": "n8n-nodes-base.stopAndError",
      "typeVersion": 1,
      "position": [
        1040,
        100
      ],
      "parameters": {
        "errorMessage": "={{ 'Apify run ' + $json.data.id + ' ended with status ' + $json.data.status }}"
      }
    },
    {
      "id": "fb8c669e-a2f1-463b-a037-b87eb8ddd513",
      "name": "Setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        -400
      ],
      "parameters": {
        "content": "## AutoScout24 Car Search Across 9 European Markets: long runs\n\nSource: [nimbryxo-studio/autoscout24-car-search-across-9-european-markets](https://apify.com/nimbryxo-studio/autoscout24-car-search-across-9-european-markets) on Apify.\n\nFor runs that need more than 5 minutes (the synchronous endpoint answers HTTP 408 after 300 s).\n1. Select the same Header Auth credential (name `Authorization`, value `Bearer YOUR_APIFY_TOKEN`) in the three HTTP Request nodes.\n2. Edit the JSON body of **Start Apify run** to change the input.\n3. Connect your destination after **Get the results**.\n\nGenerated by recipeforagents.com. Validated, not executed: runs are billed to your Apify account.",
        "height": 360,
        "width": 500,
        "color": 6
      }
    }
  ],
  "connections": {
    "Run by hand": {
      "main": [
        [
          {
            "node": "Start Apify run",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Every day": {
      "main": [
        [
          {
            "node": "Start Apify run",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start Apify run": {
      "main": [
        [
          {
            "node": "Run finished?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run finished?": {
      "main": [
        [
          {
            "node": "Run succeeded?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check the run again",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check the run again": {
      "main": [
        [
          {
            "node": "Run finished?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run succeeded?": {
      "main": [
        [
          {
            "node": "Get the results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Run did not succeed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}
