Workflow Orchestration · Python SDK harness
Airline Customer-Service Triage with FAQ and Seat-Change Handoffs
An OpenAI Agents SDK example routes airline customer questions to a keyword-based FAQ agent and seat-change requests to a booking agent that updates example conversation context.
What This Workflow Does
A triage agent can hand off to an FAQ agent or a seat-booking agent; the specialist agents can hand back to triage.
The FAQ tool uses keyword matching and fixed sample answers for baggage, seating, and Wi-Fi questions, and returns an unknown-answer response otherwise.
The seat-booking routine asks for a confirmation number and desired seat, then calls a tool that updates those values in the example's context; a handoff hook sets a flight number.
The async conversation loop carries forward input history and context, runs the current agent with tracing, and prints messages, tool events, and handoffs.
Agent, Harness & Requirements
The workflow runs on OpenAI Agents SDK inside a Python SDK harness. You embed the agent loop in Python and own the tools, state, and deployment.
- A Python runtime for the asynchronous example, the OpenAI Agents SDK and Pydantic imports used in the file, and the repository-local examples.auto_mode helpers it imports.
How It Works
- Create a typed airline context with passenger, confirmation, seat, and flight fields.
- Define the FAQ lookup and seat-update tools, plus a handoff hook that assigns a sample flight number.
- Configure FAQ and seat-booking agents with their respective routines, and a triage agent with handoffs to both specialists.
- Run the async loop from the triage agent, preserve context and conversation input between turns, and display the run events.
Illustrative excerpt from the source example
triage_agent = Agent[AirlineAgentContext](
name="Triage Agent",
handoffs=[
handoff(agent=faq_agent, tool_name_override="transfer_to_faq_agent"),
handoff(
agent=seat_booking_agent,
on_handoff=on_seat_booking_handoff,
tool_name_override="transfer_to_seat_booking_agent",
),
],
)Evidence & Source
Documented OpenAI's SDK example code documents the agents, handoffs, tools, and conversation loop for this sample workflow; it is provider documentation, not independent validation.
Customer service example — OpenAI Agents SDK (examples/customer_service/main.py)
Open the sourceLimitations
- The FAQ tool is a hard-coded keyword matcher with fixed sample responses, not a general FAQ retrieval system.
- The seat tool updates example in-memory context, and the handoff hook assigns a random sample flight number; the source does not show integration with or verification against an airline booking service.
This record describes what the source states. It is not a review, a benchmark, or a recommendation. If the tool has changed since the check date, report it.