Search code examples
firebasegoogle-cloud-platformgoogle-cloud-firestoregoogle-cloud-functions

Do onCall and onRequest Google Cloud Functions also follow the at-least-once execution pattern?


From the official Cloud Functions docs:

Cloud Functions provides at-least-once execution of an event-driven function for each event emitted by an event source.

Does that also apply to onCall and onRequest functions? Or it only about event triggered functions, such as the Firestore triggers like: onDocumentCreated, onDocumentUpdated etc?


Solution

  • At the top of the documentation page you mention in your question it is stated:

    This document describes how you can request asynchronous (non-HTTPS) background functions to retry on failure.

    Both Callable Cloud Functions (onCall) and "simple" HTTPS Cloud Functions (onRequest) are HTTPS Cloud Functions and not background functions.

    So this documentation page does not apply to "onCall and onRequest functions".

    If you want to retry HTTPS Cloud Functions you'll need to write the code in order to recall the function from the caller component (e.g. your front-end for a Callable one).