{ "name": "Export DeepSearchQA from DataBazaar to CSV with HTTP Request", "nodes": [ { "parameters": {}, "id": "f456a6f7-ee90-42aa-90c7-f6afd8355126", "name": "Run export", "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [ 0, 0 ] }, { "parameters": { "url": "https://api.databazaar.io/datasets/24cf80b3-5f47-4da6-a6a5-0540b3688343", "options": { "timeout": 20000, "redirect": { "redirect": { "followRedirects": false } }, "response": { "response": { "responseFormat": "json" } } } }, "id": "42eb085b-ad8c-44ee-ad5f-b9080260175e", "name": "Read public listing", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 220, 0 ] }, { "parameters": { "jsCode": "const d = $input.first().json;\nif (d.id !== '24cf80b3-5f47-4da6-a6a5-0540b3688343' || d.status !== 'active' || d.pricing_type !== 'free') {\n throw new Error('The selected listing is unavailable or no longer free. Inspect it before continuing.');\n}\nconst count = d.schema?.row_count;\nif (!Number.isInteger(count) || count < 1 || count > 1000) {\n throw new Error('The declared row count is outside this bounded export. Inspect the listing.');\n}\nreturn [{ json: { declared_rows: count, dataset_id: d.id } }];" }, "id": "a06fbae9-8cec-4e9b-8a59-a05c35eb3587", "name": "Check free listing", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 440, 0 ] }, { "parameters": { "method": "POST", "url": "https://api.databazaar.io/datasets/24cf80b3-5f47-4da6-a6a5-0540b3688343/query", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendBody": true, "specifyBody": "json", "jsonBody": "{\"select\": [\"problem\", \"problem_category\", \"answer\", \"answer_type\"], \"limit\": 1000}", "options": { "timeout": 120000, "redirect": { "redirect": { "followRedirects": false } }, "response": { "response": { "responseFormat": "text", "outputPropertyName": "data" } } } }, "id": "c4bb167b-5e9d-44bc-81ca-473e0086c4ae", "name": "Retrieve benchmark rows", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 660, 0 ] }, { "parameters": { "jsCode": "const text = $input.first().json.data;\nif (typeof text !== 'string' || text.length > 2000000) throw new Error('Expected a bounded NDJSON response.');\nconst lines = text.trim().split(/\\r?\\n/).filter(Boolean);\nconst expected = $('Check free listing').first().json.declared_rows;\nif (lines.length !== expected) throw new Error(`Received ${lines.length} rows; listing declares ${expected}. Inspect for truncation or source changes.`);\nconst fields = ['problem', 'problem_category', 'answer', 'answer_type'];\nreturn lines.map((line, i) => {\n const row = JSON.parse(line);\n if (!row || fields.some(f => typeof row[f] !== 'string')) throw new Error(`Unexpected schema at row ${i + 1}.`);\n return { json: Object.fromEntries(fields.map(f => [f, row[f]])) };\n});" }, "id": "3162f745-79a7-4ddd-84db-d09bc4f75794", "name": "Validate NDJSON rows", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 880, 0 ] }, { "parameters": { "operation": "csv", "options": { "fileName": "deepsearchqa.csv", "headerRow": true } }, "id": "4ca11926-c805-4612-a0f8-c077213321fc", "name": "Create CSV file", "type": "n8n-nodes-base.convertToFile", "typeVersion": 1.1, "position": [ 1100, 0 ] }, { "parameters": { "content": "## Export DeepSearchQA from DataBazaar to CSV with HTTP Request\n\nFor agent builders preparing evaluation inputs from Google\u2019s DeepSearchQA benchmark. This independent DataBazaar example produces a CSV with problem, problem_category, answer and answer_type. It prepares data; it does not run or score a model.\n\n### How it works\nHTTP Request reads the public listing. A Code node verifies the dataset ID, free status and declared row count. A second HTTP Request retrieves up to 1,000 rows using your DataBazaar credential. Another Code node validates the NDJSON and expected fields before Convert to File creates deepsearchqa.csv.\n\nTested with n8n 2.42.6: all 900 rows matched Google\u2019s original CSV. Unexpected schemas, incomplete responses and listings that are no longer free stop the workflow. There are no purchases, model calls, uploads or scheduled triggers.\n\n### Setup\n1. Inspect the [listing and sample](https://databazaar.io/d/4k) and [Google\u2019s dataset card](https://huggingface.co/datasets/google/deepsearchqa).\n2. Create a DataBazaar account and an API key at Account \u2192 API Keys.\n3. In Retrieve benchmark rows, create a Header Auth credential: name Authorization; value Bearer YOUR_DATABAZAAR_API_KEY. Keep the key out of shared workflow files.\n4. Execute manually, then download the data binary output from Create CSV file.\n\nFull retrieval requires an account, including free datasets. Your n8n hosting has its own costs. [Setup and troubleshooting](https://databazaar.io/guides/deepsearchqa-csv#n8n).\n\n### Customization tips\nUse the validated rows downstream, but keep reference answers out of agent prompts. Changing only the dataset ID is insufficient for other datasets: review the guard and schema together.", "color": 1, "width": 570, "height": 1000 }, "id": "1f252ed9-0f93-4273-b25e-034013fe141f", "name": "Workflow overview and setup", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -670, -100 ] }, { "parameters": { "content": "## Check the listing\nRead public metadata and require this dataset to be active and free.", "color": 7, "width": 650, "height": 300 }, "id": "85861e0d-310d-498f-a076-8081120dbe19", "name": "Check dataset access", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -60, -80 ] }, { "parameters": { "content": "## Retrieve, validate, export\nUse your account credential, validate the complete response, then download the CSV.", "color": 7, "width": 710, "height": 300 }, "id": "5e9fcbc3-0823-4d09-8000-ba51e6af7379", "name": "Retrieve and export", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ 620, -80 ] } ], "connections": { "Run export": { "main": [ [ { "node": "Read public listing", "type": "main", "index": 0 } ] ] }, "Read public listing": { "main": [ [ { "node": "Check free listing", "type": "main", "index": 0 } ] ] }, "Check free listing": { "main": [ [ { "node": "Retrieve benchmark rows", "type": "main", "index": 0 } ] ] }, "Retrieve benchmark rows": { "main": [ [ { "node": "Validate NDJSON rows", "type": "main", "index": 0 } ] ] }, "Validate NDJSON rows": { "main": [ [ { "node": "Create CSV file", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "active": false, "pinData": {}, "tags": [] }