Search code examples
firebasegoogle-cloud-functions

Manually trigger scheduled or trigger function


Is there any way to manually trigger a scheduled function and/or a Firestore trigger function? I have two scenarios I need to solve:

  1. A cloud function that is listening to a Firestore document (onCreate) didn't fire - it failed on 3 of about 1,000 invocations, so I need to manually trigger it for these 3 documents. Is this possible (to manually trigger this function)?
  2. I have a scheduled function that runs hourly, but threw an error b/c of a map in the Firestore document when the code expected an array. Any way I can manually run the scheduled function once rather than waiting an hour before it runs again?

Solution

    • Go to the Firebase console
    • Select the desired project
    • Select the Functions menu item from the left sidebar
    • Open the ... menu at the right side of the cron job
    • Select the View in Cloud Scheduler menu item
    • Open the ... menu at the right side of the cron job
    • Select the Force run menu item