Endpoint
Authentication
Bearer token required.Request Body
A descriptive name for the workflow.
JavaScript or TypeScript source code to execute when triggered.
List of events that trigger this workflow. At least one event is required. Same event types as webhooks.
Scope the workflow to a specific room. If omitted, the workflow triggers for events in all rooms.
Available Events
| Event | Description |
|---|---|
participant.joined | A user came online in a room |
participant.left | A user went offline |
session.started | A new session started |
session.closed | A session ended |
user.created | A new user was added |
user.updated | A user’s fields changed |
user.deleted | A user was removed |
Worker Bindings
Your workflow code has access to these bindings:| Binding | Type | Description |
|---|---|---|
store | StoreBinding | Read-only access to KV stores |
room | RoomBinding | Read-only room and user metadata |
files | FilesBinding | Scoped R2 file operations |
event | EventBinding | The event that triggered the workflow |
Response
The created workflow. See
WorkflowRegistration.Example
Response (201)