Google Firestore
DatabaseConnect AI agents to Cloud Firestore. Agents create, read, update, delete, list, query, and aggregate documents with plain JSON in and plain JSON out.
What This Integration Enables
Agents persist form submissions, webhook payloads, and AI-generated records into a collection, look up and update user or app data, run structured and collection-group queries, and compute Count, Sum, or Average with Run Aggregation Query. Aggregations are billed by index entries scanned rather than documents read, so counting a large collection is far cheaper than fetching it. Query Documents combines field conditions with AND, supports collection-group queries across every collection with a given id, and returns each document as plain JSON with its id, path, and timestamps.
Without FlowRunner
With FlowRunner
Use Case Scenarios
Logging inbound events
When a Gmail or webhook trigger fires upstream, the agent calls Create Document to log the sender, subject, and body into a `messages` collection. The records are queryable later with Query Documents, so an operational history builds up as a byproduct of the flow.
Cheap reporting with aggregations
The agent calls Run Aggregation Query to compute a Count or Sum over a filtered collection without reading the documents, then writes the figure back into a per-tenant config document with Update Document so the application reads the summary directly. Reporting stays fast and inexpensive.
Cleanup with a human gate
An agent is asked to remove a set of documents from a production collection. Before it runs Delete Document across that set above the configured threshold, it does not act on its own. It routes the paths for approval and deletes them only after a person confirms.
Human-in-Loop Highlight
Firestore deletes are per-document and do not cascade to subcollections, which makes a bulk cleanup easy to get subtly wrong. FlowRunner's answer is human-in-the-loop, an execution pattern where the agent pauses on its own, assembles the context and the choices, routes to a human on their preferred channel, and resumes the moment they respond. When a flow would run Delete Document across more paths than the configured threshold, against a collection flagged as production, the agent pauses and asks through Slack: "Ready to delete 220 documents under `users/*/sessions`. Here is the path list and a sample. Approve, narrow the set, or cancel?" The deletes run only after a person confirms, with the approver and timestamp captured in the run log. A connector can delete any document; an orchestration layer knows which deletes should stop and ask.
Agent Capabilities
9 actionsDocuments
6- Batch Get Documents Fetches many documents by path in one call and reports which paths were missing.
- Create Document Adds a document to a collection, with an explicit or auto-generated id.
- Delete Document Deletes a document by path. Subcollections are not deleted.
- Get Document Fetches a document by path and returns it as plain JSON.
- List Documents Pages through a collection, optionally sorted.
- Update Document Merges fields into a document; only the keys you send are written, and by default a missing document is created.
Queries
2- Query Documents Runs a structured query with AND-combined field conditions, ordering, limit, and collection-group support.
- Run Aggregation Query Computes Count, Sum, or Average over a filtered collection without reading the documents, billed by index entries scanned.
Collections
1- List Collection IDs Lists root collections, or a document's subcollections, for discovery.
Start building with Google Firestore
$100 in credits. No card required. Connect in minutes.