🚀 Ultimate Guide: Sync ALL Firebase Auth Users to Google Sheets (Handles 1000+ Users) — No Code, Just n8n!
No Firestore. No Backend. No Servers. Just pure Firebase Auth → n8n → Google Sheets — with pagination!
Perfect for: Newsletter creators, SaaS founders, Marketing teams, Indie hackers, Automation geeks
📅 Updated: April 2025 | 🛠️ Tools: Firebase Auth, n8n, Google Sheets, Service Account API
🌟 Why This Matters
You built a website. Users sign up with Google. Firebase Auth stores them securely.
But… you can’t see them — especially if you have 1000+ users.
Firebase Auth API returns max 1000 users per call. Without pagination, you miss data.
This workflow:
- ✅ Fetches ALL users (even 10,000+)
- ✅ Automatically paginates through results
- ✅ Upserts into Google Sheets (no duplicates)
- ✅ Runs daily, automatically
All in n8n — no code, no backend.
🧰 What You’ll Build
- ✅ Schedule Trigger → Runs daily at midnight
- ✅ Initialize State → Prepares
pageToken,allUsers[] - ✅ HTTP Request → Fetches 1000 users per page from Firebase Auth API
- ✅ Merge & Check Pagination → Merges current page + checks if more pages exist
- ✅ Loop Back → If
hasMore = true, fetch next page - ✅ Format Final Data → Clean, readable columns
- ✅ Google Sheets → Upsert by Email (no duplicates!)
📦 Tools You Need
| Tool | Why | Free? |
|---|---|---|
| Firebase | Stores your users | ✅ Yes |
| n8n | Automates everything visually + code | ✅ Free tier |
| Google Sheets | Your user database | ✅ Yes |
🧭 STEP-BY-STEP: UPDATED WORKFLOW
All nodes are connected in order. Execute each step to test.
✅ STEP 0: One-Time Setup
A. Create Your Google Sheet
- Go to sheets.google.com
- Create a new sheet → Name it:
Firebase Auth Users - In Row 1, add headers:
exportedAt | uid | email | displayName | phoneNumber | emailVerified | disabled | createdAt | lastLoginAt - Click Share → Get shareable link → Set to “Anyone with link can edit” (for testing)
B. Set Up n8n Credentials
- Go to n8n.cloud → Sign up (free)
- Go to Credentials → Add Credential
- Add “Google Service Account API”
- Credential Type:
Firebase Admin SDK - Paste your Firebase Service Account JSON (from Console → Project Settings → Service Accounts)
- Save as:
Firebase Auth API - Add Google Sheets OAuth → Connect your Google Account → Allow access
🧩 STEP 1: Build the Workflow
➤ NODE 1: Schedule Trigger (Run Daily)
- Add “Cron” node
- Mode:
Every Day - Timezone:
Asia/Kolkata(or your timezone) - Time:
00:05 - Name:
Daily Trigger
➤ NODE 2: Function → Initialize Pagination State
- Add “Function” node → Connect from Cron
- Name:
Initialize State
fir-fb08a with your actual Firebase Project ID.
➤ NODE 3: HTTP Request → Fetch Users (Paginated)
- Add “HTTP Request” node → Connect from Function
- Name:
Fetch Auth Users Page - Method:
POST - URL:
https://identitytoolkit.googleapis.com/v1/projects/{{$json.project_id}}/accounts:query - Authentication:
Predefined Credential Type - Credential Type:
Google Service Account API - Credential:
Firebase Auth API
Headers:
| Name | Value |
|---|---|
Authorization | Bearer {{$json.accessToken}} |
Content-Type | application/json |
Body (JSON):
pageToken if it exists.
➤ NODE 4: Function → Merge Users + Check Pagination
- Add “Function” node → Connect from HTTP Request
- Name:
Merge Users & Check Next Page
hasMore: true/false → used for looping.
➤ NODE 5: IF → Check if More Pages Exist
- Add “IF” node → Connect from Function
- Name:
More Pages? - Condition:
- Value 1:
hasMore - Operation:
is equal to - Value 2:
true
- Value 1:
🔄 Connect FALSE output → to next step (formatting)
➤ NODE 6: Function → Format Final User Data
- Add “Function” node → Connect from IF → FALSE
- Name:
Format Users for Sheets
➤ NODE 7: Google Sheets → Upsert by Email
- Add “Google Sheets” node → Connect from Function
- Operation:
Append or Update Row - Document:
By ID→ Paste your Sheet ID (from URL) - Sheet Name: Select your sheet (e.g.,
Firebase Auth Users) - Mapping Column Mode:
Map Automatically - Column to Match On:
email← Prevents duplicates! - Credentials: Your Google Sheets OAuth credential
🧠 PRO TIPS & BEST PRACTICES
➤ Handle Rate Limits
Add a “Wait” node (1-2 sec) between page fetches if you hit rate limits.
➤ Add Error Handling
Use “Catch” node → log failed pages to another sheet.
➤ Schedule Weekly for Large Datasets
If you have 50k+ users, run weekly to avoid timeouts.
➤ Add “Last Sync” Column
In Sheet → add column → ={{ $now }} → track when sync ran.
🚫 COMMON ERRORS & FIXES
| Error | Fix |
|---|---|
403 Permission Denied | Ensure Service Account has “Firebase Auth Viewer” role in Google Cloud IAM |
Invalid Page Token | Reset pageToken: null in Initialize State |
Column Mismatch | Ensure Sheet headers exactly match formatted output |
Timeout | Increase timeout in HTTP Request node → 300000 ms |
🎁 BONUS: DOWNLOAD WORKFLOW JSON
Want to import this workflow directly into n8n?
👉 Download Workflow JSON (placeholder — you can export from n8n)
💬 FINAL THOUGHTS
You just built an enterprise-grade, scalable, no-code user sync system.
Handles pagination. Prevents duplicates. Runs automatically.
No developers. No budget. No headaches.
Just you, n8n, and automation.
🚀 “Automate the boring stuff — focus on what matters.”
📣 CALL TO ACTION
✅ Like this guide? Share it with your network!
✅ Stuck? Drop a comment — I’ll help you!
✅ Want Part 2? “Sync New Users to Mailchimp + Send Welcome Email” — let me know!
#Firebase #n8n #GoogleSheets #NoCode #Automation #SaaS #IndieHacker #Marketing #UserGrowth #Pagination
Join the Discussion