The OpenAI Agents SDK lets an LLM decide application flow, call tools, use guardrails, and hand off to other agents.
2
Temporal adds retries, state recovery, event history, and durable execution to agent workflows without requiring developers to write that failure-handling logic themselves.
3
The Temporal integration places an OpenAI agent inside a Temporal workflow, so the agent can survive process crashes and scale across workers while retaining the Agents SDK programming model.
Summary
Cornelia Davis introduces the OpenAI Agents SDK and Temporal, then combines them in working examples. She defines an agent as an application where the LLM decides the flow, such as whether to call a weather or location tool. Temporal supplies durability for the distributed work around that loop. Developers wrap external or failure-prone work in activities and compose those activities into workflows. Temporal records activity results, applies configured retries, stores execution history, and reconstructs state after a worker or application process fails. The integration adds Temporal support to the Agents SDK through a plugin and an activity-as-tool function. Davis shows the same weather agent running with and without a live worker, then demonstrates that it continues after the worker restarts. She also explains two orchestration styles, explicit code that passes results between agents and Agents SDK handoffs that change the context within one agentic loop. Streaming remains a work in progress, with customer-built workarounds available.
An agent lets the LLM decide the application's flow
Davis draws the boundary between a generative AI application and an agent at agency. An agent gives the LLM control over the flow of the application. In the OpenAI Agents SDK, a basic agent has a name and instructions, then runs through the SDK's runner. Each `runner.run` corresponds to an agentic loop. The loop calls the LLM, follows its decision, invokes tools when requested, sends tool output back to the LLM, and continues until the LLM decides it is done. The SDK also supports model selection, tools, guardrails, and handoffs. It is available in Python and TypeScript.
Temporal treats distributed-system durability as a backing service
Temporal is an open-source project designed for distributed systems, and Davis argues that AI applications fit that model. Developers write the happy path, such as calling an LLM, invoking downstream APIs, and looping back to the LLM. Temporal handles failures around that logic, including rate limits, temporary API outages, and application crashes. Its SDK sits alongside the business code and adds behavior around wrapped functions. Temporal records calls and their results, so a recovered application can reuse completed work instead of repeating it. Davis says this prevents an agent from burning tokens again after a crash late in a long agentic run.
Activities and workflows divide durable agent execution
An activity is a chunk of work that may make an external call, may fail, or may be expensive to repeat. A workflow composes activities into the application's business logic. Developers configure retry behavior in the workflow, including exponential backoff, unlimited retries, retry limits, and maximum intervals. Temporal also routes activity work through queues and records execution state through event sourcing. This means code that looks like a sequence inside one process is executed through a distributed system. Workers pull workflow and activity work from queues, and additional worker instances can scale execution without developers managing Kafka queues or Redis for this coordination.
The first demo builds a configurable agentic loop from durable activities
Davis's first example uses the OpenAI Responses API directly, rather than the Agents SDK. One activity calls the LLM and another dynamically invokes tools. The workflow loops over the LLM response, detects a function call, invokes the named tool activity, and appends the result to the conversation history. A dynamic activity handler can receive different tool names at runtime. The tool module supplies the tool descriptions and maps names to functions, so the agentic loop does not need to be rebuilt for every tool set. The demo uses weather alerts and location functions, with the LLM choosing which tools to call from their descriptions.
Temporal recovers an agent after its worker process stops
In the durability demo, Davis starts an agent, stops the worker after it has made earlier LLM and tool calls, and shows the workflow waiting in the Temporal UI. The worker process is no longer running, but the workflow history contains the completed work and the point where execution stopped. When she restarts the worker, Temporal reconstructs the application's state from its event history and continues the workflow. The earlier calls are not repeated. She also explains that a network failure would produce repeated attempts according to the retry policy, and that the workflow can continue once the network returns.
The Agents SDK integration turns activities into agent tools
With the integration, the agent definition becomes much smaller. Davis keeps the weather and location functions as Temporal activities, adds docstrings, and passes each activity through `activity_as_tool`. That public integration function creates the tool description for the Agents SDK. The workflow defines the agent with its name, instructions, and activity-backed tools. A worker loads the OpenAI Agents plugin, which supplies Temporal behavior for the Agents SDK runner and configures LLM retry policies. The LLM call does not need to appear as a separate activity in the application code because the integration makes that part durable as well.
Agent handoffs change context within one loop, while explicit code creates separate steps
Davis describes two orchestration styles in the OpenAI Agents SDK. In explicit code, one agent runs, its result is passed to another agent, and the developer can add loops, parallel work, or waits using ordinary programming constructs. In a handoff, an agent points to another agent in its definition. The handoff does not start a separate agentic loop. Instead, the existing loop changes context and takes on the receiving agent's instructions and persona. Davis compares this with a triage agent handing work to a weather or local-information agent. The Temporal integration supports these handoffs.
Streaming is available through workarounds while native support is being built
When asked about streaming data, Davis answers that Temporal does not currently provide native streaming support. She says it is one of the team's top priorities, alongside large-payload storage. Large-payload storage would allow applications to pass large LLM-related data by reference rather than by value. Johan adds that customers already run streaming systems at scale on top of Temporal, but those implementations require more work and are not the normal path. Davis presents native support as future work rather than part of the current integration.