CEA Alert Tool - Francis¶
This workflow creates and manages CEA (Customer Engagement Alert) alerts by inserting alert records into the database and updating user engagement status. It serves as a centralized tool for triggering alerts when specific conditions or events require immediate attention from customer engagement teams.
Purpose¶
No business context provided yet — add a context.md to enrich this documentation.
How It Works¶
- Receives Alert Data: The workflow is triggered by another workflow with alert details including phone number, reason, priority, summary, and profit snapshot
- Creates Alert Record: Inserts a new alert into the
ceaAlertsdatabase table with status set to 'open' - Updates User Status: Flags the corresponding user record in
youthEntrepreneursRealtable with alert timestamp, reason, and engagement status - Returns Confirmation: Outputs a formatted message confirming the alert creation with relevant details
Workflow Diagram¶
graph TD
A[When Executed by Another Workflow] --> B[insertCeaAlert]
B --> C[flagUserRecord]
C --> D[setOutput]
Trigger¶
Execute Workflow Trigger: This workflow is designed to be called by other workflows. It expects the following input parameters:
- phoneNumber - Target user's phone number
- reason - Reason for the alert
- priority - Alert priority level
- summary - Brief description of the alert
- profitSnapshot - JSON data containing profit information
Nodes Used¶
| Node Name | Type | Purpose |
|---|---|---|
| When Executed by Another Workflow | Execute Workflow Trigger | Receives input parameters from calling workflow |
| insertCeaAlert | PostgreSQL | Creates new alert record in ceaAlerts table |
| flagUserRecord | PostgreSQL | Updates user record with alert information |
| setOutput | Set | Formats and returns confirmation message |
External Services & Credentials Required¶
- PostgreSQL Database: Requires "PostgresOnSupabase" credential for database operations
- Database must contain
ceaAlertsandyouthEntrepreneursRealtables - Required permissions: INSERT, UPDATE
- Database must contain
Environment Variables¶
No environment variables are used in this workflow.
Data Flow¶
Input¶
1 2 3 4 5 6 7 | |
Output¶
1 2 3 | |
Error Handling¶
This workflow does not implement explicit error handling. Database errors or connection issues will cause the workflow to fail. Consider adding error handling nodes for production use.
Known Limitations¶
- No validation of input parameters
- No error handling for database failures
- Workflow status is currently inactive
- No notification system for created alerts
- Profit snapshot data is stored as-is without validation
Related Workflows¶
No related workflows identified from the current context.
Setup Instructions¶
-
Import Workflow: Import the workflow JSON into your n8n instance
-
Configure Database Credential:
- Create a PostgreSQL credential named "PostgresOnSupabase"
- Configure connection to your Supabase/PostgreSQL instance
- Ensure the credential has INSERT and UPDATE permissions
-
Verify Database Schema:
- Ensure
ceaAlertstable exists with columns: phoneNumber, reason, priority, summary, profitSnapshot, status, id, createdAt - Ensure
youthEntrepreneursRealtable exists with columns: phoneNumber, ceaAlertTimestamp, ceaAlertReason, ceaEngagementStatus
- Ensure
-
Test the Workflow:
- Call from another workflow with required parameters
- Verify alert creation in database
- Check user record updates
-
Activate: Set the workflow to active status when ready for production use
-
Integration: Configure calling workflows to use this workflow for CEA alert creation