{
  "name": "ApiSkills — Data Shapes & Pagination",
  "nodes": [
    {
      "parameters": {},
      "id": "trigger-data",
      "name": "When clicking Test workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [0, 0]
    },
    {
      "parameters": {
        "url": "https://api.aiwf.in/playground/data/fpa/actuals",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [{ "name": "x-api-key", "value": "PASTE_YOUR_API_KEY" }]
        },
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            { "name": "shape", "value": "nested" },
            { "name": "page_size", "value": "50" }
          ]
        },
        "options": {
          "pagination": {
            "pagination": {
              "paginationMode": "responseContainsNextURL",
              "nextURL": "={{ $response.body.pagination.next }}",
              "paginationCompleteWhen": "other",
              "completeExpression": "={{ $response.body.pagination.next === null }}",
              "limitPagesFetched": true,
              "maxRequests": 20
            }
          }
        }
      },
      "id": "http-data",
      "name": "HTTP Request (paginated)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [240, 0]
    }
  ],
  "connections": {
    "When clicking Test workflow": {
      "main": [[{ "node": "HTTP Request (paginated)", "type": "main", "index": 0 }]]
    }
  },
  "settings": {},
  "meta": {
    "apiskills": "Demonstrates following the relative `next` link. Set x-api-key, try shape = flat | list-of-lists | nested | nested-list, and watch n8n follow pagination.next until it is null. Replace api.aiwf.in with your API domain."
  }
}
