What makes Firebase easy or hard to automate
Firebase makes event-driven automation natural. Cloud Functions can run on Firestore writes, Authentication events, Storage uploads and schedules, so the moment a user signs up or a document changes, server code can act. n8n has built-in nodes for Firestore and Realtime Database, and the Admin SDK is available in several languages.
The hard parts come from Firestore’s data model. Documents are nested and denormalized, there are no joins, and many queries need composite indexes defined in advance. That is fine for an app, but it makes ad-hoc reporting and text-to-query awkward. Security is also split: client apps are governed by security rules, while service accounts used by workflows bypass those rules completely.
The AI layer
AI features in a Firebase app usually sit in one of three places:
- Server-side in Cloud Functions. The function reads the user’s data, retrieves context, calls Claude, Gemini or OpenAI’s GPT models with keys stored as secrets, and writes the result back to Firestore for the app to display.
- Client-side through Firebase AI Logic. Apps can call Google’s Gemini models directly with App Check protecting the endpoint, which suits lightweight features.
- In workflows. n8n reacts to events forwarded by Cloud Functions and handles messaging, enrichment and internal alerts.
Genkit, Google’s open-source framework for AI features, is an option for teams that want flows and tool calling in TypeScript, Go or Dart (with Python in preview) inside Firebase. Firestore vector search covers retrieval for most in-app assistants.
Limits to plan around
- No joins. Model your data for the questions the AI feature asks, or export to BigQuery for analysis.
- Service account scope. Service accounts bypass security rules. Grant minimal IAM roles and keep credentials in server secrets.
- Index requirements. Vector and compound queries need indexes created ahead of time, and missing ones fail at query time.
- Read costs. Firestore bills per document read. An agent that reads whole collections to answer a question gets expensive quickly.
- Function timeouts. Long model calls should run in functions with longer timeouts or be queued, not done inline in a client request.
How Lumeor typically connects it
For Firebase apps we put model calls in Cloud Functions, store embeddings in Firestore for in-app assistants, and forward key events to n8n for messaging and internal workflows. Reporting runs on a BigQuery export. Typical builds are an in-app support agent and onboarding messages. Teams weighing a Postgres-based backend should compare with our Supabase page.