AutomationFlowsData & Sheets › Idps

Idps

IDPS. Uses start, httpRequest, spreadsheetFile, itemLists. Manual trigger; 8 nodes.

Manual trigger★★★★☆ complexity8 nodesStartHTTP RequestSpreadsheet FileItem Lists
Data & Sheets Trigger: Manual Nodes: 8 Complexity: ★★★★☆ Added:

This workflow follows the HTTP Request → Itemlists recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "IDPS",
  "nodes": [
    {
      "parameters": {},
      "id": "8159bfb3-3561-49c6-90f5-626832f24542",
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        -560,
        120
      ]
    },
    {
      "parameters": {
        "url": "https://data.humdata.org/dataset/459fc96c-f196-44c1-a0a5-1b5a7b3592dd/resource/0fb4e415-abdb-481a-a3c6-8821e79919be/download/displacement_data.csv",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "id": "c33ad596-6b64-46c3-9538-9f752ad46380",
      "name": "Get CSV",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        -340,
        120
      ]
    },
    {
      "parameters": {
        "options": {
          "headerRow": true,
          "includeEmptyCells": false
        }
      },
      "id": "648e58a7-ac3a-453d-aa8b-b5a013b39b46",
      "name": "Spreadsheet File",
      "type": "n8n-nodes-base.spreadsheetFile",
      "typeVersion": 1,
      "position": [
        -120,
        120
      ],
      "alwaysOutputData": false
    },
    {
      "parameters": {},
      "id": "1224676d-e33e-40c3-b6c6-491757280425",
      "name": "Data",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        100,
        120
      ],
      "notesInFlow": true,
      "notes": "Do not rename"
    },
    {
      "parameters": {
        "functionCode": "let output = [];\n\nfor (item of items) {\n  // Skip hxl row.\n  if (item.json.ISO3.substr(0, 1) == '#') {\n    continue;\n  }\n\n  // Skip empty iso3.\n  if (item.json.ISO3 == '') {\n    continue;\n  }\n\n  if (item.json['Conflict Stock Displacement']) {\n    output.push({\n      id: 'idps_' + item.json.ISO3 + '_' + item.json.Year + '_conflict_stock_displacement',\n      country: item.json.Name,\n      iso3: item.json.ISO3,\n      year: item.json.Year.toString(),\n      name: 'Conflict Stock Displacement',\n      value: item.json['Conflict Stock Displacement'].toString(),\n      source: 'iDMC',\n      url: 'https://data.humdata.org/dataset/idmc-internally-displaced-persons-idps',\n    });\n  }\n\n  if (item.json['Conflict Internal Displacements']) {\n    output.push({\n      id: 'idps_' + item.json.ISO3 + '_' + item.json.Year + '_conflict_internal_displacements',\n      country: item.json.Name,\n      iso3: item.json.ISO3,\n      year: item.json.Year.toString(),\n      name: 'Conflict Internal Displacements',\n      value: item.json['Conflict Internal Displacements'].toString(),\n      source: 'iDMC',\n      url: 'https://data.humdata.org/dataset/idmc-internally-displaced-persons-idps',\n    });\n  }\n\n  if (item.json['Disaster Internal Displacements']) {\n    output.push({\n      id: 'idps_' + item.json.ISO3 + '_' + item.json.Year + '_disaster_internal_displacements',\n      country: item.json.Name,\n      iso3: item.json.ISO3,\n      year: item.json.Year.toString(),\n      name: 'Disaster Internal Displacements',\n      value: item.json['Disaster Internal Displacements'].toString(),\n      source: 'iDMC',\n      url: 'https://data.humdata.org/dataset/idmc-internally-displaced-persons-idps',\n    });\n  }\n\n  if (item.json['Disaster Stock Displacement']) {\n    output.push({\n      id: 'idps_' + item.json.ISO3 + '_' + item.json.Year + '_disaster_stock_displacement',\n      country: item.json.Name,\n      iso3: item.json.ISO3,\n      year: item.json.Year.toString(),\n      name: 'Disaster Stock Displacement',\n      value: item.json['Disaster Stock Displacement'].toString(),\n      source: 'iDMC',\n      url: 'https://data.humdata.org/dataset/idmc-internally-displaced-persons-idps',\n    });\n  }\n}\n\nreturn output;"
      },
      "id": "76eacaf1-faf7-40f7-be77-4720a7d26a12",
      "name": "Build records",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        320,
        120
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $env.OCHA_API_URL }}/idps/batch",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "API-KEY",
              "value": "35f2bcd196b3776f0b35a9a09a019555"
            }
          ]
        },
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "application/json",
        "body": "={{$json}}",
        "options": {}
      },
      "id": "150fb541-22e4-470d-963d-ded49c31694c",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        1000,
        120
      ]
    },
    {
      "parameters": {
        "batchSize": 100,
        "options": {}
      },
      "id": "adc84dfa-31a6-4225-9b92-bbb50f0954d6",
      "name": "SplitInBatches",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 1,
      "position": [
        520,
        120
      ]
    },
    {
      "parameters": {
        "operation": "aggregateItems",
        "aggregate": "aggregateAllItemData"
      },
      "id": "a139672d-eaea-4d8c-a1f3-bb165f390005",
      "name": "Item Lists",
      "type": "n8n-nodes-base.itemLists",
      "typeVersion": 1,
      "position": [
        740,
        120
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Get CSV",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get CSV": {
      "main": [
        [
          {
            "node": "Spreadsheet File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Spreadsheet File": {
      "main": [
        [
          {
            "node": "Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Data": {
      "main": [
        [
          {
            "node": "Build records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build records": {
      "main": [
        [
          {
            "node": "SplitInBatches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SplitInBatches": {
      "main": [
        [
          {
            "node": "Item Lists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "SplitInBatches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Item Lists": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "id": 3,
  "tags": []
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

IDPS. Uses start, httpRequest, spreadsheetFile, itemLists. Manual trigger; 8 nodes.

Source: https://github.com/UN-OCHA/ocha-api-site/blob/2f29668a839d0eb0186b23be30d241325d4d4450/n8n/IDPS.json — original creator credit. Request a take-down →

More Data & Sheets workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Data & Sheets

ofn hook v0.24.0 beta. Uses start, httpRequest, functionItem, itemLists. Scheduled trigger; 42 nodes.

Start, HTTP Request, Function Item +3
Data & Sheets

Manual Http. Uses manualTrigger, salesforce, itemLists, renameKeys. Event-driven trigger; 14 nodes.

Salesforce, Item Lists, HTTP Request +1
Data & Sheets

Workflow 1794. Uses salesforce, itemLists, httpRequest, spreadsheetFile. Event-driven trigger; 14 nodes.

Salesforce, Item Lists, HTTP Request +1
Data & Sheets

This workflow illustrates how to convert data from JSON to binary format and import JSON data or files into Google Sheets or local spreadsheets.

HTTP Request, Google Sheets, Spreadsheet File +3
Data & Sheets

This workflow shows a no code approach to creating Salesforce accounts and contacts based on data coming from an Excel file. For Excel 365 (the online version of Microsoft Excel) check out this workfl

Salesforce, Item Lists, HTTP Request +1