Configure Scenario Rules for Automated Peer Mentor Follow-up
HLF's survey found that 40% of peer mentors were unsatisfied with follow-up quality. Coordinators need a configuration interface to set up automated scenario rules — for example, 'send a prompt if no activity is logged in 14 days', or 'notify if certification expires in 30 days'. Each scenario rule includes a trigger condition, a notification message template, a delivery channel (push), and optional deep-link routing to the relevant action screen. The scenario configuration screen allows creating, editing, enabling, and disabling rules without requiring developer intervention.
User Story
Acceptance Criteria
- Given I am logged in as a coordinator, when I navigate to the scenario configuration screen, then I see a list of all existing scenario rules with their active/inactive status
- Given I create a new scenario rule, when I define a trigger condition (e.g., inactivity threshold in days), message content, and target role, then the rule is saved and the scheduler is updated to evaluate it on the next cycle
- Given a scenario rule is active, when the evaluation edge function runs and the condition is met for a peer mentor, then a push notification is dispatched to that mentor within the configured delivery window
- Given I disable a scenario rule, when the scheduler runs, then no notifications are sent for that rule and existing queued notifications for it are cancelled
- Given I edit an existing rule's trigger threshold, when I save the change, then future evaluations use the updated threshold immediately
Business Value
Automates the most labor-intensive part of peer mentor oversight. With 40% of HLF mentors reporting insufficient follow-up, scenario-driven prompts ensure consistent, timely outreach at scale without requiring coordinators to manually track each mentor's status. This directly improves mentor retention, compliance with organizational standards, and the quality of peer support services delivered to end beneficiaries.
Components
- Scenario Configuration Screen ui
- Scenario Rule Engine service
- Scenario Prompt Scheduler Service service
- Scenario Configuration Manager service
- Scenario Rule Repository data
- Scenario Evaluation Edge Function infrastructure
- Push Notification Dispatcher infrastructure
- Scenario Evaluation Configuration infrastructure
- Scenario Edge Function Scheduler infrastructure