Create, update, and get a document in Google Cloud Firestore

For Google Cloud Firestore, this workflow automates the creation, updating, and retrieval of documents, streamlining data management tasks. Triggered manually, it efficiently handles document operations, ensuring seamless integration and quick access to your data, enhancing productivity and organization.

7/8/2025
6 nodes
Simple
manualsimplegooglefirebasecloudfirestore
Categories:
Manual TriggeredSimple Workflow
Integrations:
GoogleFirebaseCloudFirestore

Target Audience

This workflow is ideal for:
- Developers looking to automate interactions with Google Cloud Firestore without writing extensive code.
- Data Engineers who need to create, update, and retrieve documents in Firestore efficiently.
- Project Managers who want to streamline data management processes within their teams.
- Small Business Owners who require a simple solution to manage their database without a heavy investment in resources.

Problem Solved

This workflow addresses the challenge of manually managing documents in Google Cloud Firestore. It automates the processes of:
- Creating new documents with specified fields.
- Updating existing documents based on a unique identifier.
- Retrieving documents to ensure data consistency and accuracy.
By automating these tasks, users can save time and reduce the likelihood of human error.

Workflow Steps

  • Manual Trigger: The workflow starts when the user clicks the 'execute' button.
    2. Set Initial Values: The workflow sets initial values for the document to be created, including an id of 1 and a name of n8n.
    3. Create Document: A new document is created in the Firestore collection named n8n using the values set in the previous step.
    4. Prepare for Upsert: The workflow sets new values for the document, including a new name of nodemation and retrieves the document's ID for updating.
    5. Upsert Document: The workflow attempts to either update the existing document or create it if it does not exist, using the document_id obtained earlier.
    6. Retrieve Document: Finally, the workflow retrieves the updated document from Firestore to confirm the changes made.
  • Customization Guide

    Users can customize this workflow by:
    - Changing Field Values: Update the values in the 'Set' and 'Set1' nodes to match the desired data structure for documents.
    - Modifying Project and Collection IDs: Adjust the projectId and collection parameters in the Firestore nodes to target different databases or collections.
    - Adding More Operations: Incorporate additional nodes for more complex operations such as deleting documents or querying data based on specific criteria.
    - Integrating with Other Services: Connect this workflow with other services or APIs to enhance data flow and management across platforms.

    Create, update, and get a document in Google Cloud Firestore - N8N Workflow Directory