Serverless Expeditions — selected guide
Introducing Cloud Run Jobs
Fourteen episodes on service choice, architecture, scaling, state, security, operations, and delivery
Serverless design and operations through concrete examples: choosing a runtime, ordering events, managing relational state, undoing failed workflows, protecting secrets, and deploying changes safely. The selection also includes two AI-agent examples covering tools and database access.
In this collection Browse 14 summaries 3 of 14
Cloud Run Jobs runs unattended containerized work to completion instead of serving user requests. In this May 2022 introduction, Cloud Run product manager Carolina shows a nightly invoice-processing job, avoiding the need to maintain a virtual machine just to run a script.
Key points
- Jobs target a different completion model: The presenter names migrations, cleanup, imports, exports, and reports as workloads that may run for minutes without a user request 00:00–01:52(opens in a new tab).
- The job prepares invoices for human review: Its code reads PDFs from Cloud Storage, uses Document AI to extract vendor names and totals, and writes them to Firestore. It then moves processed files to another folder so the next run does not pick them up again 01:52–03:57(opens in a new tab).
- Creating a job and running it are separate steps: The demo builds the container and creates the job, then starts an execution from the console. For nightly runs, Cloud Scheduler calls the Cloud Run Admin API; the shown setup uses an OAuth token and a service account with permission to invoke the job 02:55–06:04(opens in a new tab).
- Parallel tasks need separate shares of the work: For 1,000 invoices, Carolina proposes 10 tasks. Each task reads its task number and processes its own range; task four handles invoices 301–400. Starting multiple tasks alone does not divide the input—the application must implement that partitioning 05:00–06:04(opens in a new tab).
Full video: https://www.youtube.com/watch?v=e07TvWMmVI8(opens in a new tab)