Reference · Tools

Google Cloud Firestore

Create, read, update, delete, and query documents and collections in Google Cloud Firestore.

Action Data & Storage v1

The Google Cloud Firestore node lets you create, read, update, delete, and query documents and collections in Firestore directly from a BusyBot workflow. You can use it to build things like a user-onboarding flow that writes a new Firestore document on signup, or a nightly job that queries and archives stale records. Documents are returned as plain JSON with decoded fields and metadata.

Node type
Action
Parameters
24
Outputs
Credentials
Google Firebase Cloud Firestore OAuth2 , Google API (Service Account)

Google Cloud Firestore

Create, read, update, delete, and query documents and collections in Google Cloud Firestore.

Overview

Integrates with the Firestore REST API v1 to manage documents and collections. It supports creating a document (with an optional document ID), batch get, listing a collection with pagination, delete, batch upsert with field masks, structured queries, and listing root collection IDs. Data is encoded and decoded using Firestore’s typed value format, so the values you send and read back are ordinary JSON. Authentication is available via OAuth2 or a service account. Simplify mode returns each document with underscore-prefixed metadata merged alongside its decoded fields.

Category: Data & Storage
Tool Name: google_cloud_firestore
Version: 1

Appearance: Icon: lucide-Database | Color: #FFA000

Node Type

Action — processes input items and produces output

Input / Output

DirectionPort(s)
Inputmain
Outputmain, error

Credentials

This tool requires Google Firebase Cloud Firestore OAuth2, Google API (Service Account) credentials. See the Credentials Guide for setup instructions.

Configure the one that matches the Authentication parameter — OAuth2 or service account, not both.

Resources

ResourceValue
Documentdocument
Collectioncollection

Operations

OperationValueDescription
CreatecreateCreate a new document in a collection.
DeletedeleteDelete a document.
GetgetGet one or more documents by ID (batch).
Get ManygetAllGet all documents in a collection or list all root collection IDs.
QueryqueryRun a structured query against a collection.
UpsertupsertCreate or update documents (batch write).

Every operation applies to the Document resource. The Collection resource offers getAll only.

Parameters

Document: Create

ParameterTypeRequiredDefaultDescription
CollectionstringYesThe collection ID or path (e.g. “users” or “users/userId/orders”). Supports expressions.
Document IDstringNoOptional document ID. If omitted, Firestore auto-generates one.
ColumnsstringNoComma-separated list of item fields to write as document fields. Leave empty to write all fields from the item JSON.
SimplifybooleanNotrueReturn simplified output with underscore-prefixed metadata merged with document fields.

Document: Delete

ParameterTypeRequiredDefaultDescription
CollectionstringYesThe collection ID or path (e.g. “users” or “users/userId/orders”). Supports expressions.
Document IDstringYesThe document ID (last path segment). For nested collections use the full relative path (e.g. “docId/subcollection/subDocId”).

Document: Get

ParameterTypeRequiredDefaultDescription
CollectionstringYesThe collection ID or path (e.g. “users” or “users/userId/orders”). Supports expressions.
Document IDstringYesThe document ID (last path segment). For nested collections use the full relative path (e.g. “docId/subcollection/subDocId”).
SimplifybooleanNotrueReturn simplified output with underscore-prefixed metadata merged with document fields.

Document: Get Many

ParameterTypeRequiredDefaultDescription
CollectionstringYesThe collection ID or path (e.g. “users” or “users/userId/orders”). Supports expressions.
Return AllbooleanNofalseWhether to return all results or only up to a given limit.
LimitnumberNo100Max number of documents to return. (shown when Return All is false)
SimplifybooleanNotrueReturn simplified output with underscore-prefixed metadata merged with document fields.

Document: Query

ParameterTypeRequiredDefaultDescription
CollectionstringYesThe collection ID or path (e.g. “users” or “users/userId/orders”). Supports expressions.
QuerystringYesA JSON string containing a Firestore structuredQuery object. Example: {“from”:[{“collectionId”:“users”}],“where”:{“fieldFilter”:{“field”:{“fieldPath”:“age”},“op”:“GREATER_THAN”,“value”:{“integerValue”:“18”}}}}
SimplifybooleanNotrueReturn simplified output with underscore-prefixed metadata merged with document fields.

