I use batches to write into firestore and my firebase-functions code always executes successfully on the first attempt.
firestore
firebase-functions
i functions