---
title: "Deploy an AI Agent on Google Cloud Run: Service, Job, or Pool"
url: "https://goremy.ai/blog/articles/deploy-ai-agent-google-cloud-run-service-job-worker"
author: Luis Chavez-Mattos
editor: Luis Chavez-Mattos
editor_title: Director, Product
published: "2026-11-17T02:40:17.000Z"
updated: "2026-11-17T02:40:17.000Z"
topic: AI Agents & Automation
description: Learn when to run an AI agent as a Cloud Run service, job, or worker pool, with plain examples for GitHub issue replies, nightly summaries, and queue work.
---

# Deploy an AI Agent on Google Cloud Run: Service, Job, or Pool

> Learn when to run an AI agent as a Cloud Run service, job, or worker pool, with plain examples for GitHub issue replies, nightly summaries, and queue work.

Edited by Luis Chavez-Mattos, Director, Product · Published 2026-11-17

## How do I run an AI agent on Google Cloud Run?

You package your agent's code into a container and deploy it to Cloud Run with a single terminal command. Then you pick one of three modes based on how the agent works. Use a **service** if the agent reacts to web requests or webhooks. Use a **job** if it runs on a schedule and then stops. Use a **worker pool** if it pulls tasks from a queue around the clock. The code can be the same. The mode changes how the agent starts, stops, and gets billed.

## TL;DR

- An agent on your laptop stops when you close the lid, so **it has to live in the cloud** to be useful to anyone else.
- A Cloud Run **service** gives your agent a secure web URL and can scale down to zero when nobody is calling it, so idle time costs nothing.
- A Cloud Run **job** runs a task to completion on a schedule, such as a midnight summary, and then shuts down.
- A Cloud Run **worker pool** is for agents that **pull work from a queue continuously** and have no web address.
- The deciding question is simple: what wakes your agent up? A request, a clock, or a constant stream of work.
- You can start with one mode and switch later, because the agent logic stays the same.

## Why does an AI agent need to leave your laptop?

Most agents start life as a script on someone's computer. That works for testing. It fails the moment you want a teammate, a customer, or a GitHub repository to rely on it. Close the laptop and the agent is gone.

You could rent a server and leave it running. Then you are maintaining a machine, and paying for it even when the agent does nothing for hours. Cloud Run is Google Cloud's way around both problems. You hand it your code, it runs the code for you, and you do not manage a server yourself. The question is which of its three modes to use.

## What are the three Cloud Run modes for an agent?

Here is the whole decision in one table.

| Mode | What triggers the agent | Does it need a URL? | Behavior | Example |
|---|---|---|---|---|
| Service | An incoming web request or webhook | Yes | Scales up with traffic, scales to zero when idle | Reply to new GitHub issues as they arrive |
| Job | A schedule or a manual start | No | Runs once, finishes, shuts down | Summarize the day's issues at midnight |
| Worker pool | A queue of tasks | No | Runs continuously, pulling work | A 24/7 background assistant |

A single GitHub-focused agent can illustrate all three. The same underlying agent could answer issues instantly, write a daily digest, or churn through a backlog. Only the way it is deployed changes.

## When should you deploy your agent as a Cloud Run service?

Choose a service when something outside your agent needs to tell it that work has arrived. The classic case is a webhook. A webhook is a message one app sends to a web address when something happens. GitHub, for example, can notify a URL every time someone opens a new issue.

Say you want an agent that labels and replies to new issues the second they come in. It needs a secure web URL to listen on. A Cloud Run service provides exactly that.

The billing behavior is the main appeal:

- **Traffic spikes:** Cloud Run can automatically add instances to handle them.
- **Quiet periods:** when nobody is posting issues, it scales down to zero, and you pay nothing while there are no requests.

That makes a service a good fit for agents with unpredictable, bursty activity. A support-triage bot, a Slack command handler, or a form-processing agent all follow the same pattern.

One tradeoff to know about: when an instance has scaled to zero, the next request has to wait for a new instance to start. This is called a cold start. For a GitHub reply that arrives a few seconds late, nobody cares. For something a person is waiting on in a chat window, you may want to set a minimum number of instances so one is always warm. That costs money, so decide whether the speed is worth it.

## When should you use a Cloud Run job?

Choose a job when the agent does not need a URL and just needs a schedule. A job starts, does its work, and exits. Nothing is listening in between.

The example: an agent that wakes up at midnight, reads the day's GitHub issues, writes a summary, and shuts down. There is no reason for a web address, and no reason for anything to run at 2 p.m.

Jobs suit anything with a natural beginning and end:

- A nightly or weekly digest of activity
- A report assembled from several data sources each morning
- A one-time cleanup or backfill, such as re-tagging old records
- A batch of documents that needs processing and then is done

