{
  "name": "Automate Dutch Public Procurement Data Collection with TenderNed",
  "nodes": [
    {
      "id": "7369f055-b55d-491c-8dee-12988a5c2dc8",
      "name": "Haal XML Details",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1296,
        864
      ]
    },
    {
      "id": "ecb51d0b-b6a9-4b50-879d-6f7aa7240bff",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -560,
        768
      ]
    },
    {
      "id": "bf05ee04-4ee0-4217-8b02-7fe5e8f67600",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        432,
        976
      ]
    },
    {
      "id": "ed07bb23-b6ed-4cff-9327-d410150d061a",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        832,
        976
      ]
    },
    {
      "id": "6855d01b-c1bd-429d-a2c6-610528ec192c",
      "name": "XML",
      "type": "n8n-nodes-base.xml",
      "position": [
        1472,
        864
      ]
    },
    {
      "id": "7c209557-d141-43d4-9fa9-ced8cc06229d",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1840,
        928
      ]
    },
    {
      "id": "f49fa844-4585-4274-8086-3c7bd8cef555",
      "name": "Haal JSON Details",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1376,
        704
      ]
    },
    {
      "id": "1e619b5f-9fdb-44af-95f2-1c4c45fa5703",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2240,
        944
      ]
    },
    {
      "id": "e1816ca0-4f73-449f-a9b5-7a0b9e6cd7e3",
      "name": "Splits Alle Velden",
      "type": "n8n-nodes-base.code",
      "position": [
        2544,
        944
      ]
    },
    {
      "id": "cc3b434f-fbae-4e6b-8e4a-3cd59220a19f",
      "name": "Verwerk Response",
      "type": "n8n-nodes-base.code",
      "position": [
        128,
        976
      ]
    },
    {
      "id": "aba4d103-97ef-4ead-bb1c-44a9b179deee",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        -224
      ],
      "parameters": {
        "width": 1280,
        "height": 1056,
        "content": "## TenderNed Tender Scraper Workflow\n\n**What this workflow does:**\n- Automatically fetches new tenders from TenderNed API\n- Extracts both XML and JSON data for each tender\n- Filters based on your crit"
      }
    },
    {
      "id": "b42b8cfe-b5fd-4bb3-9cee-72848ced7849",
      "name": "Filter op ...",
      "type": "n8n-nodes-base.filter",
      "position": [
        2944,
        944
      ]
    },
    {
      "id": "e4a9f68f-ecca-4dc7-acde-da3becc2e716",
      "name": "Insert row",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        3456,
        944
      ]
    },
    {
      "id": "1eb5c070-8fc3-479f-99f9-e9d0899ed471",
      "name": "Tenderned Publicaties",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -208,
        976
      ]
    },
    {
      "id": "a0a5cde9-e8ee-48ab-ac14-22ed71d0f181",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -560,
        976
      ]
    },
    {
      "id": "78c96a84-7b35-4e93-b6c8-f59ad8684067",
      "name": "Schedule Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        1136
      ],
      "parameters": {
        "width": 300,
        "height": 368,
        "content": "## Schedule Trigger\n\n**Purpose:** Runs this workflow automatically\n\n**Schedule:** Daily at 9:00 AM\n\n**Note:** You can also trigger manually for testing using the manual trigger below\n\n## Manual Testin"
      }
    },
    {
      "id": "d84a3615-f414-49d5-baee-b58b561c9c8c",
      "name": "API Fetch Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        1136
      ],
      "parameters": {
        "width": 344,
        "height": 340,
        "content": "## Fetch Tender Publications\n\n**API Endpoint:** TenderNed Publicaties API\n\n**What it does:**\n- Fetches latest tender publications\n- Returns array of tenders with basic info\n- Each tender has a publica"
      }
    },
    {
      "id": "c6ce7ebc-3b35-45ab-bb99-3a9090f123cc",
      "name": "Process Response Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        1136
      ],
      "parameters": {
        "width": 288,
        "height": 324,
        "content": "## Process API Response\n\n**What it does:**\n- Extracts the nested 'publicaties' array from API response\n- Prepares data structure for further processing\n\n**Note:** The API returns results wrapped in an"
      }
    },
    {
      "id": "18844cf6-b38e-4743-9af1-657168b75684",
      "name": "Split Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2464,
        1152
      ],
      "parameters": {
        "width": 320,
        "height": 292,
        "content": "## Split Into Individual Tenders\n\n**What it does:**\n- Takes the array of tenders\n- Creates one item per tender\n- Enables processing each tender individually\n\n**Why?** We need to fetch detailed data fo"
      }
    },
    {
      "id": "9771a8c2-ee4c-4241-8d7f-6fcbd51d7db2",
      "name": "Loop Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        1136
      ],
      "parameters": {
        "width": 340,
        "height": 328,
        "content": "## Loop Over Items (Rate Limiting)\n\n**What it does:**\n- Processes tenders one at a time\n- Prevents API rate limiting\n- Ensures reliable data fetching\n\n**How it works:**\n- Batch size: 1 (processes one "
      }
    },
    {
      "id": "853deb2c-0cb4-41ef-b0a4-9d50ea901023",
      "name": "JSON Details Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1248,
        288
      ],
      "parameters": {
        "width": 340,
        "height": 392,
        "content": "## Fetch JSON Details\n\n**API:** `/publicaties/{id}`\n\n**Returns:**\n- `kenmerk`: Reference number\n- `pbNummerTed`: TED publication number\n- `trefwoorden`: Keywords array\n- Categories and classifications"
      }
    },
    {
      "id": "b0681ea1-7fb4-4c8a-89dc-762efcc26628",
      "name": "XML Details Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1104,
        1152
      ],
      "parameters": {
        "width": 340,
        "height": 364,
        "content": "## Fetch XML Details\n\n**API:** `/publicaties/{id}/public-xml`\n\n**Returns:**\n- Full tender XML document\n- Legal requirements\n- Detailed specifications\n- Submission procedures\n\n**Format:** Raw XML (conv"
      }
    },
    {
      "id": "4efb2c89-67c7-4267-8aad-89563ccc490b",
      "name": "XML Parser Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1472,
        1152
      ],
      "parameters": {
        "width": 252,
        "height": 288,
        "content": "## Parse XML to JSON\n\n**What it does:**\n- Converts XML string to JSON object\n- Makes data accessible for filtering\n- Trims whitespace for cleaner data\n\n**Why?** JSON is easier to work with in n8n than"
      }
    },
    {
      "id": "3336713a-b66b-44c5-8535-ec5867913802",
      "name": "Merge Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1744,
        1152
      ],
      "parameters": {
        "width": 340,
        "height": 300,
        "content": "## Merge All Data\n\n**Combines three data sources:**\n1. JSON metadata (Input 1)\n2. Parsed XML details (Input 2)\n3. Original tender info (Input 3)\n\n**Result:** Complete tender record with all available "
      }
    },
    {
      "id": "fea0a1ef-83d5-4c59-90c2-f0a51c11d4b5",
      "name": "Aggregate Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2112,
        1152
      ],
      "parameters": {
        "width": 320,
        "height": 260,
        "content": "## Aggregate Loop Results\n\n**What it does:**\n- Collects all processed tenders from the loop\n- Combines them into a single array\n- Stores in 'allData' field\n\n**Why?** Prepares all tenders for batch pro"
      }
    },
    {
      "id": "9e2778bb-853f-459e-be8e-6eecce467ba6",
      "name": "Split for Filter Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        1136
      ],
      "parameters": {
        "width": 272,
        "height": 324,
        "content": "## Split for Filtering\n\n**What it does:**\n- Unpacks the aggregated array\n- Creates individual items again\n- Prepares for filtering\n\n**Note:** We aggregate first to exit the loop, then split again for "
      }
    },
    {
      "id": "4cf90e94-5a43-4c0e-bad0-0ec8ccc1cf63",
      "name": "Filter Configuration",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2832,
        1152
      ],
      "parameters": {
        "width": 360,
        "height": 360,
        "content": "## Filter Tenders\n\n**⚠️ CONFIGURE THIS NODE**\n\n**Purpose:** Filter tenders based on your criteria\n\n**Examples:**\n- CPV-code\n- Keywords in description\n- Specific categories (e.g., IT, Construction)\n- B"
      }
    },
    {
      "id": "a3c38818-7340-4886-a5c2-44c3d422f2f7",
      "name": "Database Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3296,
        1152
      ],
      "parameters": {
        "width": 376,
        "height": 360,
        "content": "## Save to Data Table\n\n**What it does:**\n- Inserts filtered tenders into database\n- Each tender becomes a new row\n\n**⚠️ Setup Required:**\n1. Run workflow first for available kolomn\n2. Build a n8n Data"
      }
    }
  ],
  "connections": {
    "XML": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          },
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Splits Alle Velden",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter op ...": {
      "main": [
        [
          {
            "node": "Insert row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Haal XML Details",
            "type": "main",
            "index": 0
          },
          {
            "node": "Haal JSON Details",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Haal XML Details": {
      "main": [
        [
          {
            "node": "XML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Tenderned Publicaties",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verwerk Response": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Haal JSON Details": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Splits Alle Velden": {
      "main": [
        [
          {
            "node": "Filter op ...",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tenderned Publicaties": {
      "main": [
        [
          {
            "node": "Verwerk Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Tenderned Publicaties",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}