What This Workflow Does
This workflow automates making, changing, and getting documents in Google Cloud Firestore.
It solves the problem of doing these steps by hand, saving time and avoiding mistakes.
When started, it creates a new document with set data, gets its ID, updates it, and then gets the updated data.
This way, users get correct and fresh document info without doing manual work.
Tools and Services Used
- n8n: Runs the automated workflow and nodes.
- Google Cloud Firestore: Stores and manages the documents.
- Google Firebase Cloud Firestore OAuth2 Credentials: Handles secure access to Firestore.
Inputs, Processing Steps, and Output
Inputs
- User triggers workflow manually.
- Initial data:
id= 1,name= “n8n”.
Processing Steps
- The workflow creates a Firestore document with the input data.
- It gets the document ID from the created document.
- The workflow updates the document using the ID with a new
namevalue “nodemation”. - Finally, it retrieves the updated document to confirm changes.
Output
- Return of the updated Firestore document data.
Beginner Step-by-Step: Using This Workflow in Production
Importing the Workflow
- Download the workflow file using the Download button on this page.
- Inside the n8n editor, click on Import from File and select the downloaded file.
Configuring After Import
- Add Google Firebase Cloud Firestore OAuth2 Credentials in n8n credentials manager.
- Update
projectId, collection names, or fields if the default ones don’t fit. - Check expressions especially for document ID to match correct node names.
Testing and Activation
- Run the workflow manually once using the Manual Trigger node to test.
- Verify the new and updated documents appear correctly in Google Cloud Firestore.
- When testing is successful, activate the workflow in n8n for production use.
- For hosting on own server, consider self-host n8n solutions.
Customization Ideas
- Change document fields in the first Set node; add fields like email or status.
- Modify the update data by changing or adding fields in the second Set node.
- Make collection name dynamic using expressions based on workflow input.
Troubleshooting Common Issues
- 401 Unauthorized Firestore Errors: Usually caused by wrong or expired OAuth2 credentials. Fix by re-authenticating in n8n credential manager.
- Document ID Not Found on Update: Check the expression
{{$node["Google Cloud Firestore"].json["_id"]}}is correct and matches node names exactly.
Pre-Production Checklist
- Ensure Firestore API is enabled for the Google Cloud project.
- Verify OAuth2 credentials have required permissions.
- Test the workflow manually and check Firestore documents.
- Confirm project and collection IDs are set correctly in all Firestore nodes.
- Backup Firestore data if used in production before running workflow.
Additional Notes
You can switch the trigger from manual to webhook for automatic execution.
Each run uses Firestore read and write ops; monitor your usage to control costs.
To handle many documents, use Loop or SplitInBatches nodes in n8n.
Summary
✓ Automates creation, update, and retrieval in Firestore.
✓ Removes manual copying and error risk.
✓ Saves hours of work every week.
✓ Runs inside n8n with simple trigger.
✓ Can be customized and extended easily.