To run on a schedule, you pair the job with a scheduler (Google Cloud has Cloud Scheduler for this) that starts it at the time you choose. You can also start a job by hand when you want to test it.

A useful side effect: because a job finishes, a failure is easy to see. It either completed or it did not. That is simpler to monitor than a program that runs forever.

## When does a worker pool make sense?

Choose a worker pool when your agent is a steady background worker. Instead of waiting for a request or a clock, it constantly checks a queue for the next task, handles it, and goes back for more.

Picture a 24/7 assistant that processes incoming tasks from a queue: documents to classify, tickets to draft replies for, records to enrich. Tasks arrive at all hours, and the agent should always be ready. It does not need a public URL, because nobody calls it directly. It reaches out and pulls work.

Why not use a service for this? A service is built around responding to requests and scaling by traffic. A queue consumer has no incoming requests to count. A worker pool is designed for this "always on, pulling work" shape.

Worker pools are a newer Cloud Run option than services and jobs. Check Google's current documentation for their release status, available regions, and pricing before you commit a production workload to one.

## How do you choose between them?

Ask what wakes the agent up.

1. **A person or system sends it something right now.** Use a service.
2. **A time on the calendar.** Use a job.
3. **Work is always arriving and it should always be working.** Use a worker pool.

Then test the choice against two more questions:

- **Does anyone need a fast answer?** If yes, lean toward a service, and think about keeping one instance warm.
- **Does the work have an end?** If it finishes, a job is cleaner. If it never does, you want a service or worker pool.

If you are unsure, start with a service or a job. They are the simpler mental model, and you can move to a worker pool when queue volume justifies it.

## How do you actually deploy it?

The basic flow is the same in every mode:

1. Get your agent working locally.
2. Authenticate with Google Cloud and pick a project.
3. Run Cloud Run's deploy command from your code folder. It builds the container for you and puts it online, which is the "one terminal command" part.
4. Choose the mode: deploy it as a service, create it as a job, or set it up as a worker pool.
5. Add any trigger it needs: the GitHub webhook pointing at the service URL, or a schedule for the job.

A few habits will save you trouble:

- **Keep secrets out of your code.** API keys for your AI model and for GitHub belong in a secret manager or environment settings, not in the repository.
- **Limit what the agent can do.** Give it a service account with only the permissions it needs.
- **Cap the damage.** An agent calling an AI model in a loop can run up a bill. Set limits on how many instances can run and how long a task may take.
- **Log what it does.** When an agent replies to a stranger's GitHub issue, you want a record of what it said and why.

## What does this mean for you?

If you work in a role where people ask you to "make the AI thing run on its own," this framing helps you have a better conversation with the engineers, or with yourself.

- **If you are a developer or technical analyst:** you can now move a working agent off your laptop without learning server administration. Pick the mode, deploy, and add a trigger.
- **If you manage a team:** ask which mode a proposed agent will use. "Always on" has a different cost profile than "wakes on request," and it is a fair thing to ask before approving a project.
- **If you are not technical:** the three patterns map to ordinary work. Reacting to a message, doing a scheduled report, and working through an inbox are all things you already delegate. Describe your need in those terms and you will get a better answer from whoever builds it.

## Could you build the app around your agent instead of wiring it all yourself?

Often the agent is only half of what you need. The other half is somewhere to see its output: a page that lists the nightly issue summaries, a form that lets teammates submit requests, or a dashboard of what the agent replied to. If that is your situation, [Remy](https://goremy.ai) can build it from a plain-English description. It produces a full-stack app with a database, sign-in, scheduled jobs, webhooks, and inbound email, and deploys it to a live URL. You own the code. That can replace a spreadsheet of agent results, and it may be enough on its own if your agent's job is lighter than a custom cloud setup.

## Frequently Asked Questions

### Does a Cloud Run service really cost nothing when it is idle?

When there are no requests and the service has scaled to zero, you are not paying for running instances. If you set a minimum number of instances to avoid cold starts, those warm instances do cost money. Check Google's current pricing page for the exact rates.

### Can I run the same agent as both a service and a job?

Yes. The agent's logic can be the same, and you deploy it in more than one mode. For example, a service can reply to issues in real time while a job summarizes them each night.

### Do jobs and worker pools need a public URL?

No. A job is started by a schedule or manually, and a worker pool pulls tasks from a queue. Only a service needs a web address, because it waits for incoming requests.

### Which mode should a beginner start with?

Start with whichever matches your trigger. If your agent responds to webhooks, use a service. If it produces a report on a schedule, use a job. Move to a worker pool only when you have a steady stream of queued work.
