{
  "name": "Collect API user data and store in Google Sheets with CSV backup",
  "nodes": [
    {
      "id": "6db177f3-d001-4f14-b1eb-cb61a78acf0b",
      "name": "Start Workflow Manually",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        48,
        672
      ]
    },
    {
      "id": "bd75fa5c-cdbc-41e6-bb85-16f7e677f8f8",
      "name": "Fetch User Data from API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        272,
        672
      ]
    },
    {
      "id": "f193bb20-baa5-482a-aab3-bb37f884d1aa",
      "name": "Verify API Response Success",
      "type": "n8n-nodes-base.if",
      "position": [
        496,
        672
      ]
    },
    {
      "id": "b9d06596-07ff-4214-a446-30522c516372",
      "name": "Transform API Data to Name and Country",
      "type": "n8n-nodes-base.function",
      "position": [
        752,
        672
      ]
    },
    {
      "id": "0ad2fa3d-3280-490f-95de-cee3ea18acc7",
      "name": "Append Data to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        976,
        672
      ]
    },
    {
      "id": "6d41aadd-d40b-4575-b336-853027a82669",
      "name": "Create CSV Backup File",
      "type": "n8n-nodes-base.spreadsheetFile",
      "position": [
        1200,
        672
      ]
    },
    {
      "id": "61f16acf-e6ac-4883-8dbe-f23d1c8d6b9e",
      "name": "Workflow Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "69e49ede-d0fe-4a70-9320-36c8e17e3018",
      "name": "Stop on API Failure",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        752,
        848
      ]
    },
    {
      "id": "2d01307d-a506-4e03-a364-22cbaeb05e3a",
      "name": "Step 1 - Trigger",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        0
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "0a1daf1e-68a7-47fa-9281-07c74703dafa",
      "name": "Step 2 - API Request",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        0
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "c85e3f8a-0e99-48a8-98ad-428675dcddab",
      "name": "Step 3 - Validation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        768,
        0
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "8a2d226c-f612-4dbe-baf5-b7ffbeef7fb7",
      "name": "Step 4 - Transform",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1024,
        0
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "8759aba8-51d3-4168-9e1a-d38fa1a4f651",
      "name": "Step 5 - Google Sheets",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        0
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "ac87e4f5-0cf3-44f3-bbbb-023cd408cacd",
      "name": "Step 6 - CSV Backup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1536,
        48
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "Start Workflow Manually": {
      "main": [
        [
          {
            "node": "Fetch User Data from API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch User Data from API": {
      "main": [
        [
          {
            "node": "Verify API Response Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verify API Response Success": {
      "main": [
        [
          {
            "node": "Transform API Data to Name and Country",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Stop on API Failure",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append Data to Google Sheets": {
      "main": [
        [
          {
            "node": "Create CSV Backup File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transform API Data to Name and Country": {
      "main": [
        [
          {
            "node": "Append Data to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}