Today, we are introducing the prerelease of Amazon Bedrock AgentCore Runtime as a compute provider for Temporal Serverless Workers. Together, Temporal and Amazon Bedrock AgentCore provide the foundation for durable, scalable, and production ready agentic applications.
Serverless Workers let Temporal start and scale Worker capacity in response to workload volume, without requiring developers to operate an always-on Worker fleet. AgentCore is AWS's platform for building, deploying, and operating production AI agents securely at scale.
To get started, explore the Python reference sample and deploy its Strands agent to AgentCore Runtime. Then configure that Runtime as the compute provider for a Temporal Worker Deployment Version. To learn more, see the Serverless Workers Documentation.
Temporal Serverless Workers: dynamically scaled Worker fleets#
A Temporal Worker is the process that runs your Workflow and Activity code. Traditionally, your team deploys that process to long-lived compute, connects it to Temporal, and manages its capacity. That model remains a strong fit for steady workloads and teams that want direct control over their infrastructure. Agent workloads, however, are often bursty. They may receive a surge of requests, then sit idle for minutes or hours, sometimes days, while waiting on a person or external system.
Temporal Serverless Workers preserve the same programming model while changing who manages the Worker lifecycle. You still write Workflows and Activities with a Temporal SDK. Instead of continuously running and managing a fleet of Workers yourself, you configure a compute provider on a Worker Deployment Version and let Temporal take over scaling your Worker capacity as demand changes.
This architecture has several useful properties for agentic applications:
- Capacity usage matches your workload. Temporal requests more Workers during bursts of activity and scales down during quiet periods, avoiding an idle fleet.
- Workflow lifetime is independent of Worker lifetime. A Workflow can run or wait far longer than any individual Worker process. When another Worker continues it, Temporal reconstructs the Workflow’s state from Event History.
- Worker Deployment Versions make agent behavior changes and deployments more controlled. Each versioned Temporal Worker targets a specific AgentCore Runtime version, enabling controlled rollouts without relying on a risky “latest” build.
Workflow progress, retries, timeouts, Signals, Updates, and durable timers remain in Temporal. Temporal’s Durable Execution lets agent workloads use dynamic serverless compute without losing progress when a Worker fails.
AgentCore: an AWS platform for production agents#
Amazon Bedrock AgentCore is AWS's agentic platform for building, deploying, and operating agents. AgentCore provides AWS-native services for compute, identity, tool access, policy, memory, and observability around production agents. These include:
- AgentCore Identity helps agents access AWS services and third-party tools with the appropriate identity.
- Gateway provides a governed way to expose APIs and services as agent tools.
- Memory supports information that should persist across interactions.
- Policy provides controls for tool use.
- Observability helps teams inspect agent behavior in production.
For this integration, the key service is AgentCore Runtime, a serverless environment for deploying and running agents and tools securely at scale. It supports agents that spend significant time waiting on model or tool calls across multiple steps.
A Runtime session can stay available between calls, allowing a Worker to reuse in-memory caches and local files instead of rebuilding its environment each time. With AgentCore’s microVM pricing, you do not pay for idle CPU while the agent waits on I/O, provided no background process is running.
A reference architecture for durable agents on AgentCore#
The reference architecture shows how to use these services together: AgentCore supplies managed AWS compute and agent infrastructure, while Temporal preserves the application's execution state and coordinates reliable progress.
The recommended pattern combines AgentCore’s managed infrastructure with Temporal’s Durable Execution to provide a durable, scalable platform for agents.
- A Temporal Workflow is the durable agent loop. It coordinates model calls, tool use, retries, timeouts, human input, and long-running waits.
- Model calls and tool operations run as Temporal Activities. Each operation gets an explicit failure boundary and retry policy. External side effects should still be idempotent or use an idempotency key.
- Strands Agents provides the agent programming model. Temporal's Strands integration turns model calls, tool operations, MCP operations, and hooks into Activities while preserving a familiar agent-development experience.
- An AgentCore Runtime session hosts a Temporal Worker. The Worker connects to Temporal and polls the Task Queue for compatible Workflow and Activity Tasks.
- Temporal Serverless Workers manages capacity. The Worker Controller Instance (WCI) invokes AgentCore when the Task Queue needs more Workers. If demand remains high, additional Runtime sessions can start, each contributing Worker capacity to the shared pool.
Conceptually, the architecture looks like this:
See the pattern in the Python sample#
The Temporal Python sample for AgentCore and Strands demonstrates the architecture with a compact agent that can use AgentCore Code Interpreter.
The Workflow creates a TemporalAgent and exposes a Python Activity as a Strands tool:
@workflow.defn
class StrandsAgentWorkflow:
def __init__(self) -> None:
self.agent = TemporalAgent(
start_to_close_timeout=timedelta(seconds=60),
system_prompt=SYSTEM_PROMPT,
tools=[
activity_as_tool(
execute_code,
start_to_close_timeout=timedelta(minutes=2),
)
],
)
@workflow.run
async def run(self, prompt: str) -> str:
result = await self.agent.invoke_async(prompt)
return str(result)
The Temporal integration executes the Strands model request as an Activity. When the agent chooses the code tool, execute_code also runs as an Activity and calls AgentCore Code Interpreter.
The sample's AgentCore entry point starts a Temporal Worker and keeps it running while Activities are in flight. An activity-aware idle tracker waits for a quiet period before the Worker shuts down gracefully. This is a useful pattern for agent workloads: a Runtime can stay available while the agent is actively making model and tool calls, then release capacity after the work subsides.
To try the sample, configure Temporal Cloud credentials and AWS permissions, then deploy the Worker package to AgentCore Runtime. Create a Worker Deployment Version that targets the Runtime, then start the example Workflow.
Build durable, dynamically scaling agents with Temporal Serverless Workers and AWS AgentCore#
AgentCore and Temporal solve complementary parts of the production agent problem. AgentCore gives developers an AWS-native platform for deploying agents, connecting them to tools and data, enforcing access, and observing them in production. Temporal gives the agent a durable execution model that survives process failure, long waits, retries, and infrastructure replacement. Serverless Workers connect the two by invoking AgentCore Runtime capacity when Temporal has work ready to execute.
Start with the AgentCore and Strands Python sample, then review the Temporal Serverless Workers architecture. The Temporal Strands integration shows how model and tool operations become durable Activities. With this reference architecture, your agent's compute can remain elastic and replaceable while its progress remains durable.