Multi-stage approvals
Route calendar mutations through ordered approval stages before they are ready to commit. Exact approvers, role selectors, and lifecycle hooks allow the host application to coordinate its own review process.

What you configure
- approvalFlows
- Define ordered stages with approverIds or approverRoles.
- stage mode
- Use any for one matching approval, or all for every configured selector.
- approval hooks
- Connect stage entry, approval, rejection, leave, and flow completion behavior.
Integration code example
- Create a licensed workflow engine with actors, permission policies, and approval flows.
- Attach a flow to a mutation or state transition, then submit it for review.
- Call approve or reject with the acting user's identity and connect notifications through your hooks.
Copy this TypeScript into your application, not the browser console. Replace YOUR_WTS_LICENSE_KEY with an entitlement issued for your deployment origin. A WTS license is not a Google, Microsoft or CalDAV credential. These examples are documentation only and never execute on this page.
npm install @wts-calendar/coreimport { verifyCalendarLicense } from '@wts-calendar/core';
import { EnterpriseCalendarWorkflow } from '@wts-calendar/core/enterprise-workflow';
import type { EnterpriseWorkflowActor } from '@wts-calendar/core/enterprise-workflow';
const license = await verifyCalendarLicense('YOUR_WTS_LICENSE_KEY');
const workflow = new EnterpriseCalendarWorkflow({
license,
actor: { id: 'editor-1', roles: ['editor'] },
online: false,
autoFlush: false,
events: [
{
id: 'release',
title: 'Release window',
start: '2026-09-07T09:00:00Z',
end: '2026-09-07T10:00:00Z',
},
],
defaultPermission: 'deny',
permissionPolicies: [
{ id: 'propose', effect: 'allow', actions: ['update', 'flush'], roles: ['editor'] },
{
id: 'review',
effect: 'allow',
actions: ['approve', 'reject'],
roles: ['manager', 'director'],
},
],
approvalFlows: [
{
id: 'release-review',
stages: [
{ id: 'manager-review', approverRoles: ['manager'] },
{ id: 'director-review', approverRoles: ['director'] },
],
},
],
});
export const pending = await workflow.submit({
type: 'update',
eventId: 'release',
changes: { title: 'Reviewed release' },
approvalFlowId: 'release-review',
});
// Invoke each approval from the appropriate authenticated review action.
export async function approveAs(actor: EnterpriseWorkflowActor) {
return workflow.approve(pending.id, actor);
}
// After all stages complete, explicitly deliver the queued mutation.
export async function deliver() {
workflow.setOnline(true);
return workflow.flush();
}Application responsibilities
This sample is runtime-only and initially offline. No database or WTS backend is required. Without your own backend adapter, flush commits only in memory and reload loses the state.
Actor IDs and roles are sample data, not authentication. A shared backend must authenticate users and independently enforce permissions, approval stages and event versions.
Use stage hooks such as onEnter to notify reviewers; make external side effects idempotent. Pending approvals are not sent by flush until all required stages complete.
Behavior and lifecycle
- Mutations remain pending-approval until their required stages complete.
- A failing or denying hook prevents progression; failure paths record audit and rollback actions.
Limits and responsibilities
- No email, notification, or reviewer directory service is operated by WTS.
- Hook side effects should be idempotent, and a shared backend must authenticate approvers.
Enable this capability
- Optional module
- @wts-calendar/core/enterprise-workflow
- Signed entitlement
- enterprise-workflow
Request the required features and deployment origins by email. Pricing and terms are confirmed privately. A WTS license is separate from provider credentials; do not send passwords or production access tokens.
Email for a license key →This public guide does not execute Premium modules or collect license tokens.