title: Scheduled Firebase Functions
body: <p>I want to create some scheduled cloud functions using the syntax below to define the schedule within the source code of the function:</p>
  <pre><code>exports.scheduledFunction = functions.pubsub.schedule('every 5 minutes').onRun((context) =&gt; {
    console.log('This will be run every 5 minutes!');
    return null;
  });
  </code></pre>
  <p>I know that according to the <a href="https://firebase.google.com/docs/functions/schedule-functions" rel="nofollow noreferrer">documentation</a>, this cloud function automatically creates a pub/sub topic to trigger the function according to the defined schedule. The docs warn against manually editing the pub/sub topic in the GCP console, as it could break the scheduling.</p>
  <p>What they don't mention is how one goes about removing a pub/sub topic of a function that you want to delete or update.</p>
  <p>Do I need to delete the function entirely and re-deploy it with the updated schedule details? Will that automatically delete the associated pub/sub topic as well? What if I just re-deploy the same function with different schedule details?</p>