Cloud Firestore Connection icon

Cloud Firestore Connection

Interage com o Google Cloud Firestore

Actions4

Overview

This node interacts with Google Cloud Firestore to manage documents within a Firestore database. Specifically, the Delete Document operation allows users to delete a document at a specified path in their Firestore project.

Common scenarios where this node is beneficial include:

  • Cleaning up obsolete or temporary data stored in Firestore.
  • Automating deletion of user-generated content or logs after certain conditions are met.
  • Managing Firestore documents programmatically as part of larger workflows, such as removing entries when a related record is deleted elsewhere.

Example:
You have a collection users and want to delete a specific user document by its ID. You provide the Firestore project ID and the path /users/{userId} to delete that document automatically.

Properties

Name Meaning
Project Name or ID The Google Cloud project identifier where your Firestore database resides.
Path The full path to the document to delete, e.g., collection/documentId/subcollection/{id}.

Output

The output JSON for the Delete operation contains:

  • success: A boolean indicating whether the deletion was successful (true).
  • path: The full Firestore path of the deleted document.

Example output JSON:

{
  "success": true,
  "path": "collection/documentId"
}

No binary data is output by this node.

Dependencies

  • Requires a valid Google Cloud Firestore API credential with appropriate permissions to access and modify Firestore documents.
  • The node expects the service account JSON credentials to be provided and correctly formatted.
  • The Firestore client library from @google-cloud/firestore is used internally.

Troubleshooting

  • Invalid Service Account JSON:
    Error message: O JSON da Conta de Serviço é inválido.
    Ensure the service account JSON credential is correctly pasted and valid JSON format.

  • Invalid Path for Deletion:
    If the path is malformed or points to a non-existent document, the deletion will fail silently or throw an error depending on Firestore behavior. Verify the path string carefully.

  • Document Not Found:
    While deleting, if the document does not exist, Firestore's delete method still succeeds (no error). However, if you rely on reading before deleting, a "Documento não encontrado" error may appear.

  • Permission Denied:
    If the API key or service account lacks Firestore permissions, operations will fail. Check IAM roles and permissions in Google Cloud Console.

  • Continue On Fail Behavior:
    If enabled, errors during execution will be captured in the output JSON under an error field instead of stopping the workflow.

Links and References

Discussion