Document: Upsert

ParameterTypeRequiredDefaultDescription
CollectionstringYesThe collection ID or path (e.g. “users” or “users/userId/orders”). Supports expressions.
Update KeystringYesThe field in the item data to use as the Firestore document ID.
ColumnsstringNoComma-separated list of item fields to write. Leave empty to write all fields.

Collection: Get Many

ParameterTypeRequiredDefaultDescription
Return AllbooleanNofalseWhether to return all collection IDs or only up to a given limit.
LimitnumberNo100Max number of collection IDs to return. (shown when Return All is false)

All Operations

ParameterTypeRequiredDefaultDescription
AuthenticationoptionsNooAuth2Authentication method to use.
Options: oAuth2, serviceAccount
Google AccountcredentialNoConnect or select your Google account. (shown when Authentication is oAuth2)
Service Account EmailstringYesThe email address of the Google service account. (shown when Authentication is serviceAccount)
Private KeystringYesThe private key from the service account JSON key file. (shown when Authentication is serviceAccount)
Project IDstringYesThe Google Cloud project ID (e.g. “my-project-123”).
DatabasestringNo(default)The Firestore database name. Use “(default)” for the default database.
Max ConcurrencynumberNo5Maximum number of items to process concurrently.

Output Data

The output item’s JSON is the Firestore result — the incoming item’s JSON does not pass through — while binary data on the input item is forwarded.

With Simplify on (the default), a document arrives with its decoded fields at the top level and its metadata under underscore-prefixed keys:

{
  "_name": "projects/my-project-123/databases/(default)/documents/users/user123",
  "_id": "user123",
  "_createTime": "2024-01-15T09:30:00.123456Z",
  "_updateTime": "2024-01-15T09:30:00.123456Z",
  "name": "Ada Lovelace",
  "email": "ada@example.com",
  "age": 36
}

Turn Simplify off to receive the raw Firestore document instead, with name, createTime, updateTime and a fields object still in Firestore’s typed value format.

OperationOutput
document / createOne item — the created document.
document / deleteOne item carrying success: true.
document / getOne item per requested document. A document that does not exist produces an error item rather than an empty one.
document / getAllOne item per document in the collection, paginated up to Limit (or all of them with Return All on).
document / queryOne item per matching document.
document / upsertOne item per written document, carrying the write result (updateTime).
collection / getAllOne item per collection, each carrying a single collectionId property.

Address the result downstream with expressions such as {{ $json._id }} or {{ $json.email }}.

Usage Examples

  • Use Google Cloud Firestore in a workflow to create, read, update, delete, and query documents and collections in Google Cloud Firestore

Example Configuration

Create a document with an explicit ID, writing only three fields from the item:

{
  "type": "google_cloud_firestore",
  "parameters": {
    "authentication": "oAuth2",
    "resource": "document",
    "operation": "create",
    "projectId": "my-project-123",
    "database": "(default)",
    "collection": "users",
    "documentId": "user123",
    "columns": "name,email,age",
    "simplify": true
  }
}

Read a single document back:

{
  "type": "google_cloud_firestore",
  "parameters": {
    "authentication": "oAuth2",
    "resource": "document",
    "operation": "get",
    "projectId": "my-project-123",
    "database": "(default)",
    "collection": "users",
    "documentId": "{{ $json.userId }}",
    "simplify": true
  }
}

List the first hundred documents in a collection:

{
  "type": "google_cloud_firestore",
  "parameters": {
    "authentication": "oAuth2",
    "resource": "document",
    "operation": "getAll",
    "projectId": "my-project-123",
    "database": "(default)",
    "collection": "users",
    "returnAll": false,
    "limit": 100,
    "simplify": true
  }
}

Run a structured query:

{
  "type": "google_cloud_firestore",
  "parameters": {
    "authentication": "oAuth2",
    "resource": "document",
    "operation": "query",
    "projectId": "my-project-123",
    "database": "(default)",
    "collection": "users",
    "query": "{\"from\":[{\"collectionId\":\"users\"}],\"where\":{\"fieldFilter\":{\"field\":{\"fieldPath\":\"age\"},\"op\":\"GREATER_THAN\",\"value\":{\"integerValue\":\"18\"}}}}",
    "simplify": true
  }
}

