What This Automation Does
This workflow automatically gets user info from a public API.
It picks just the name and country from the data.
Then it adds that info to a Google Sheets file and saves it as a CSV file locally.
It helps avoid manual copying and saves lots of time.
You will get clean user lists in your Google Sheets and a CSV file every time you run this.
This cuts simple mistakes when moving data by hand.
How This Workflow Works (Input → Process → Output)
Input
- Random User API: Provides user info in JSON format from https://randomuser.me/api/.
Processing Steps
- HTTP Request node: Fetches raw user data from the API.
- Set node: Extracts just first+last name and country from the raw JSON.
- Google Sheets node: Adds this cleaned data to the Google Sheets spreadsheet as new rows.
- Spreadsheet File node: Creates a CSV file from the same data for offline use.
Output
- New rows in Google Sheets containing user names and countries.
- A CSV file named users_spreadsheet.csv saved locally containing the same data.
Who Should Use This Workflow
Users who want to save time collecting user info from public APIs.
Anyone tired of copying and pasting names and countries by hand.
Ideal for teams sharing user data as sheets or CSV files.
Tools and Services Used
- Random User API: Supplies random user data in JSON.
- Google Sheets: Stores user info as a live spreadsheet online.
- n8n: Orchestrates all the data fetching, setting, appending, and exporting steps.
If self hosting is preferred, use self-host n8n to control the automation environment.
Beginner Step-by-Step: How to Use This Workflow in n8n
Import the Workflow
- Click the Download button on this page to get the workflow JSON file.
- Open your n8n editor where you want to run this automation.
- Use the menu option “Import from File” and pick the downloaded JSON file.
Configure Credentials and IDs
- Add Google Sheets OAuth2 credentials inside n8n if not already done.
- Enter the Google Sheet ID where data should be appended (found in your Google Sheets URL).
- Update the Range to match columns where name and country will go, like A:C.
Test the Workflow
- Run the workflow manually once to check it connects to the API and writes to sheets correctly.
- Look for any errors. Fix credential or sheet ID if needed.
Activate for Production
- When tests pass, turn the workflow ON by toggling the switch in n8n.
- Optionally, add a Cron Trigger to schedule automatic runs daily or weekly.
Common Problems and How to Fix Them
Problem: “Unauthorized” or “Permission Denied” in Google Sheets node
Cause: Google Sheets OAuth2 credential expired or was set wrong.
Fix: Re-authenticate Google Sheets credentials in n8n credentials section.
Problem: Empty fields from Set node
Cause: JSON paths are incorrect or data structure changed.
Fix: Check HTTP Request output and adjust JSON path syntax in the Set node expressions.
Customization Ideas
- Fetch many users at once by changing the URL in the HTTP Request node to https://randomuser.me/api/?results=10 and set the workflow to loop over each user result.
- Add more user info like email or phone by adding more fields in the Set node with correct JSON paths.
- Change CSV output formats in the Spreadsheet File node, for example save as Excel instead of CSV.
- Automate repeating runs by adding a Cron Trigger node to schedule daily or weekly data updates.
Pre-Production Checklist
- Check that Google Sheets credentials allow appending rows without errors.
- Test HTTP Request node alone to be sure the API is reachable and sends expected data.
- Make sure the Set node only produces the desired name and country fields.
- Verify new rows appear in the right spreadsheet and columns.
- Confirm the Spreadsheet File node generates a CSV file named as expected.
Summary
→ Automates user info fetch from Random User API.
→ Extracts simple details (name and country).
→ Adds records to Google Sheets spreadsheet.
→ Creates a CSV file for offline use.
✓ Saves time by stopping manual copying.
✓ Keeps data consistent and less error-prone.
✓ Easy to set up and extend for more fields or use cases.

