From Serverless Functions to Durable Agents
Why agent systems outgrow stateless request-response functions and push teams toward durable execution, memory, and long-lived workflows.
For nearly a decade, serverless computing has been one of the most successful abstractions in cloud infrastructure. Platforms such as AWS Lambda and Cloudflare Workers made it possible for developers to write business logic without worrying about provisioning servers, scaling policies, or infrastructure management.
The model was simple:
Request -> function executes -> result -> terminate.
Functions were expected to run for milliseconds or seconds. They were stateless, ephemeral, and event-driven. This worked extremely well for workloads such as APIs, authentication handlers, webhooks, and data transformations.
Even the first wave of LLM applications fit comfortably within this model. A user request would arrive, a prompt would be sent to a model, and the response would be returned to the user.
But something has changed over the last year.
As AI systems evolve from simple prompt-response applications to agentic systems, the assumptions behind serverless computing are starting to show cracks.
The Shift from Prompts to Agents
The early generation of AI applications followed a straightforward pattern:
User request -> LLM call -> return result.
This model fits perfectly inside a serverless function.
Agent systems operate very differently. Instead of producing a single response, they operate in iterative loops:
Observe -> plan -> call tool -> evaluate -> repeat.
Each step in this loop may involve:
-
multiple model calls
-
tool invocations
-
waiting on external systems
-
updating internal memory
-
revising plans
This transforms the execution model from single-shot inference into a long-running process.
Early agent experiments ran for a few minutes at most. Today it is increasingly common to see agents running for hours, especially when they are performing tasks such as:
-
code generation workflows
-
research automation
-
enterprise process automation
-
continuous monitoring and remediation
As models become more capable and orchestration frameworks improve, these runtimes will only increase.
Serverless Assumptions vs Agent Reality
Serverless platforms were designed around a set of assumptions:
Serverless workloads:
- milliseconds to seconds
- stateless
- request-response
- deterministic execution
- single function invocation
Agent workloads:
- minutes to hours
- persistent memory
- iterative loops
- adaptive reasoning
- multi-step orchestration
Agents violate nearly every assumption that serverless infrastructure relies on.
Serverless environments are optimized for ephemeral execution. When an agent needs to maintain memory, track progress, retry failed steps, and coordinate multiple tools, ephemeral compute becomes a liability.
What agents require instead is a durable runtime.
The Rise of Agent Orchestrators
Another shift happening in parallel is the move from individual agents to agent orchestrators.
Initially, agents were invoked directly by users. Increasingly they are being triggered by events:
-
a failed payment webhook
-
a new lead submission
-
a Slack message
-
a scheduled job
-
a monitoring alert
In these cases the system is no longer just running a single agent. It is coordinating multiple components:
Event -> orchestrator -> agent workflow -> tool calls -> state updates.
The orchestrator becomes more important than the individual agent.
This resembles traditional workflow systems more than stateless functions.
Stateful Integrations Are Becoming the Norm
Enterprise environments introduce another important factor: stateful integrations.
Tool providers increasingly expose capabilities through long-lived interfaces such as the Model Context Protocol (MCP). These systems maintain context across interactions and expect persistent sessions rather than isolated API calls.
As more tools and enterprise services adopt similar patterns, the infrastructure supporting them must also become stateful.
The Infrastructure Implication
The natural conclusion is that agent systems require infrastructure with properties very different from traditional serverless functions.
They need runtimes that provide:
-
persistent state
-
long-lived execution
-
checkpointing and recovery
-
scheduling and orchestration
-
event-driven triggers
-
cost and resource control
In other words, agents behave much more like durable processes than ephemeral functions.
Serverless Isn't Going Away
This does not mean serverless platforms are obsolete.
Stateless functions will continue to play an important role in:
-
API layers
-
authentication services
-
event ingestion
-
lightweight transformations
-
edge logic
But they are unlikely to be the core execution environment for agent systems.
Instead, serverless will increasingly serve as the event entry point for more durable agent runtimes.
A typical architecture may look like this:
Edge or serverless layer -> event routing -> agent orchestrator -> durable agent runtime -> models and tools.
The Next Infrastructure Layer
What is emerging is a new infrastructure category: durable agent runtimes.
These systems will combine elements of:
-
workflow engines
-
actor systems
-
distributed schedulers
-
event-driven architectures
The companies and open-source projects that solve this problem well will likely define the next generation of AI infrastructure.
Serverless computing simplified stateless compute.
Agent systems are forcing us to rethink stateful, long-running intelligence in production systems.
And that requires a very different runtime model.
Have a similar problem to solve?
Use the contact page if you want help with agent architecture, evaluation, or implementation.
Get in touch