Create a recurring job with Cloud Scheduler - google-marketing-solutions/topic-mine GitHub Wiki

  1. Go to Cloud Scheduler and create new job.
  2. In "Define the schedule": set name, frequency and timezone.
  3. In "Configure the execution":
  • Target type: HTTP
  • URL: The one printed when running the deploy.sh script (can also be found in the new Cloud Run service) followed by de endpoint you want to use (e.g.: https://topic-mine-xxx.a.run.app/content?...)
  • HTTP method: POST
  • HTTP headers: The one that says "Content-Type" must have value "application/json" (if it doesn't show up, save the job and open edit mode again)
  • Body: The body of the request (see details below)
  • Auth header: Add OIDC token
  • Service account:** The one created when deploying Topic Mine (set in file config.json)
  • Audience: Same URL as before but without the endpoint resource (e.g.: https://topic-mine-xxx.a.run.app/)
  1. In "Configure optional settings": set the attempt deadline to something longer (e.g.: 30m) so that the job does not fail when Topic Mine is still running