Use cases
These examples show the same primitives in different domains:
- Send a notification with
push. - Render durable UI with
contentanddetail. - Update state with
replace. - Add timeline history with
append. - Route signed
response.submittedwebhook events.
Deploy approvals
Gate a production deploy on a signed human decision.
AI agent in the loop
Let an agent pause for approval before taking a sensitive action.
Incident response
Keep one incident notification updated through investigation and rollback.
Customer operations
Collect structured input and files for support or finance workflows.
Shared backend shape
backend pattern
const notification = await roundtrip.notify({
channel,
push,
content,
detail,
response: {
mode: "required",
behavior: "resolve",
webhook: "https://api.example.com/roundtrip/webhooks",
},
metadata: { domainId },
idempotency: [domain, domainId, "open"],
});
await saveNotificationId(domainId, notification.id);Use the webhook event to continue the domain workflow:
webhook
const event = await roundtrip.webhooks.unwrap({
rawBody,
headers,
secret: process.env.ROUNDTRIP_WEBHOOK_SECRET!,
});
await router.dispatch(event);