Collect API User Data and Store in Google Sheets with CSV Backup

🧠 Overview

This workflow automatically fetches user data from an API, formats it, and stores it in Google Sheets and CSV files.

šŸ’” Use Cases

Collect user records for analytics or reporting Maintain centralized spreadsheets for marketing or CRM Export CSV backups for offline analysis or integrations

šŸ“˜ Good to Know

Uses the BASE_URL environment variable for the API endpoint Google Sheets integration requires OAuth2 credentials CSV export saves a local copy for backup or external use Optional error handler ensures the workflow stops safely if any step fails

āš™ļø How It Works

Manual Trigger – Start the workflow manually or via schedule HTTP Request – Fetch data from the API endpoint Set Node – Extract and format fields like name (first + last) and country Google Sheets – Append processed data to a Google Sheet

Sheet ID: qwertz Range: A:C Spreadsheet File – Export data to CSV (users_spreadsheet.csv) Error Handler – Stops workflow if any step fails

šŸš€ How to Use

Trigger the workflow manually or schedule it Ensure environment variables and credentials are configured Check the Google Sheet for appended user data Access the CSV file for backups or external use

🧩 Requirements

API endpoint (BASE_URL) Google Sheets OAuth2 credentials Permission to write files for CSV export

āš™ļø Setup Instructions

Set Environment Variables:

Add BASE_URL in workflow environment variables. Configure Google Sheets Node:

Authenticate with your Google account using OAuth2. Specify the target Sheet ID and range. Check File Permissions:

Ensure the workflow has write access to store users_spreadsheet.csv. Test the API Response Format:

Expected JSON fields: first_name, last_name, country, etc. Adjust the Set Node to map any additional fields as required.

šŸ› ļø Customizing the Workflow

Change API Source:** Update the HTTP Request node to any user data API. Add More Fields:** Modify the Set node to map additional fields from the API response. Multi-Sheet Distribution:** Append data to multiple Google Sheets if needed. Automated Scheduling:** Trigger workflow automatically at intervals. Add Notifications:** Send email or Slack notifications after data collection.

0
Downloads
1
Views
7.28
Quality Score
beginner
Complexity
Author:PrideVel(View Original →)
Created:11/4/2025
Updated:11/17/2025

šŸ”’ Please log in to import templates to n8n and favorite templates

Workflow Visualization

Loading...

Preparing workflow renderer

Comments (0)

Login to post comments