Twitter LogoFacebook Logo
Firestore - Batch Operations
Learn how to commit multiple Add, Update, and Delete Operations
By: King

Hello, in this tutorial, I will show you how to commit multiple Add, Update, and Delete operations.

This means that it'll try to execute multiple operations and if even 1 fails, it will roll back to the original data.

Image from Codeible.com

Creating the Batch

To begin executing Batch Operations, you will need to create the Batch. Use the "Begin Batch" node to start.

Image from Codeible.com

Then use the "Add Document Batch Operation," "Update Document Batch Operation," "Delete Document Batch Operation" nodes to add as many operations as possible you want to commit.

Image from Codeible.com

Committing the Batch

Once the Batch is created, use the Commit Batch node to execute all the operations.

Image from Codeible.com

It has 3 pins

1 for the batch operations

2 callbacks to handle executions when the process completes successfully or not

To create these callbacks, click and hold on the callback pin from the node. Then drag and let go on an empty spot on the blueprint.

Select “Add Event” then “Add Custom Event.” That will create the event node fit for the callback.

Image from Codeible.com

The On Batch Completed callback gets called when it successfully committed all the operations it was assigned with.


The On Fail to Complete Batch callback gets call when at least 1 operation failed. Data will be rolled back to the original when this happens.

Image from Codeible.com

Sign In