| title | OpenAI Agents SDK for Typescript + Trigger.dev playground |
|---|---|
| sidebarTitle | OpenAI Agents SDK for Typescript playground |
| description | Build production-ready AI agents with OpenAI Agents SDK for Typescript and Trigger.dev. Explore 7 examples covering streaming, multi-agent systems, and tool integration. |
| tag | v4 |
import RealtimeLearnMore from "/snippets/realtime-learn-more.mdx";
This is a v4 project. If you are using v3 and want to upgrade, please refer to our [v4 upgrade guide](/docs/v4-upgrade-guide).7 production-ready patterns built with the OpenAI Agents SDK and Trigger.dev. Clone this repo to experiment with everything from basic calls to workflows with tools, streaming, guardrails, handoffs, and more.
By combining the OpenAI Agents SDK with Trigger.dev, you can create durable agents that can be deployed to production and scaled to any size, with retries, queues, and full observability built-in.
<video controls className="w-full aspect-video" src="https://github.com/user-attachments/assets/d3a1c709-412f-48e8-a4aa-f0ef50dce5c8"
- Node.js runtime environment
- OpenAI Agents SDK for Typescript for creating and managing AI agents
- Trigger.dev for task orchestration, batching, scheduling, and workflow management
- Zod for payload validation
<Card title="View the OpenAI Agents SDK TypeScript playground repo" icon="GitHub" href="https://github.com/triggerdotdev/examples/tree/main/openai-agents-sdk-with-trigger-playground"
Click here to view the full code for this project in our examples repository on GitHub. You can fork it and use it as a starting point for your own project.
- Basic Agent Chat: Personality-based conversations with strategic model selection
- Agent with Tools: A simple agent that can call tools to get weather data
- Streaming Agent: Real-time content generation with progress tracking
- Agent Handoffs: True multi-agent collaboration using the handoff pattern where agents can dynamically transfer control to specialists
- Parallel Agents: Concurrent agent processing for complex analysis tasks
- Scheduled Agent: Time-based agent workflows for continuous monitoring
- Agent with Guardrails: Input guardrails for safe AI interactions
- basicAgentChat.ts - Strategic model selection (GPT-4, o1-preview, o1-mini, gpt-4o-mini) mapped to personality types with Trigger.dev task orchestration
- agentWithTools.ts - OpenAI tool calling with Zod validation integrated into Trigger.dev's retry and error handling mechanisms
- streamingAgent.ts - Native OpenAI streaming responses with real-time progress tracking via Trigger.dev metadata
- scheduledAgent.ts - Cron-scheduled OpenAI agents running every 6 hours with automatic trend analysis
- parallelAgents.ts - Concurrent OpenAI agent execution using Trigger.dev batch operations (
batch.triggerByTaskAndWait) for scalable text analysis - agentWithGuardrails.ts - OpenAI classification agents as input guardrails with structured validation and exception handling
- agentHandoff.ts - OpenAI Agents SDK handoff pattern with specialist delegation orchestrated through Trigger.dev workflows
- OpenAI Agents SDK docs - learn about creating and managing AI agents
- OpenAI Agents SDK handoffs - learn about agent-to-agent delegation patterns
- Batch triggering - learn about parallel task execution
- Scheduled tasks (cron) - learn about cron-based task scheduling