Webhooks vs Workflows
| Feature | Webhooks | Workflows |
|---|---|---|
| What | HTTP POST to your server | Custom JS/TS code executed in Cloudflare Workers |
| Where | Your own infrastructure | CollabKit’s infrastructure |
| Use case | Notify external services, update databases | Process events, transform data, trigger side effects |
| Setup | Provide a URL | Provide source code |
| Auth | HMAC-SHA256 signature verification | N/A (runs in a secure sandbox) |
Part 1: Webhooks
Create a Webhook
Register a URL to receive HTTP callbacks when events occur:secret from the response — you need it to verify webhook signatures.
Available Events
| Event | When It Fires |
|---|---|
participant.joined | A user comes online in a room |
participant.left | A user goes offline |
session.started | First user joins a room (new session) |
session.closed | Last user leaves a room (session ends) |
user.created | A new user is added to a room via POST /users |
user.updated | A user’s fields are changed |
user.deleted | A user is removed from a room |
Webhook Payload
Each delivery sends a POST request with a JSON body:Verify Webhook Signatures
Each delivery includes an HMAC-SHA256 signature. Verify it to ensure the payload is authentic:Scope to a Room
Limit webhooks to a specific room:Monitor Deliveries
Check the delivery log to debug issues:pending, success, failed), HTTP status code, attempt count, and next retry time.
Part 2: Workflows
Workflows let you run custom JavaScript in response to events, directly on CollabKit’s infrastructure.Create a Workflow
Workflow Bindings
Your workflow code receives the event and a set of bindings:| Binding | Methods | Description |
|---|---|---|
store | get(store, key), getAll(store) | Read-only KV store access |
room | get(), getUsers() | Read-only room and user metadata |
files | list() | Scoped R2 file listing |
event | (passed as first arg) | The triggering event data |
Example: Notify Slack on Session Start
Example: Auto-Create Welcome Store Entry
Monitor Executions
Check the execution log:Enable/Disable Workflows
Next Steps
- Combine webhooks with workflows for a complete event pipeline
- Use the dashboard to manage webhooks and workflows visually
- Review the Webhook API reference and Workflow API reference for full details