Overview
This node triggers workflows based on real-time changes in a Firestore database collection. It listens to specified events such as documents being added, modified, or removed within a collection path. The node supports dynamic path parameters, allowing it to respond to changes in any matching document under a flexible path pattern.
Common scenarios:
- Automatically processing new user orders as they are created.
- Monitoring chat messages in real-time for notifications or analytics.
- Syncing data changes from Firestore collections to other systems.
Practical example:
You can configure the node to listen to the collection path users/:userId/orders and trigger a workflow whenever an order is added, modified, or removed for any user. This enables dynamic handling of orders without needing separate listeners for each user.
Properties
| Name | Meaning |
|---|---|
| Collection Path | The Firestore collection path to listen to. Supports colon-prefixed parameters (e.g., users/:userId/orders) for dynamic listening on matching documents. Fixed paths like users/user123/orders are also supported. |
| Events | The types of document events to listen for in the collection. Options include: Added (document added), Modified (document changed), and Removed (document deleted). Default listens to all three. |
| Include Metadata Changes | Whether to listen for metadata changes in addition to document changes. |
| Query Filters | Optional filters to restrict which documents trigger events. Each filter specifies a field, an operator (e.g., equal, greater than), and a value to compare against. Multiple filters can be combined. |
| Verbose Logging | Enables detailed debug logging about the Firestore connection and event handling, useful for troubleshooting. |
Additional notices guide how to format collection paths with dynamic parameters or fixed segments.
Output
The node outputs an array of items where each item corresponds to a Firestore document event that matched the configured criteria. Each output item contains:
- A
jsonobject representing the Firestore document data at the time of the event.
If multiple documents trigger events simultaneously, multiple items are emitted together.
The node does not output binary data.
Dependencies
- Requires a valid API key credential for Firebase Admin SDK authentication.
- Needs proper configuration of Firestore access permissions.
- The node internally uses Firestore SDK services to establish listeners on collections.
- No additional environment variables are explicitly required beyond the API credentials.
Troubleshooting
- Empty Collection Path: The node throws an error if the collection path is empty. Ensure you provide a valid path.
- Invalid Document ID: For document-level listening (not applicable here but related), an empty document ID causes an error.
- Credential Validation Failure: If the provided Firebase credentials are invalid or misconfigured, the node will report a validation failure.
- Listener Setup Errors: Issues creating listeners may occur if the path format is incorrect or Firestore permissions are insufficient.
- Verbose Logging: Enable verbose logging to get detailed debug information helpful for diagnosing connection or event issues.
- Cleanup Errors: Errors during listener cleanup or Firebase app cleanup are logged but do not stop execution; these usually indicate resource release problems.