Simple examples to get started with OpenAI Agents SDK integrated with Temporal workflows.
Adapted from OpenAI Agents SDK basic examples
Before running these examples, be sure to review the prerequisites and background on the integration.
First, start the worker (supports all basic examples):
uv run openai_agents/basic/run_worker.pyThen run individual examples in separate terminals:
Basic agent that only responds in haikus:
uv run openai_agents/basic/run_hello_world_workflow.pyAgent with access to external tools (simulated weather API):
uv run openai_agents/basic/run_tools_workflow.pyDemonstrates agent lifecycle events and handoffs between agents:
uv run openai_agents/basic/run_agent_lifecycle_workflow.pyShows detailed usage tracking with RunHooks (requests, tokens, etc.):
uv run openai_agents/basic/run_lifecycle_workflow.pyAgent with dynamic instruction generation based on context (haiku/pirate/robot):
uv run openai_agents/basic/run_dynamic_system_prompt_workflow.pyDemonstrates different JSON schema validation approaches:
uv run openai_agents/basic/run_non_strict_output_workflow.pyNote: CustomOutputSchema is not supported by the Temporal OpenAI Agents SDK integration and is omitted in this example.
Process local image files with AI vision:
uv run openai_agents/basic/run_local_image_workflow.pyProcess remote image URLs with AI vision:
uv run openai_agents/basic/run_remote_image_workflow.pyDemonstrates conversation continuity using response IDs:
uv run openai_agents/basic/run_previous_response_id_workflow.pyThe following examples from the reference repository are not included in this Temporal adaptation:
- Session - Stores state in local SQLite database, not appropriate for distributed workflows
- Stream Items/Stream Text - Streaming is not supported in Temporal OpenAI Agents SDK integration