rich-megabyte-73517
04/24/2026, 4:41 AMtall-airline-16756
04/24/2026, 4:41 AMtall-airline-16756
04/24/2026, 4:41 AMrich-megabyte-73517
04/24/2026, 4:43 AMtall-airline-16756
04/24/2026, 4:44 AMctx.shutdown() (or your room shutdown endpoint) when the timer expires to end the room. Example pattern: create a background asyncio.Task that sleeps for the desired seconds, then shuts down the room and optionally notifies participants.
• If you're using an avatar/Runway session: the max_duration parameter can be used to cap that avatar session in seconds.
If you'd like, tell me:
• Which integration you're using (plain LiveKit rooms, agent-based sessions, or Runway/avatar sessions)
• Whether the limit should be per-room or per-user
• The max duration you want
I’ll send a concise code example tailored to your setup.
Sources: Runway Characters integration guide | LiveKit Documentation | Build a salary negotiation coach with a LemonSlice avatar | LiveKit | Build a salary negotiation coach with a LemonSlice avatar | LiveKit | Agent session | LiveKit Documentation | Job lifecycle | LiveKit Documentation, with interactive elementsrich-megabyte-73517
04/24/2026, 4:47 AMtall-airline-16756
04/24/2026, 4:47 AMdeparture_timeout. To enforce a hard max duration you need to implement it in your application/server.
Two simple options you can use right away:
• Server-side timer: when you create/open the room, start a timer for the desired seconds. When it expires, call your room shutdown or deletion API to end the room and notify participants.
• Agent/session flow (if you use agents): run a background task that sleeps for the max duration and then calls ctx.shutdown() (and optionally delete the room with delete_room_on_close=True).
If you want, tell me:
• Which server language/framework you use (Node, Python, etc.)
• Whether you want the limit per-room or per-user
• The max duration in minutes/seconds
I’ll send a short code example for your stack.
Sources: Server lifecycle | LiveKit Documentation | Avoiding Room ID Reuse When Re-Creating Rooms With the Same Name | Job lifecycle | LiveKit Documentation | Deployment reliability on LiveKit Cloud | LiveKit, with interactive elements