Hypertext Rails
Documentation
System Documentation
- Heartbeat System
- Performance Metrics System
- Project Auto-Provisioning System
-
Communication Center
- Communication Center ERD
- Automation Workflow Complete Flow - Complete guide covering both scheduled and trigger-based workflows
Quick Links
Communication Center ERD (Entity Relationship Diagram)
Relationships Overview
┌─────────────────────┐
│ AdminUser │
│ (created_by) │
└──────────┬──────────┘
│
│ 1:N
│
┌──────────▼──────────┐ ┌─────────────────────┐
│ CommunicationTemplate│ │ Project │
│ (template_id) │ │ │
└──────────┬───────────┘ └──────────┬──────────┘
│ │
│ 1:N │ 1:N
│ │
┌──────────▼───────────┐ ┌─────────▼──────────┐
│ AutomationWorkflow │ │ StakeholderProject │
│ - template_id │ │ (join table) │
│ - created_by_id │ └─────────┬──────────┘
└──────────┬───────────┘ │
│ │ N:1
│ 1:N │
│ │
┌──────────▼───────────┐ ┌─────────▼──────────┐
│ CommsInstance │ │ Stakeholder │
│ - template_id │ │ │
│ - created_by_id │ │ │
│ - automation_workflow_id│ └──────────┬─────────┘
└──────────┬───────────┘ │
│ │ 1:N
│ 1:N │
│ │
┌──────────▼───────────┐ ┌─────────▼──────────┐
│ CommsDelivery │ │ Persona │
│ - comms_instance_id │ │ │
│ - stakeholder_id │◄─────┤ │
│ - project_id │ └──────────┬─────────┘
└──────────┬───────────┘ │
│ │ 1:1
│ 1:N │
│ │
┌──────────▼───────────┐ ┌─────────▼──────────┐
│ CommsEvent │ │ CadenceRule │
│ - delivery_id │ │ (scope_type='persona')│
└──────────────────────┘ └────────────────────┘
┌─────────────────────┐
│ Project │
└──────────┬──────────┘
│
│ 1:N
│
┌──────────▼───────────┐
│ AlertTrigger │
│ - project_id │
└──────────────────────┘
┌─────────────────────┐ ┌─────────────────────┐
│ Stakeholder │ │ Project │
│ (scope_type) │ │ (scope_type) │
└──────────┬──────────┘ └──────────┬──────────┘
│ │
│ Polymorphic │ Polymorphic
│ (via scope_type/scope_ref) │ (via scope_type/scope_ref)
│ │
└──────────┬─────────────────┘
│
│ N:1
│
┌──────────▼───────────┐
│ CadenceRule │
│ - scope_type │
│ - scope_ref │
│ (stakeholder/project)│
└──────────────────────┘
┌─────────────────────┐
│ Import │
│ (standalone) │
└─────────────────────┘
Detailed Relationships
Parent-Child Relationships
AdminUser (Parent)
- └─> CommunicationTemplate (Child via
created_by_id) - └─> CommsInstance (Child via
created_by_id) - └─> AutomationWorkflow (Child via
created_by_id)
- └─> CommunicationTemplate (Child via
CommunicationTemplate (Parent)
- └─> CommsInstance (Child via
template_id) - └─> AutomationWorkflow (Child via
template_id)
- └─> CommsInstance (Child via
AutomationWorkflow (Parent)
- └─> CommsInstance (Child via
automation_workflow_id)
- └─> CommsInstance (Child via
CommsInstance (Parent)
- └─> CommsDelivery (Child via
comms_instance_id)
- └─> CommsDelivery (Child via
CommsDelivery (Parent)
- └─> CommsEvent (Child via
delivery_id)
- └─> CommsEvent (Child via
Stakeholder (Parent)
- └─> StakeholderProject (Child via
stakeholder_id) - └─> CommsDelivery (Child via
stakeholder_id) - └─> CadenceRule (Child via polymorphic
scope_type='stakeholder')
- └─> StakeholderProject (Child via
Project (Parent)
- └─> StakeholderProject (Child via
project_id) - └─> AlertTrigger (Child via
project_id) - └─> CommsDelivery (Child via
project_id) - └─> CadenceRule (Child via polymorphic
scope_type='project')
- └─> StakeholderProject (Child via
Persona (Parent)
- └─> Stakeholder (Child via
personafield) - └─> CadenceRule (Child via polymorphic
scope_type='persona')
- └─> Stakeholder (Child via
Import (Standalone - no parent/child relationships)
Foreign Key Summary
| Child Table | Foreign Key | Parent Table | Relationship Type |
|---|---|---|---|
comms_instances |
template_id |
communication_templates |
Belongs To |
comms_instances |
created_by_id |
admin_users |
Belongs To |
comms_instances |
automation_workflow_id |
automation_workflows |
Belongs To |
automation_workflows |
template_id |
communication_templates |
Belongs To |
automation_workflows |
created_by_id |
admin_users |
Belongs To |
comms_deliveries |
comms_instance_id |
comms_instances |
Belongs To |
comms_deliveries |
stakeholder_id |
stakeholders |
Belongs To |
comms_deliveries |
project_id |
projects |
Belongs To |
comms_events |
delivery_id |
comms_deliveries |
Belongs To |
stakeholder_projects |
stakeholder_id |
stakeholders |
Belongs To |
stakeholder_projects |
project_id |
projects |
Belongs To |
alert_triggers |
project_id |
projects |
Belongs To |
stakeholders |
persona |
personas (via name) |
Belongs To |
cadence_rules |
scope_ref (polymorphic) |
stakeholders/projects/personas |
Polymorphic |
Notes
- CadenceRule uses a polymorphic relationship via
scope_typeandscope_refinstead of traditional foreign keys. Supported scope types:'persona','stakeholder','project','multi_project' - Import is a standalone table with no foreign key relationships
- StakeholderProject is a join table creating a many-to-many relationship between Stakeholders and Projects
- AutomationWorkflow enables automated communication scheduling and triggering:
- Scheduled workflows: Use
schedule_configJSON field for frequency/time settings, tracked vianext_run_attimestamp - Trigger-based workflows: Use
trigger_configJSON field for trigger events (eventsarray) andlast_trigger_check_attimestamp - Both types can create CommsInstances automatically when conditions are met
- Scheduled workflows: Use
- CommsDelivery can be associated with both a Stakeholder and a Project, allowing project-level delivery tracking
- Persona provides default cadence rules that apply to all stakeholders with that persona, with individual stakeholder overrides possible