{ "nodes": [ { "id": "explore-http-request-examples-0", "name": "On clicking 'execute'", "type": "n8n-nodes-base.manualTrigger", "position": [ 925, 285 ], "parameters": {}, "typeVersion": 1 }, { "id": "explore-http-request-examples-1", "name": "Note", "type": "n8n-nodes-base.stickyNote", "position": [ 380, 240 ], "parameters": { "width": 440, "height": 200, "content": "## HTTP Request\n### This workflow shows the most common use cases of the HTTP request node, and how to handle its output\n\n\n### Click the `Execute Workflow` button and double click on the nodes to see the input and output items." }, "typeVersion": 1 }, { "id": "explore-http-request-examples-2", "name": "Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 1280, 480 ], "parameters": { "width": 986.3743856726365, "height": 460.847917534361, "content": "## 3. Handle Pagination\n### Sometimes you need to make the same request multiple times to get all the data you need (pagination).\n\n### The pagination process goes as follow:\n### 1. Loop through the pages of the input source (`HTTP Request` node named \"Get my Starts\")\n### 2. Increment the page at the end of each loop (done with the `set` node named \"Increment Page\") \n### 3. Stop looping when there are no pages left (checked at the `If` node named \"Are we Finished?\")\n\n\n\n" }, "typeVersion": 1 }, { "id": "explore-http-request-examples-3", "name": "Set", "type": "n8n-nodes-base.set", "position": [ 1345, 725 ], "parameters": { "values": { "number": [ { "name": "page", "value": 1 }, { "name": "perpage", "value": 15 } ], "string": [ { "name": "githubUser", "value": "YOUR_GITHUB_USERNAME" } ] }, "options": {} }, "typeVersion": 1 }, { "id": "explore-http-request-examples-4", "name": "Note6", "type": "n8n-nodes-base.stickyNote", "disabled": true, "position": [ 1280, 180 ], "parameters": { "width": 680, "height": 280, "content": "## 2. Data Scraping\n### In this example we fetch the titles from the n8n blog using the `HTTP request` node and then we use the `HTML extract` node to pass." }, "typeVersion": 1 }, { "id": "explore-http-request-examples-5", "name": "Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 1280, -120 ], "parameters": { "width": 500, "height": 280, "content": "## 1. Split into items\n### In this example, we take the body from an `HTTP Request` node and split it out into items that are easier to manage." }, "typeVersion": 1 }, { "id": "explore-http-request-examples-6", "name": "Item Lists - Create Items from Body", "type": "n8n-nodes-base.itemLists", "notes": "Create Items from Body", "position": [ 1525, -15 ], "parameters": { "options": {}, "fieldToSplitOut": "body" }, "notesInFlow": false, "typeVersion": 1 }, { "id": "explore-http-request-examples-7", "name": "HTML Extract - Extract Article Title", "type": "n8n-nodes-base.htmlExtract", "position": [ 1505, 285 ], "parameters": { "options": {}, "sourceData": "binary", "extractionValues": { "values": [ { "key": "ArticleTitle", "cssSelector": "#firstHeading" } ] } }, "typeVersion": 1 }, { "id": "explore-http-request-examples-8", "name": "Item Lists - Fetch Body", "type": "n8n-nodes-base.itemLists", "position": [ 1705, 725 ], "parameters": { "options": {}, "fieldToSplitOut": "body" }, "typeVersion": 1, "alwaysOutputData": true }, { "id": "explore-http-request-examples-9", "name": "HTTP Request - Get Mock Albums", "type": "n8n-nodes-base.httpRequest", "position": [ 1345, -15 ], "parameters": { "url": "https://jsonplaceholder.typicode.com/albums", "options": { "response": { "response": { "fullResponse": true } } } }, "typeVersion": 3 }, { "id": "explore-http-request-examples-10", "name": "HTTP Request - Get Wikipedia Page", "type": "n8n-nodes-base.httpRequest", "position": [ 1325, 285 ], "parameters": { "url": "https://en.wikipedia.org/wiki/Special:Random", "options": { "redirect": { "redirect": { "followRedirects": true } }, "response": { "response": { "responseFormat": "file" } } } }, "typeVersion": 3 }, { "id": "explore-http-request-examples-11", "name": "HTTP Request - Get my Stars", "type": "n8n-nodes-base.httpRequest", "position": [ 1525, 725 ], "parameters": { "url": "={{ 'https://api.github.com/users/' + $('Set').first().json.githubUser + '/starred?per_page=15&page=1' }}", "options": { "response": { "response": { "fullResponse": true, "responseFormat": "json" } }, "pagination": { "pagination": { "paginationMode": "responseContainsNextURL", "nextURL": "={{ 'https://api.github.com/users/' + $('Set').first().json.githubUser + '/starred?per_page=15&page=' + ($pageCount + 1) }}", "paginationCompleteWhen": "other", "completeExpression": "={{ $response.body.length < 15 }}", "limitPagesFetched": false } } } }, "typeVersion": 4.2 } ], "connections": { "Set": { "main": [ [ { "node": "HTTP Request - Get my Stars", "type": "main", "index": 0 } ] ] }, "On clicking 'execute'": { "main": [ [ { "node": "Set", "type": "main", "index": 0 }, { "node": "HTTP Request - Get Mock Albums", "type": "main", "index": 0 }, { "node": "HTTP Request - Get Wikipedia Page", "type": "main", "index": 0 } ] ] }, "Item Lists - Fetch Body": { "main": [ [] ] }, "HTTP Request - Get my Stars": { "main": [ [ { "node": "Item Lists - Fetch Body", "type": "main", "index": 0 } ] ] }, "HTTP Request - Get Mock Albums": { "main": [ [ { "node": "Item Lists - Create Items from Body", "type": "main", "index": 0 } ] ] }, "HTTP Request - Get Wikipedia Page": { "main": [ [ { "node": "HTML Extract - Extract Article Title", "type": "main", "index": 0 } ] ] } }, "name": "Explore HTTP Request Examples", "active": false, "pinData": {} }