Cloud Firestore API Connector Overview

The Workflows connector defines the built-infunctions that can be used to access other Google Cloud products within aworkflow.

This page provides an overview of the individual connector.There is no need to import or load connector libraries in a workflow—connectorswork out of the box when used in a call step.

Cloud Firestore API

Accesses the NoSQL document database built for automatic scaling, high performance, and ease of application development. To learn more, see theCloud Firestore API documentation.

The Firestore connector allows you to connect to the Firestore APIs from withina workflow.

The Firestore connector only supports databases created in Native mode.Operations will fail if used on a database in Datastore mode.To learn more about the difference between the two,seeChoosing between Native mode and Datastore mode.

Warning: Once you select Firestore in Datastore mode and write to the database,you cannot switch to Native mode. Once you select Firestore in Native mode,you cannot switch to Datastore mode. If you require a mode change in this situation,reach out toFirestore support.

Cloud Firestore connector sample

YAML

# This workflow demonstrates how to use the Firestore connector:# Create and retrieve a Firestore document# Export the document to a Cloud Storage bucket (which must already exist)# Delete the document# Expected output: "SUCCESS"-init:assign:-project_id:${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")}-collection:"example-collection"-document:"example-document"-create_document:call:googleapis.firestore.v1.projects.databases.documents.createDocumentargs:collectionId:${collection}parent:${"projects/" + project_id + "/databases/(default)/documents"}query:documentId:${document}body:fields:fieldA:stringValue:abcfieldB:integerValue:123-get_document:call:googleapis.firestore.v1.projects.databases.documents.getargs:name:${"projects/" + project_id + "/databases/(default)/documents/" + collection + "/" + document}result:got-check:switch:-condition:${got.fields.fieldA.stringValue == "abc" AND int(got.fields.fieldB.integerValue) == 123}next:export-failed:raise:${"got unexpected document" + "fieldA:" + got.fields.fieldA.stringValue + " fieldB:" + string(got.fields.fieldB.integerValue)}-export:call:googleapis.firestore.v1.projects.databases.exportDocumentsargs:name:${"projects/" + project_id + "/databases/(default)"}body:outputUriPrefix:"gs://EXAMPLE_BUCKET"# replace EXAMPLE_BUCKET placeholder with existing bucketcollectionIds:-${collection}-drop:call:googleapis.firestore.v1.projects.databases.documents.deleteargs:name:${"projects/" + project_id + "/databases/(default)/documents/" + collection + "/" + document}-the_end:return:"SUCCESS"

JSON

[{"init":{"assign":[{"project_id":"${sys.get_env(\"GOOGLE_CLOUD_PROJECT_ID\")}"},{"collection":"example-collection"},{"document":"example-document"}]}},{"create_document":{"call":"googleapis.firestore.v1.projects.databases.documents.createDocument","args":{"collectionId":"${collection}","parent":"${\"projects/\" + project_id + \"/databases/(default)/documents\"}","query":{"documentId":"${document}"},"body":{"fields":{"fieldA":{"stringValue":"abc"},"fieldB":{"integerValue":123}}}}}},{"get_document":{"call":"googleapis.firestore.v1.projects.databases.documents.get","args":{"name":"${\"projects/\" + project_id + \"/databases/(default)/documents/\" + collection + \"/\" + document}"},"result":"got"}},{"check":{"switch":[{"condition":"${got.fields.fieldA.stringValue == \"abc\" AND int(got.fields.fieldB.integerValue) == 123}","next":"export"}]}},{"failed":{"raise":"${\"got unexpected document\" + \"fieldA:\" + got.fields.fieldA.stringValue + \" fieldB:\" + string(got.fields.fieldB.integerValue)}"}},{"export":{"call":"googleapis.firestore.v1.projects.databases.exportDocuments","args":{"name":"${\"projects/\" + project_id + \"/databases/(default)\"}","body":{"outputUriPrefix":"gs://EXAMPLE_BUCKET","collectionIds":["${collection}"]}}}},{"drop":{"call":"googleapis.firestore.v1.projects.databases.documents.delete","args":{"name":"${\"projects/\" + project_id + \"/databases/(default)/documents/\" + collection + \"/\" + document}"}}},{"the_end":{"return":"SUCCESS"}}]

Module: googleapis.firestore.v1.projects.databases

