This workshop teaches you to build durable AI agents by combining the OpenAI Agents SDK with Temporal—a workflow orchestration platform that adds automatic retries, crash recovery, and full execution history to any Python application. Over 90 minutes of instruction and hands-on exercises, you will progress from writing your first tool-calling agent all the way to running a production-style multi-agent routing workflow, entirely inside GitHub Codespaces with zero local setup.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/temporalio/edu-ai-workshop-openai-agents-sdk/llms.txt
Use this file to discover all available pages before exploring further.
What You’ll Learn
By the end of this workshop you will be able to:- Create AI agents with tool calling using OpenAI’s Agents SDK
- Build Temporal workflows and activities that survive failures and retries
- Wrap LLM calls in durable activities so your agent never loses progress mid-run
- Implement multi-agent routing with agent handoff patterns
- Observe and debug agent execution in the Temporal Web UI
Prerequisites
Basic Python
You should be comfortable writing functions and using
async/await. No advanced Python required.OpenAI API Key
A key from platform.openai.com/api-keys. The free tier is sufficient — expect to spend roughly 1.00 in API credits.
GitHub Account
Required to open the repository in GitHub Codespaces. No local installation of any tool is needed.
Why Temporal for AI Agents?
Running AI agents in production surfaces a set of reliability problems that plain Python cannot solve on its own.The Problem
| Challenge | What Happens Without Temporal |
|---|---|
| API failures | LLM APIs get rate-limited or return 5xx errors — your agent crashes and loses all progress |
| Process crashes | A server restart mid-execution means starting over from scratch |
| Long-running operations | Multi-step agent flows have no built-in checkpoint mechanism |
| Observability | There is no record of what your agent actually decided or executed |
The Solution
Temporal solves each problem by providing:- Automatic retries with configurable backoff and retry policies on every activity
- State persistence so workflows resume exactly where they left off after any failure
- Execution history for auditing, debugging, and replaying past runs
- Durable execution that survives worker crashes, deployments, and infrastructure events
Your agent code itself does not change — Temporal wraps each LLM call and tool invocation in an activity, giving it superpowers with no modifications to your business logic.
Architecture Pattern
The core pattern you will build in Exercise 3 and Exercise 4 looks like this:Workshop Structure
The session is 90 minutes: 30 minutes of instructor-led explanation followed by four 15-minute hands-on exercises.| Time | Activity |
|---|---|
| 00:00 – 05:00 | Introduction and setup verification |
| 05:00 – 30:00 | OpenAI Agents SDK slides + Exercise 1 walkthrough |
| 30:00 – 55:00 | Temporal fundamentals slides + Exercise 2 walkthrough |
| 55:00 – 80:00 | Combined architecture slides + Exercise 3 walkthrough |
| 80:00 – 90:00 | Exercise 4 demo, production patterns, and Q&A |
solutions/ directory. After the workshop you can practice building everything from scratch using the exercises/ directory as optional homework — each exercise contains starter code with TODO markers.
Exercises 1–3 are Jupyter notebooks (
.ipynb files). Exercise 4 uses separate Python files (workflow.py, worker.py, starter.py) to demonstrate a production-style Temporal application structure.The Four Exercises
Exercise 1 — Agent Hello World
Build your first OpenAI agent with a weather tool that calls the National Weather Service API. Learn the agent → tool → response flow and see how the LLM decides when to invoke tools.
Exercise 2 — Temporal Hello World
Write your first Temporal workflow and activity in Python. Observe execution history in the Temporal UI and trigger an automatic retry by simulating a failure.
Exercise 3 — Durable Agent
The key exercise. Wrap LLM calls and tool executions in Temporal activities to create a production-ready durable agent. Add a
trace_id for correlation with OpenAI traces.Exercise 4 — Agent Routing
Build a multi-agent routing system with language-specific agents (French, Spanish, English) using OpenAI Agents SDK handoff patterns and a production file structure.
Cost Estimate
The workshop uses approximately 1.00 of OpenAI API credits across all four exercises. The free tier is more than sufficient. All exercises usegpt-4o-mini by default to keep costs low.