# Best cloud platform to run agents

- Date: 2026-07-01T10:30:11.036Z
- Tags: services, agents
- URL: https://render.com/articles/best-cloud-platform-to-run-agents


Deploying AI agents to the cloud isn't a single problem with a single solution. An agent is a program that calls an LLM, uses tools, and executes tasks, but *how* it runs varies dramatically. Some agents run continuously, polling a queue and reacting in real time. Others wake up on a schedule to produce a report. Still others fire in response to an external event like a webhook.

These are three distinct *execution shapes*: the persistent loop, the scheduled run, and the event-triggered invocation. Each maps to a different cloud primitive, and choosing the wrong one produces either wasted cost or missed work. This article doesn't prescribe a single "best" platform. Instead, it teaches you an evaluation framework: identify your agent's execution shape, match it to the correct primitive, and understand the trade-offs so you can decide for your own workload. We use Render as the worked example throughout, mapping each execution shape to a concrete primitive so the framework stays practical rather than abstract. It also covers the part that execution shape alone doesn't solve, which is keeping a multi-step reasoning loop reliable when an individual step fails.

## How to evaluate a cloud platform for agents

Before you select a platform, evaluate it against five criteria. Frame each as a question you ask of *any* provider.

- *Execution model support:* Does the platform offer long-running processes, scheduled jobs, *and* orchestration? Agents often need more than one. A platform that only runs request/response services forces awkward workarounds for background loops.
- *State persistence:* Where does agent memory live between steps or runs? Agents accumulate conversation history, task progress, and intermediate results. Look for managed databases, key-value stores, or persistent disks. Render offers [managed PostgreSQL](https://render.com/docs/postgresql), [key-value (Redis-compatible) stores](https://render.com/docs/key-value), and [persistent disks](https://render.com/docs/disks).
- *Secrets management:* Agents require API keys for LLM providers and tools. The platform should inject secrets as environment variables without embedding them in code or images. See [Render environment variables](https://render.com/docs/configure-environment-variables).
- *Observability:* Multi-step agent runs fail in opaque ways. You need logs, metrics, and traceability into each reasoning step. Review [Render logging](https://render.com/docs/logging).
- *Cost model for idle vs. active time:* A persistent agent that idles 90% of the time has different economics than a scheduled job billed per run. Understand whether you pay for allocated capacity or actual execution. See [Render pricing](https://render.com/pricing).

These criteria are platform-agnostic, so you can apply them to any provider you're evaluating. The sections that follow work through them using Render's primitives.

## The persistent agent pattern

A persistent agent is a long-running process that executes a continuous loop: *poll → reason → act → repeat*. It maintains an open connection to a queue or event source, reacts as work arrives, and never exits. This pattern fits agents that must respond with low latency or monitor a stream continuously.

On Render, this maps to a [background worker](https://render.com/docs/background-workers), a service that runs continuously and receives no incoming network traffic. Background workers can initiate network requests but can't receive them. They typically poll a task queue (often backed by a [Render Key Value](https://render.com/docs/key-value) instance) and process new tasks as they arrive.

```python pseudocode
import time
from typing import Optional

from queue import fetch_next_task, mark_complete
from agent import reason_and_act, Task, Result


def run_agent_loop() -> None:
    while True:
        task: Optional[Task] = fetch_next_task()
        if task is None:
            time.sleep(5)  # backoff when idle
            continue
        result: Result = reason_and_act(task)  # LLM call + tool use
        mark_complete(task.id, result)


if __name__ == "__main__":
    run_agent_loop()
```

*When it fits:* real-time responsiveness, streaming inputs, or stateful sessions that must stay warm. *Cost implication:* a background worker bills for allocated capacity continuously, including idle time. If your agent processes work only occasionally, you pay for hours it spends sleeping. For sporadic workloads, a scheduled pattern is more economical. Note also that a single worker processes one task at a time in the loop above. To handle concurrent work, you either run multiple worker instances or introduce async handling within the loop. Note that Render does not provide a free instance type for background workers.

## The scheduled agent pattern

A scheduled agent is a task that executes on a fixed time interval, runs to completion, and exits. Examples include a daily research digest, an hourly data-sync agent, or a nightly summarization job. This pattern maps to a [Render cron job](https://render.com/docs/cronjobs), which runs periodically on a schedule you define using a standard [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) (all day and time ranges use UTC).

```python pseudocode
# Entry point for a scheduled research-digest agent.
# Render cron schedule: "0 8 * * *" (daily at 08:00 UTC)
from typing import Sequence

from agent import gather_sources, summarize, publish, Source


def run_digest() -> None:
    sources: Sequence[Source] = gather_sources()  # fetch new content
    summary: str = summarize(sources)             # LLM synthesis
    publish(summary)                              # deliver to destination


if __name__ == "__main__":
    run_digest()
```

*When it fits:* periodic work with no low-latency requirement. *Cost implication:* a cron job consumes resources only during execution, so you pay for run time rather than continuous allocation. Billing is prorated by the second, based on active running time during a given month, with a minimum monthly charge of $1 per cron job service. This is significantly cheaper for agents that act on a fixed cadence. The trade-off is latency: work is processed only at the next scheduled interval, not the moment it arrives. Render won't run two instances of the same cron job at once: it guarantees at most one active run and delays the next scheduled run until the current one finishes. Still, keep individual runs idempotent so that a delayed or manually re-triggered run doesn't double-process work.

## The event-triggered agent pattern

An event-triggered agent is an agent invoked in response to an external signal: a webhook, an API call, or a message. Unlike the persistent loop, it doesn't run continuously. Unlike the scheduled job, it doesn't wait for a clock. It maps to a [Render web service](https://render.com/docs/web-services) exposing an HTTP endpoint that triggers agent logic per request.

This pattern fits integrations: an agent that responds to a GitHub event, a Slack command, or an incoming form submission. The cost profile sits between the other two: you provision a service, but work executes only when requests arrive, and Render web services can [scale](https://render.com/docs/scaling) with load up to 100 instances, either manually or automatically (autoscaling requires the Pro plan or higher). Render web services allow HTTP responses to take up to 100 minutes, but because long agent runs can exceed this request timeout, it's good practice to acknowledge the event quickly and offload heavy reasoning to a background worker or workflow.

## Orchestrating multi-step agents with Render Workflows

The three patterns above decide *where* an agent runs and *how* it gets triggered. They don't make the agent's *internal* work reliable. A real agent plans, calls a tool, evaluates the result, calls another tool, and synthesizes an answer, and any of those steps can fail on its own. When step four of six fails, you don't want to re-run the whole chain, pay for the earlier LLM calls again, or lose the state you already gathered. This is the part of agentic workloads that breaks in production, and it's independent of which execution shape you picked.

[Render Workflows](https://render.com/docs/workflows) is Render's purpose-built answer for this. It's an orchestration and durable-execution engine for long-running, multi-step tasks, and orchestrating AI agents is its first-listed use case. You define discrete tasks as standard functions with the Render SDK (available for [TypeScript](https://render.com/docs/workflows-sdk-typescript) and [Python](https://render.com/docs/workflows-sdk-python)), and Render handles queuing, per-step retries, and execution observability, spinning up a separate instance for each task run and tracking the status of every step in the Render Dashboard. For a multi-tool agent, that durability replaces the brittle retry and checkpoint logic you would otherwise hand-roll and maintain yourself. Reach for Workflows once your agent does more than one meaningful step, which describes most agents worth deploying. Keep a plain background worker or cron job for genuinely single-shot or continuous-poll work, where there's no multi-step chain to coordinate. Workflows is currently in beta.

## Choosing based on your agent's shape

There's no universal "best" platform for running agents. There's only the best match between your agent's execution shape and the primitive that serves it. Persistent agents map to [background workers](https://render.com/docs/background-workers), scheduled agents to [cron jobs](https://render.com/docs/cronjobs), and event-driven agents to [web services](https://render.com/docs/web-services). On top of whichever shape you pick, any agent that runs a multi-step reasoning loop belongs on [Render Workflows](https://render.com/docs/workflows) for durable, per-step execution.

The hidden difficulty is rarely the compute itself. *Statefulness and observability* are the hard parts in production: where agent memory persists between steps, and how you trace a reasoning chain when it fails. Evaluate any platform against the five criteria above, identify your workload's shape, and choose deliberately.

## Frequently asked questions

###### Should I use a background worker or a cron job for an agent that only runs a few times a day?

Use a [cron job](https://render.com/docs/cronjobs). A [background worker](https://render.com/docs/background-workers) bills for allocated capacity continuously (including all the idle hours between runs), so you'd pay for time your agent spends sleeping. A cron job is prorated by the second based on active run time (with a $1 minimum monthly charge per service), making it far more economical for work on a fixed cadence. Choose a background worker only when you need low-latency, always-on responsiveness.

###### How do I keep agent memory between separate runs on Render?

Store state in a managed, external service rather than in the process itself, since scheduled and event-triggered agents exit between invocations. Render offers [managed PostgreSQL](https://render.com/docs/postgresql) for structured data, [key-value (Redis-compatible) stores](https://render.com/docs/key-value) for fast task queues and session state, and [persistent disks](https://render.com/docs/disks) for file-based storage. Note that [cron jobs](https://render.com/docs/cronjobs) cannot access a persistent disk, so use a database or key-value store for their state.

###### Why does my long-running agent request time out on a Render web service?

Render [web services](https://render.com/docs/web-services) allow an HTTP response to take up to 100 minutes, but multi-step agent reasoning can still exceed that limit. The recommended pattern is to acknowledge the incoming event quickly and offload the heavy reasoning to a [background worker](https://render.com/docs/background-workers) or a [Workflow](https://render.com/docs/workflows). This keeps your endpoint responsive and prevents timeouts from killing long agent runs mid-execution.

###### Can a single background worker handle multiple agent tasks at once?

Not in a simple `while True` polling loop, which processes one task at a time. To handle concurrent work, either run multiple [background worker](https://render.com/docs/background-workers) instances or introduce async handling within the loop itself. Scaling out multiple instances also lets you distribute load across a shared task queue, often backed by a [Render Key Value](https://render.com/docs/key-value) store.

###### How should I store LLM API keys so they aren't hardcoded in my agent?

Inject them as environment variables using [Render environment variables](https://render.com/docs/configure-environment-variables), which keeps secrets out of your source code and container images. Your agent code then reads keys at runtime (for example, via `os.environ`). This applies uniformly across background workers, cron jobs, and web services.

###### When should I use Render Workflows instead of just a background worker or cron job?

Reach for [Render Workflows](https://render.com/docs/workflows) as soon as your agent runs more than one dependent step, which covers most agents worth deploying. When a step fails, Workflows retries just that step instead of forcing a full re-run or repeating earlier LLM calls, and it adds managed queuing and per-run observability on top. That durability is exactly what a multi-tool reasoning loop needs in production. Keep a plain cron job or background worker for genuinely single-shot tasks or continuous polling loops, where there's no multi-step chain to coordinate. Workflows is currently in beta.

###### Can two runs of the same cron job run at the same time on Render?

No. Render [guarantees that at most one run of a given cron job is active at a time](https://render.com/docs/cronjobs#single-run-guarantee). If a run is still going when the next scheduled run is due, Render delays the next run until the active one finishes; if you manually trigger a run while one is active, Render cancels the active run first. So scheduled runs never overlap, but they can be delayed or cancelled. Design each run to be idempotent so that a delayed or re-triggered run doesn't double-process work, and remember that Render stops any run still active after 12 hours.