Functions
exportDocumentsExports a copy of all or a subset of documents from Google CloudFirestore to another storage system, such as Google Cloud Storage.Recent updates to documents may not be reflected in the export. Theexport occurs in the background and its progress can be monitored andmanaged via the Operation resource that is created. The output of anexport may only be used once the associated operation is done. If anexport operation is cancelled before completion it may leave partialdata behind in Google Cloud Storage. For more details on export behaviorand output format, refer to:https://cloud.google.com/firestore/docs/manage-data/export-import
importDocumentsImports documents into Google Cloud Firestore. Existing documents withthe same name are overwritten. The import occurs in the background andits progress can be monitored and managed via the Operation resourcethat is created. If an ImportDocuments operation is cancelled, it ispossible that a subset of the data has already been imported to CloudFirestore.

Module: googleapis.firestore.v1.projects.databases.collectionGroups.fields

Functions
getGets the metadata and configuration for a Field.
listLists the field configuration and metadata for this database. Currently,FirestoreAdmin.ListFields only supports listing fields that have beenexplicitly overridden. To issue this query, callFirestoreAdmin.ListFields with the filter set toindexConfig.usesAncestorConfig:false .
patchUpdates a field configuration. Currently, field updates apply only tosingle field index configuration. However, calls toFirestoreAdmin.UpdateField should provide a field mask to avoid changingany configuration that the caller isn't aware of. The field mask shouldbe specified as:{ paths: "index_config" }. This call returns agoogle.longrunning.Operation which may be used to track the status ofthe field update. The metadata for the operation will be the typeFieldOperationMetadata. To configure the default field settings for thedatabase, use the specialField with resource name:projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*.

Module: googleapis.firestore.v1.projects.databases.collectionGroups.indexes

Functions
createCreates a composite index. This returns a google.longrunning.Operationwhich may be used to track the status of the creation. The metadata forthe operation will be the type IndexOperationMetadata.
deleteDeletes a composite index.
getGets a composite index.
listLists composite indexes.

Module: googleapis.firestore.v1.projects.databases.documents

Functions
batchGetGets multiple documents. Documents returned by this method are notguaranteed to be returned in the same order that they were requested.
batchWriteApplies a batch of write operations. The BatchWrite method does notapply the write operations atomically and can apply them out of order.Method does not allow more than one write per document. Each writesucceeds or fails independently. See the BatchWriteResponse for thesuccess status of each write. If you require an atomically applied setof writes, use Commit instead.
beginTransactionStarts a new transaction.
commitCommits a transaction, while optionally updating documents.
createDocumentCreates a new document.
deleteDeletes a document.
getGets a single document.
listLists documents.
listCollectionIdsLists all the collection IDs underneath a document.
partitionQueryPartitions a query by returning partition cursors that can be used torun the query in parallel. The returned partition cursors are splitpoints that can be used by RunQuery as starting/end points for the queryresults.
patchUpdates or inserts a document.
rollbackRolls back a transaction.
runQueryRuns a query.

Module: googleapis.firestore.v1.projects.databases.operations

Functions
cancelStarts asynchronous cancellation on a long-running operation. The servermakes a best effort to cancel the operation, but success is notguaranteed. If the server doesn't support this method, it returnsgoogle.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperationor other methods to check whether the cancellation succeeded or whetherthe operation completed despite cancellation. On successfulcancellation, the operation is not deleted; instead, it becomes anoperation with an Operation.error value with a google.rpc.Status.code of1, corresponding toCode.CANCELLED.
deleteDeletes a long-running operation. This method indicates that the clientis no longer interested in the operation result. It does not cancel theoperation. If the server doesn't support this method, it returnsgoogle.rpc.Code.UNIMPLEMENTED.
getGets the latest state of a long-running operation. Clients can use thismethod to poll the operation result at intervals as recommended by theAPI service.
listLists operations that match the specified filter in the request. If theserver doesn't support this method, it returnsUNIMPLEMENTED. NOTE:thename binding allows API services to override the binding to usedifferent resource name schemes, such asusers/*/operations. Tooverride the binding, API services can add a binding such as"/v1/{name=users/*}/operations" to their service configuration. Forbackwards compatibility, the default name includes the operationscollection id, however overriding users must ensure the name binding isthe parent resource, without the operations collection id.

Module: googleapis.firestore.v1.projects.locations

