CEA Alert Tool - Francis¶
This workflow creates Customer Engagement Alerts (CEA) by inserting alert records into a 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 Input Parameters: The workflow accepts phone number, reason, priority, summary, and profit snapshot data from another workflow
- Creates Alert Record: Inserts a new CEA alert into the
ceaAlertsdatabase table with status "open" - Updates User Record: Flags the corresponding user 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, not triggered directly. It expects the following input parameters:
- phoneNumber: User's phone number
- reason: Reason for the alert
- priority: Alert priority level
- summary: Alert summary description
- 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¶
- Credential Name: PostgresOnSupabase
- Required Access: Read/write permissions to:
ceaAlertstableyouthEntrepreneursRealtable
Environment Variables¶
No environment variables are directly referenced in this workflow. All configuration is handled through the PostgreSQL credential.
Data Flow¶
Input¶
phoneNumber(string): User's phone numberreason(string): Reason for creating the alertpriority(string): Priority level of the alertsummary(string): Summary descriptionprofitSnapshot(JSON): Profit-related data snapshot
Output¶
output(string): Confirmation message including alert ID, phone number, reason, and priority
Database Changes¶
- ceaAlerts table: New record with status "open"
- youthEntrepreneursReal table: Updated with alert timestamp, reason, and engagement status "alerted"
Error Handling¶
This workflow does not include explicit error handling nodes. Database operation failures will cause the workflow to stop and return error information from the PostgreSQL nodes.
Known Limitations¶
No specific limitations documented in the business context.
Related Workflows¶
No related workflows specified in the current context.
Setup Instructions¶
-
Import the Workflow
- Copy the workflow JSON
- Import into your n8n instance
-
Configure PostgreSQL Credential
- Create a new PostgreSQL credential named "PostgresOnSupabase"
- Configure connection to your Supabase/PostgreSQL database
- Ensure the credential has access to both required tables
-
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
- Execute from another workflow with sample data
- Verify alert creation and user record updates
- Check output message format
-
Integration
- Call this workflow from other workflows using the "Execute Workflow" node
- Pass required parameters: phoneNumber, reason, priority, summary, profitSnapshot