PROTOCOL ENGINE v1.0

Messaging protocols for health interventions

Design branching message sequences, schedule timezone-aware delivery, and monitor queue health — built for research teams running intervention studies at scale.

protocol_v11.yaml
# V11 Quit-Smoking Protocol
protocol:
  name: "QuitTxt 2025"
  nodes: 1,024
  templates: 2,048 (en/es)

flow:
  entry  daily_checkin
  daily_checkin  on_track | response == "good"
  daily_checkin  slip_support | response == "slip"
  daily_checkin  helpnow | response == "help"
  daily_checkin  timeout_nudge | no_response 24h

delivery:
  channels: [sms, push]
  window: 08:00–20:00 participant_tz
  retry: exponential(max=8)
About Cadence

A complete platform for automated health messaging

Cadence is a messaging protocol management system designed for research teams running behavioral health intervention studies. It handles the full lifecycle — from designing branching message protocols to delivering SMS and push notifications on personalized schedules.

Built on the V11 protocol specification used in quit-smoking interventions, Cadence supports complex conditional flows, bilingual templates, timezone-aware scheduling, and real-time monitoring of message delivery across thousands of participants.

Visual Protocol Editor

Drag-and-drop graph editor for building branching message flows with conditional edges and variable-based routing.

Participant-Centric Delivery

Each participant gets messages in their timezone, preferred language, and on their chosen channel — with automatic fallback.

Research-Grade Security

HIPAA-conscious design with AES-256 encryption, role-based access, and full audit trails on every interaction.

Message Lifecycle

From protocol definition to delivery

01

Define

Build node graph with message templates, conditions, and branching paths

02

Enroll

Add participants with timezone, language preference, and channel settings

03

Schedule

Engine evaluates protocol state and queues messages within delivery windows

04

Deliver

Messages sent via SMS/push with retry logic, receipts, and failure handling

Capabilities

Technical specifications

Protocol Engine

V11 branching protocol with conditional paths

  • Node types: message, check-in, escalation, checkout
  • Edge conditions: timeout, response, variable match
  • Session state persisted in Redis (sub-ms lookup)
  • Bilingual templates with variable interpolation
Scheduler

Timezone-aware delivery with retry logic

  • Configurable delivery windows per participant
  • Exponential backoff: up to 8 retries
  • Batch processing: 100 messages per cycle
  • Oldest-pending monitoring with auto-requeue
Delivery

Multi-channel with automatic fallback

  • SMS via Twilio (primary channel)
  • Push notifications via Firebase FCM
  • Channel fallback on delivery failure
  • Per-message delivery receipts and status tracking
Participants

Cohort management with full audit trails

  • Bulk enrollment via API or admin dashboard
  • Protocol stage tracking per participant
  • HELPNOW escalation and SLIP detection
  • Withdrawal and suspension workflows
Security

Research-grade data protection

  • JWT auth with HttpOnly secure cookies
  • API key isolation (timing-safe comparison)
  • AES-256 PII encryption at rest
  • Role-based access: admin, researcher, observer
Analytics

Real-time queue health and delivery metrics

  • Sent / pending / failed / in-progress counters
  • Per-project and global scheduler dashboards
  • Message latency tracking (oldest pending)
  • Exportable delivery logs for analysis
Architecture

System overview

CLIENT
Next.js 14 (App Router)React Flow graph editorZustand state
API
FastAPI + async/await~70 REST endpointsSlowAPI rate limiting
DATA
PostgreSQL (19 models)Redis (sessions + cache)Alembic migrations
DELIVERY
Background workerTwilio SMSFirebase FCM push
REST API — Key Endpoints
METHODENDPOINT
POST
/v1/auth/login

Authenticate and set cookie

GET
/v1/projects

List all projects

POST
/v1/projects/:id/nodes

Create protocol node

POST
/v1/protocol/session/start

Start participant session

POST
/v1/protocol/session/respond

Process participant response

GET
/v1/scheduler/health

Queue health metrics

~70 endpoints total · OpenAPI spec at /docs

19

Database models

SQLAlchemy ORM

~70

API endpoints

FastAPI async

1,024

Protocol nodes

V11 full import

2,048

Message templates

en/es bilingual

Ready to manage your messaging protocols?

Sign in to access the admin dashboard, design protocols, enroll participants, and monitor delivery in real time.

Go to Dashboard