Functions
getGets information about a location.
listLists information about the supported locations for this service.

Module: googleapis.firestore.v1beta1.projects.databases

Functions
exportDocumentsExports a copy of all or a subset of documents from Google CloudFirestore to another storage system, such as Google Cloud Storage.Recent updates to documents may not be reflected in the export. Theexport occurs in the background and its progress can be monitored andmanaged via the Operation resource that is created. The output of anexport may only be used once the associated operation is done. If anexport operation is cancelled before completion it may leave partialdata behind in Google Cloud Storage.
importDocumentsImports documents into Google Cloud Firestore. Existing documents withthe same name are overwritten. The import occurs in the background andits progress can be monitored and managed via the Operation resourcethat is created. If an ImportDocuments operation is cancelled, it ispossible that a subset of the data has already been imported to CloudFirestore.

Module: googleapis.firestore.v1beta1.projects.databases.documents

Functions
batchGetGets multiple documents. Documents returned by this method are notguaranteed to be returned in the same order that they were requested.
batchWriteApplies a batch of write operations. The BatchWrite method does notapply the write operations atomically and can apply them out of order.Method does not allow more than one write per document. Each writesucceeds or fails independently. See the BatchWriteResponse for thesuccess status of each write. If you require an atomically applied setof writes, use Commit instead.
beginTransactionStarts a new transaction.
commitCommits a transaction, while optionally updating documents.
createDocumentCreates a new document.
deleteDeletes a document.
getGets a single document.
listLists documents.
listCollectionIdsLists all the collection IDs underneath a document.
partitionQueryPartitions a query by returning partition cursors that can be used torun the query in parallel. The returned partition cursors are splitpoints that can be used by RunQuery as starting/end points for the queryresults.
patchUpdates or inserts a document.
rollbackRolls back a transaction.
runQueryRuns a query.

Module: googleapis.firestore.v1beta1.projects.databases.indexes

Functions
createCreates the specified index. A newly created index's initial state isCREATING. On completion of the returned google.longrunning.Operation,the state will beREADY. If the index already exists, the call willreturn anALREADY_EXISTS status. During creation, the process couldresult in an error, in which case the index will move to theERRORstate. The process can be recovered by fixing the data that caused theerror, removing the index with delete, then re-creating the index withcreate. Indexes with a single field cannot be created.
deleteDeletes an index.
getGets an index.
listLists the indexes that match the specified filters.

Module: googleapis.firestore.v1beta2.projects.databases

Functions
exportDocumentsExports a copy of all or a subset of documents from Google CloudFirestore to another storage system, such as Google Cloud Storage.Recent updates to documents may not be reflected in the export. Theexport occurs in the background and its progress can be monitored andmanaged via the Operation resource that is created. The output of anexport may only be used once the associated operation is done. If anexport operation is cancelled before completion it may leave partialdata behind in Google Cloud Storage.
importDocumentsImports documents into Google Cloud Firestore. Existing documents withthe same name are overwritten. The import occurs in the background andits progress can be monitored and managed via the Operation resourcethat is created. If an ImportDocuments operation is cancelled, it ispossible that a subset of the data has already been imported to CloudFirestore.

Module: googleapis.firestore.v1beta2.projects.databases.collectionGroups.fields

Functions
getGets the metadata and configuration for a Field.
listLists the field configuration and metadata for this database. Currently,FirestoreAdmin.ListFields only supports listing fields that have beenexplicitly overridden. To issue this query, callFirestoreAdmin.ListFields with the filter set toindexConfig.usesAncestorConfig:false.
patchUpdates a field configuration. Currently, field updates apply only tosingle field index configuration. However, calls toFirestoreAdmin.UpdateField should provide a field mask to avoid changingany configuration that the caller isn't aware of. The field mask shouldbe specified as:{ paths: "index_config" }. This call returns agoogle.longrunning.Operation which may be used to track the status ofthe field update. The metadata for the operation will be the typeFieldOperationMetadata. To configure the default field settings for thedatabase, use the specialField with resource name:projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*.

Module: googleapis.firestore.v1beta2.projects.databases.collectionGroups.indexes

Functions
createCreates a composite index. This returns a google.longrunning.Operationwhich may be used to track the status of the creation. The metadata forthe operation will be the type IndexOperationMetadata.
deleteDeletes a composite index.
getGets a composite index.
listLists composite indexes.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.