Worked Examples
Developer reference for scheduling workflows — Contact and Engagement Platform
Implement governed scheduling as a review-first workflow linking private inquiries, authorized sender-portal meeting offers, time-zone-safe Microsoft Teams coordination, and auditable reminders. This developer reference documents source-verified objects, WordPress capabilities, status transitions, privacy projections, and reproducible contract tests while distinguishing implementation from deployment verification.
Application: Contact and Engagement Platform
Component: Scheduling Workflows / Microsoft Teams and Calendar Coordination
Article type: Developer Reference
Source-reviewed plugin version: 2.0.2
Calendar schema: 1.0.1; workflow schema: 1.3.0; Graph schema: 1.0.0 (not independently registered KB product versions)
Verification status: Source-reviewed; independent offline checks only
Estimated reading time: 18–22 minutes
This reference defines the implemented scheduling contract across private inquiries, sender-portal meeting offers, calendar coordination, reminders and optional Microsoft Graph synchronization. Unlike a proposed interface specification, each implemented function and record named below is anchored to a reviewed source path. Do not publish an undocumented endpoint, webhook, tenant model or field as an existing platform capability.
Goal
Enable authorized, review-first coordination of Microsoft Teams meetings while ensuring that anonymous visitors cannot inspect organizer calendars, that sender-accessible records expose only approved meeting fields, and that staff, sender, and remote calendar actions remain attributable and reconcilable. A successful request for a meeting is not an automatic reservation, and local acceptance is not proof that a remote Graph event exists.
Requirements
- Confirm the installed plugin version, deployment commit or ZIP checksum, database migration status, and relevant WordPress capability assignments. The reviewed repository declares WordPress 6.5+ and PHP 8.1+ requirements; verify the running host separately.
- Use synthetic inquiry records, invited sender-portal accounts, and a staging Microsoft 365 organizer mailbox or mocked Graph boundary. Do not send live invitations, expose attendee data, or create events in a personal calendar during automated tests.
- Capture only synthetic record references, status codes, counts, verified UTC intervals and redacted error categories in shared test evidence. Retain private diagnostics in access-controlled storage.
- Record configurable settings, including Teams-URL requirements, reminder settings, public-booking prohibition, and optional Graph connector state. Never assume repository defaults equal deployed configuration.
- Use WordPress nonces and actor-specific capabilities for administrative mutations. Take an authorized backup before migration or fault injection; this guide contains no production write script.
Intended behavior
The public intake form collects a meeting request, preferred contact details and scheduling context; it does not present live calendar free/busy information or provision a Teams meeting. Authorized staff create and publish a limited set of proposed times to an invited or active sender portal. A sender may accept a slot, request an alternative, or decline. A valid Teams URL or human-triggered Graph reconciliation is needed to finalize the actual meeting link, and communications remain reviewable.
Public inquiry (meeting request; no calendar exposed)
|
v
Authorized review + invited/active sender portal
|
v
DRAFT meeting offer --staff publish--> OFFERED
| |
| sender response (portal)
| |
| +-----------------+------------------+
| | | |
| ACCEPT ALTERNATIVE DECLINE
| | REQUESTED DECLINED
| +---------+-----------+
| | |
| SCHEDULED ACCEPTED_PENDING_LINK
| | |
| +---- manual Teams URL / human-triggered Graph ----+
| |
+-------------------------------+--> SCHEDULED
|
COMPLETED / CANCELED
Orthogonal transitions: EXPIRED, SUPERSEDED; reschedule keeps status
but revises UTC interval and increments its revision counter.
Implemented source and version map
| Reviewed component | Source symbol / artifact | Contract boundary |
|---|---|---|
| Public intake | SC_EI_Form_Handler::process() |
Requires privacy and authority-to-share acknowledgments. A requested meeting additionally requires valid time zone and calendar-invitation consent. |
| Meeting offers | SC_EI_Workflow_Repository |
Creates offers, publishes drafts, records secure-portal responses, finalizes links, changes state, exports ICS. |
| Calendar coordination | SC_EI_Calendar_Repository |
Updates meeting details, reschedules, completes/cancels, prepares reminders, provides a narrow sender snapshot. |
| Time and link parsing | SC_EI_Teams |
Validates IANA time zones and supported Teams hosts, converts valid local clock values into UTC. |
| Staff controller | SC_EI_Calendar_Admin |
Registers authenticated admin_post_* actions with capability and nonce checks. |
| Optional remote connector | SC_EI_Graph_Repository and Graph admin |
Maintains durable Graph operation queue; authorization and reconciliation are distinct from local meeting state. |
| Persistence | SC_EI_Database |
Names tables meeting_offers, meeting_reminders, graph_operations and workflow event records via plugin table helper. |
Data and access contracts
Canonical object identity and ownership
The meeting offer row is the local system of record. Important source-reviewed columns include id, public_id, inquiry_id, access_id, offer_number, status, row_version, timezone, slots_json, selected_start_utc, selected_end_utc, teams_url, and Graph linkage fields. These are actual WordPress plugin database fields, not documented public API fields. The reviewed schema does not declare a dedicated tenant_id column for meeting offers: assess isolation through the inquiry/portal linkage, authentication, roles, and deployment boundaries rather than inventing tenant guarantees.
Staff capabilities and mutation routes
| Action | WordPress capability | Additional gate |
|---|---|---|
| View calendar workspace | sc_intake_view_workflow |
Authenticated admin page; not an anonymous calendar feed |
| Save coordination / reschedule / complete / cancel | sc_intake_finalize_meetings |
Per-action nonce; confirmation phrase on reschedule, complete and cancel |
| Mark reviewed reminder sent | sc_intake_send_communications |
Nonce, appropriate reminder state, linked outbound communication |
| Create Graph event | sc_intake_create_graph_events |
Nonce and exact GRAPH <OFFER-NUMBER> confirmation |
| Reconcile Graph event | sc_intake_reconcile_graph_events |
Nonce and exact offer-specific confirmation |
| Delete remote Graph event | sc_intake_cancel_graph_events |
Nonce and exact DELETE GRAPH <OFFER-NUMBER> confirmation |
Staff calendar controls are implemented through WordPress admin-post.php actions such as sc_ei_calendar_reschedule and sc_ei_calendar_cancel. These are authenticated form actions, not JSON REST endpoints. The public REST /wp-json/sc-engagement-intake/v1/submit route is an intake endpoint, not a meeting booking endpoint. A dedicated public scheduling API is not established by the reviewed files.
Sender-facing privacy projection
The reviewed SC_EI_Calendar_Repository::sender_snapshot() returns a restricted set: meeting ID and offer number; state, title, type and purpose; time zone and selected UTC times; valid Teams link when allowed; agenda, preparation notes, sender summary, sender next step, post-meeting sender summary, cancellation reason where relevant, and reschedule count. It excludes organizer_email, participant_emails_json, internal notes, decisions, open questions, Graph operational details, and follow-up ownership. This allowlist only covers that projection; independently test other exports, caches, portal responses, diagnostic logs and integrations.
Meeting status contract
| Initial state and event | Result | Guard to verify |
|---|---|---|
| No offer → create with publish=false | draft |
Valid inquiry; invited/active portal; valid future slots; accepted Teams URL if present |
draft → staff publishes |
offered |
If workflow_require_teams_url enabled, a Teams URL is required; row-version conditional update |
offered → sender accepts |
scheduled or accepted_pending_link |
Authenticated sender session, offered nonexpired slot, future start; valid Teams URL determines which state |
offered → alternative/decline |
alternative_requested / declined |
Allowed response; alternative request supplies adequate note |
accepted_pending_link → finalize |
scheduled |
Authorized staff and approved Teams URL, or reconciled remote join URL |
scheduled → reschedule |
scheduled with new UTC interval |
Future valid local civil time, reason, row-version match, reminder regeneration and recovery |
scheduled → completion |
completed |
Authorized staff; requested follow-up task and context handled before status update |
| Open meeting → cancellation | canceled |
Authorized actor and reason; local sender links revoked; separate Graph deletion when applicable |
| Offer invalidated | expired / superseded |
Retained historical state must not expose a live join link |
The inquiry-level scheduling_status vocabulary (requested, under_review, approved, times_proposed, scheduled, etc.) is distinct from the offer-level status. Do not merge them in a report or infer one from a similarly named value without reconciling both records.
Input schema and server-side validation
The reviewed SC_EI_Workflow_Schema::sanitize_slots() accepts local times with an IANA time zone and a bounded duration (15–240 minutes). It filters invalid, past and duplicate UTC start times, computes UTC ends and enforces a configured slot count. SC_EI_Teams::parse_local_datetime() rejects nonexistent spring-forward times and ambiguous fall-back times instead of silently choosing an offset. Always test the deployed PHP/timezone database independently.
# Synthetic examples for America/Chicago, source-reviewed parser semantics
2026-07-15T10:30 => 2026-07-15 15:30:00 UTC (valid CDT)
2026-03-08T02:30 => REJECT calendar_local_datetime_nonexistent
2026-11-01T01:30 => REJECT calendar_local_datetime_ambiguous
# Invalid Teams lookalike; should never be treated as Microsoft Teams
https://teams.microsoft.com.example.invalid/meeting
The Teams URL validator permits approved host names (teams.microsoft.com, teams.live.com, teams.cloud.microsoft) and relevant subdomains. The allowlist is filterable, so verify installed filters and require HTTPS as an additional security-policy gate when validating actual deployments; host validation alone is not proof of scheme enforcement or a trustworthy meeting destination.
Meeting consent and participant authorization
During public intake, a meeting request is conditional on calendar_invite_consent, a valid IANA time zone and sufficient Teams contact information. Before staff create, publish or sync a meeting, record the processing purpose, recipient list, invitation authorization and applicable consent version. The reviewed create_meeting_offer() guards inquiry existence and sender-portal access, but its body does not independently revalidate every earlier consent event. Therefore verify consent and sender withdrawal state at the workflow boundary; do not claim the code automatically enforces every policy-layer condition.
The installed sender portal must bind a meeting response to the authenticated sender session and its specific access_id. Review unauthorized cross-inquiry and stale-session tests in staging. This source-reviewed guide does not infer a general multi-tenant authorization model from one table.
Reminder and communication contract
Reminder types include invitation, 24-hour, one-hour, rescheduled, canceled and post-meeting. Each row contains meeting_offer_id, inquiry_id, type, status, due time, idempotency key and optional linked communication_id. Background jobs can advance a due record to reviewable state, not send it automatically. A reminder can be marked sent only from ready_for_review with an accepted or recorded outbound communication belonging to the same inquiry. Terminal reminders are eligible only for their applicable canceled/completed meeting status.
# Source-derived operator checklist (not a shell command)
reminder.status == ready_for_review
communication.inquiry_id == reminder.inquiry_id
communication.direction == outbound
communication.status in {accepted, recorded}
operator has sc_intake_send_communications
admin nonce valid; no automatic background send
Rescheduling, cancellation, and compensating actions
Rescheduling updates the canonical UTC interval and preserves previous start/end fields, a reason, actor/time and incremented reschedule_count. Optimistic row_version predicates guard concurrent saves. If new reminder generation fails, the code attempts a compensating rollback of the interval and rebuilds prior reminders; this is a best-effort recovery mechanism requiring staging fault injection, not an unconditional transactional guarantee.
On local cancellation, link fields are cleared and the workflow records a revoked timestamp. The remote Graph calendar event may still exist until an explicitly authorized delete action occurs, and that deletion may send Microsoft 365 cancellation messages. Treat local and remote states as separate facts and reconcile both before closing an incident.
Optional Microsoft Graph connector
The documented implementation is a single-tenant Microsoft global-cloud Graph v1.0 application-only connector with one configured organizer mailbox/calendar. It is optional, not a general-purpose OAuth meeting platform. The recommended scope uses Microsoft Graph Calendars.ReadWrite restricted by Exchange Online application RBAC to the intended mailbox set. The local offer remains authoritative; the remote event is a synchronized projection.
A human explicitly queues creation only for a meeting in accepted_pending_link. The durable queue maintains a transaction ID, idempotency key and payload hash, and reuses the same transaction for retries. Event creation may succeed before onlineMeeting.joinUrl becomes available; a read reconciliation then fills the approved Teams link. Do not force a new transaction ID merely because a response times out.
# Source-documented Graph queue identities; conceptual notation
transactionId = stable graph_transaction_id
idempotency_key = SHA256("create|" + meeting_id + "|" + transactionId)
request_hash = SHA256(canonical_event_payload)
# A Graph HTTP 201 is NOT sufficient by itself for sender-ready state:
# verify event ID, UTC interval, organizer mailbox, join URL and local linkage.
Error and observability contract
| Failure class | Evidence to collect | Safe response |
|---|---|---|
| Stale meeting / parallel edit | row_version, expected state, transition name |
Reload and reconcile; do not overwrite |
| Invalid local civil time | Time zone, sanitized date and parser error code | Require unambiguous replacement time |
| Unauthorized staff request | Capability and nonce failure; no private response body | Verify roles, preserve denial, do not bypass guard |
| Missing Teams URL | Offer status, URL host verification, deployment setting | Keep accepted/pending status until finalized |
| Reminder state mismatch | Reminder type/status plus linked outbound message status | Return to review queue; do not mark sent without evidence |
| Graph throttling or timeout | Operation ID, retry-after, request ID, stable transaction ID | Respect backoff; reconcile before creating a second event |
| Local/Graph time drift | Local and remote UTC start/end, sync status | Human-reviewed reconcile/repair |
| Canceled link still visible | Sender snapshot fields, cache metadata, Graph state | Disable disclosure, revoke or invalidate cache; investigate privately |
Developer contract test fixtures
Use the included JSON fixtures and independent validate_meeting_packet.py reference validator for low-risk, deterministic preflight checks. The packet format is a test-only representation of selected source-reviewed invariants, not an API request schema and not proof of a deployed database row. Compare it against actual WordPress fixtures only inside a controlled environment.
{
"meeting": {
"status": "scheduled", "timezone": "America/Chicago",
"selected_start_utc": "2026-12-15 16:00:00",
"selected_end_utc": "2026-12-15 16:30:00",
"teams_url": "https://teams.microsoft.com/l/meetup-join/synthetic",
"row_version": 3, "inquiry_id": 101, "access_id": 202,
"calendar_consent": true
},
"actor": {"kind": "staff", "authorized": true},
"sender_snapshot": {"status": "scheduled", "teams_url": "https://teams.microsoft.com/l/meetup-join/synthetic"},
"reminders": [], "graph": {"enabled": false}
}
python3 -m unittest discover -v -s tests -p 'test_*.py'
python3 validate_meeting_packet.py fixtures/valid_meeting.json
python3 validate_meeting_packet.py fixtures/invalid_meeting.json
# The invalid fixture exits 2 with intentionally generated findings.
Read-only deployment inspection
The following commands are read-only and must be run only on an authorized WordPress host. They inspect the installed plugin version, relevant capabilities and the registered class/table availability. They do not create a meeting, contact Microsoft Graph, or expose a private inquiry record. Substitute the WordPress root locally; do not publish private filesystem paths.
WP_ROOT='/absolute/authorized/wordpress/root'
wp --path="$WP_ROOT" plugin get sustainable-catalyst-engagement-intake --field=version
wp --path="$WP_ROOT" eval-file /absolute/private/path/read_only_scheduling_checks.php
# Keep the output restricted if small counts could reveal activity.
The companion PHP uses SC_EI_Database::table() to derive names and emits aggregate counts only. It intentionally does not attempt to call mutating methods, evaluate participant email fields, or run a live Graph health test. Any missing table or class should be treated as a deployment-contract failure, not suppressed.
Symptoms
- A sender sees proposed times without a valid portal invitation or after access revocation.
- A legitimate accepted meeting remains pending because no valid Teams URL is available.
- The stored UTC interval changes unexpectedly across daylight-saving transitions.
- A reminder is marked sent without a matching reviewed outbound communication.
- Cancellation hides the local link but leaves a live remote event, or a cached join URL persists.
- Concurrent staff edits create a conflict or old reminders remain active after rescheduling.
- Internal organizer or attendee details leak through a sender projection, export or cache.
Cause
Classify the first failed invariant: missing consent/authorization; stale portal session; unexpected offer-level transition; invalid civil-time conversion; Teams host or scheme mismatch; row-version conflict; reminder synchronization; Graph queue/reconciliation lag; stale cache; or private-field projection drift. Avoid collapsing these distinct causes into a generic “calendar error.”
Troubleshooting
- Locate the synthetic or authorized inquiry and meeting offer; record the installed release and expected/observed state without copying participant content.
- Verify the inquiry/portal linkage, relevant staff capability, sender session and current consent/withdrawal state.
- Inspect offer status, publication time, expiry and selected slot. A requested inquiry is not necessarily a published offer.
- Run the timezone parser against the same local time and IANA zone, including seasonal transition controls.
- Inspect optimistic
row_versionand history before any attempted reschedule or cancellation. - Compare reminder type, state and linked communication; ensure a background job did not cause a send.
- If Graph is enabled, reconcile the local offer and queued operation by stable transaction ID before any retry or deletion.
- Capture only redacted result codes, action IDs, counts, and timestamp windows; open a narrowly scoped incident for a confidential data exposure.
Resolution
Use the smallest authorized action that restores the contract: correct the role/nonce configuration rather than bypass it; republish a newly approved offer rather than rewriting history; ask for an unambiguous local time rather than guessing an offset; require a real reviewed outbound communication before marking a reminder sent; and reconcile the existing Graph operation instead of creating a second event. Preserve previous UTC values and actor history when compensating after failure. For any confirmed private disclosure, stop the leaking path and invalidate cached content before resuming that route.
Verification
- Identity: installed plugin and schema build match the test baseline, or differences are documented.
- Intake: a public request does not create a meeting offer or publish free/busy data; required calendar consent is enforced for meeting requests.
- Access: anonymous and unrelated sessions cannot read private meeting records; intended portal users see only allowed fields; staff mutations reject missing capability or nonce.
- State: draft, offered, accepted, alternative, finalized, expired, canceled, and completed transitions follow the reviewed guards; invalid/late responses fail.
- Time: one valid time converts correctly; nonexistent and repeated local times fail; duration and ordering are preserved.
- Concurrency: stale row versions fail rather than overwriting a new time.
- Reminders: no automated outbound send; ready-to-sent requires a linked accepted/recorded outbound communication for the same inquiry.
- Graph: no remote event is created without a human trigger; idempotency, join URL reconciliation and remote cancellation are exercised only in isolated staging.
- Privacy: cancellation prevents live link exposure through every sender surface; internal participant and Graph fields are absent from the public projection.
- Evidence: attach test ID, observed result, environment, deployment SHA, redacted supporting record and open exceptions; assign last-verified version only after deployed evidence exists.
Acceptance matrix and release evidence
The package includes a staging_acceptance_matrix.csv with case IDs, prerequisites, expected outcomes, severity, and a NOT RUN state. These tests are intended for staff-controlled staging, not unattended production. Security-critical cases (unauthorized reads, cancellation leak, missing calendar consent, and duplicate Graph creation) block verification if they fail. An independent offline synthetic check does not satisfy deployment acceptance.
Developer evidence
- Pin the source revision and installed plugin artifact digest in each test packet; never use a floating branch as the only source baseline.
- Record the exact WordPress capability and
admin_post_*action exercised; separate protected sender portal operations from public intake. - Attach database schema or migration health for the relevant tables, using aggregate-only evidence in shared reports.
- Retain signed-off, redacted Graph operation metadata and remote organizer event evidence only where approved; never publish credentials, payloads containing attendees, or bearer tokens.
- Maintain version-specific known limitations and release notes. Do not equate passing unit checks with a certification of the deployed Microsoft 365 tenant.
Reporting boundary and limitations
This is an engineering and scientific-verification reference for reproducible contract testing. It does not establish that participant identities are genuine, that every meeting is ethically or legally authorized, or that a successfully synchronized remote event proves delivery to every invitee. No live deployment, human recipient, mailbox, or tenant was tested for this article. Use appropriate privacy review, documented retention rules and a real authorized test environment before operational certification.
Technical references
- Workflow schema and status vocabulary
- Workflow repository: offers, portal responses, finalization
- Calendar repository: reminders, time changes, sender snapshot
- Calendar admin capabilities and confirmation gates
- Teams URL and civil-time parser
- Graph durable operation queue
- Graph administrator controls
- Database tables and migrations
- Plugin version declarations
- Microsoft Teams and Calendar Coordination documentation
- Scheduling Reminder and Time-Zone Reliability documentation
- Microsoft Graph Reliability documentation
- Repository civil-time runtime test
- Repository reminder reliability test
Source scope: Plugin 2.0.2 and source commit 3f246974276a5e582d09f8c48d21628b82626bc7. The source review establishes function names and code-path expectations, not observed installed-system behavior. Separate article integrity scores, offline fixtures, staging acceptance and production verification in publication metadata.
