Actions6
Overview
This node interacts with Firebase Firestore to perform various document operations such as creating, replacing, updating, deleting, retrieving, and querying documents within Firestore collections. It is useful for automating workflows that require database management, such as adding user data, updating order information, or querying records based on conditions.
Use Case Examples
- Create or replace a document at a specified path with new JSON data.
- Update an existing document by merging new data with existing fields.
- Delete a document at a given path.
- Retrieve a document's data by its path to use in subsequent workflow steps.
Properties
| Name | Meaning |
|---|---|
| Collection Path | The path to the Firestore collection where documents are stored or queried. It should be specified without a leading slash. |
| Document Path | The path to a specific Firestore document to get, delete, set, or update. It should be specified without a leading slash. |
| Data | The JSON payload to write or merge into a Firestore document when setting or updating a document. |
Output
JSON
exists- Indicates if the document exists (true or false) when retrieving a document.id- The Firestore document ID.path- The full path of the document in Firestore.wrote- Indicates a successful write operation when setting a document.merged- Indicates a successful merge operation when updating a document.deleted- Indicates a successful delete operation.data- The JSON data written to or merged into the document.error- Error message if an operation fails and continueOnFail is enabled.
Dependencies
- Firebase Admin SDK for Firestore access
- Firestore service account credentials (project ID, client email, private key)
Troubleshooting
- Missing or malformed Firestore credentials will cause initialization errors. Ensure the private key is correctly formatted and pasted exactly as provided by Google, with proper newline characters.
- If a document path or collection path is incorrect or does not exist, operations like getDocument or deleteDocument may return 'exists: false' or fail.
- JSON data must be valid when setting or updating documents; invalid JSON will cause errors.
- Common error messages include credential initialization failures related to PEM decoding or malformed keys, which require checking the private key format.
Links
- Firebase Firestore Documentation - Official documentation for Firestore database operations and usage.