Create or update many documents in one batch, keyed on a field of the incoming items:

{
  "type": "google_cloud_firestore",
  "parameters": {
    "authentication": "oAuth2",
    "resource": "document",
    "operation": "upsert",
    "projectId": "my-project-123",
    "database": "(default)",
    "collection": "users",
    "updateKey": "userId",
    "columns": "name,email,age"
  }
}

Delete a document:

{
  "type": "google_cloud_firestore",
  "parameters": {
    "authentication": "oAuth2",
    "resource": "document",
    "operation": "delete",
    "projectId": "my-project-123",
    "database": "(default)",
    "collection": "users",
    "documentId": "user123"
  }
}

Read a document out of a nested subcollection:

{
  "type": "google_cloud_firestore",
  "parameters": {
    "resource": "document",
    "operation": "get",
    "projectId": "ecommerce-project",
    "collection": "users/user123/orders",
    "documentId": "order456",
    "simplify": true
  }
}

List every root collection in the database:

{
  "type": "google_cloud_firestore",
  "parameters": {
    "authentication": "oAuth2",
    "resource": "collection",
    "operation": "getAll",
    "projectId": "my-project-123",
    "database": "(default)",
    "returnAll": false,
    "limit": 50
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Create, read, update, delete, and query documents and collections in Google Cloud Firestore. Use when you need NoSQL document storage operations or structured queries against Firestore. Returns documents with decoded fields and metadata.

  • Database is almost always (default). Only change it if you created a named Firestore database in the project.
  • Nested collections use a path. users/user123/orders addresses a subcollection; the Document ID for a get or delete may itself be a relative path such as docId/subcollection/subDocId.
  • Columns filters what gets written. Leave it empty to write the whole item; name fields to keep unrelated workflow metadata out of the document.
  • Upsert needs a key that exists on every item. Update Key names the item field whose value becomes the document ID; an item where that field is missing or empty fails rather than creating an unnamed document.
  • Get and Upsert batch across items. All the items reaching the node in one run are grouped into a single Firestore call per project and database, so a large batch is far cheaper than one call per item.
  • Query takes a raw structuredQuery. Supply the JSON object Firestore’s runQuery expects, including its from clause; values inside where use Firestore’s typed form such as {"integerValue":"18"}.
  • Get Many and Query fan out — each document becomes its own item, so downstream nodes process documents individually.

Frequently asked questions

Which credentials do I need — OAuth2 or a service account?

Both work. OAuth2 (Google Firebase Cloud Firestore OAuth2) is the easier choice if you're already signed into Google and working interactively. A service account (Google API - Service Account) is better suited to automated, unattended workflows because it doesn't require a user session. Pick one and configure it in the node's credentials field before running.

What should I put in the Database field?

Almost always `(default)`. Firestore creates a database named `(default)` unless you explicitly created a named database in your GCP project. Only change this value if you know you have a named database and need to target it specifically.

How do I read or delete a document inside a subcollection?

Use a path in the Document ID field, not just the final document ID. For example, to target a document inside a subcollection, set Collection to `users` and Document ID to `user123/orders/order456`. The node resolves the full path from those two values combined.

My Upsert operation is failing for some items but not others — what's wrong?

Upsert requires every item to have the field named in Update Key, and that field must be non-empty. If any item is missing that field or its value is blank, that item fails rather than creating a document with an auto-generated ID. Check that the field exists on all items reaching the node, and that no item has a null or empty value for it.

How do I write a structured query, and what format do filter values need to be in?

Set the operation to Query and supply a raw JSON object matching what Firestore's `runQuery` endpoint expects, including a `from` clause naming your collection. Values inside `where` must use Firestore's typed format — for example, an integer 18 must be written as `{"integerValue": "18"}` rather than just `18`. Each matching document is returned as its own output item, so downstream nodes process them one at a time.

Build with the Google Cloud Firestore node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Google Firebase Cloud Firestore OAuth2 credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.