Collect API User Data and Store in Google Sheets with CSV Backup
Go to WorkflowDescription
🧠 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.