early-butcher-66889
12/21/2025, 8:10 AMconst createRoomOptions: any = {
name: roomName,
emptyTimeout: 300, // 5 minutes
maxParticipants: 2,
agents: [
{
agentName: agentName,
metadata: JSON.stringify({ workflowId: workflowId })
}
]
};tall-airline-16756
12/21/2025, 8:10 AMtall-airline-16756
12/21/2025, 8:10 AMctx.job.metadata (it's typically a JSON string), for example:
export default defineAgent({
entry: async (ctx: JobContext) => {
const metadata = JSON.parse(ctx.job.metadata);
const workflowId = metadata.workflowId;
// ...
},
});
If you want, tell me which runtime (Node/Python) you're using and I can show the exact snippet for that language.
Sources: Agent dispatch | LiveKit docs | Job lifecycle | LiveKit docs | Agents (Node.js) | livekit/livekit_composite | DeepWiki