triggerCeaAlertTool - Francis¶
This workflow creates CEA (Customer Engagement Alert) records in a database when triggered by other workflows. It logs alert details, updates user engagement status, and provides confirmation output for monitoring and tracking purposes.
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 parameters including phone number, reason, priority, summary, and profit snapshot
- Creates Alert Record: Inserts a new CEA alert into the database with all provided details and sets status to 'open'
- Updates User Status: Flags the corresponding user record with alert timestamp, reason, and engagement status
- Returns Confirmation: Provides a formatted output message confirming the alert creation with key 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 accepts the following input parameters:
- phoneNumber - Customer'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 CEA alert record in database |
| flagUserRecord | PostgreSQL | Updates user engagement status and alert metadata |
| setOutput | Set | Formats confirmation message with alert details |
External Services & Credentials Required¶
- PostgreSQL Database: Requires connection to Supabase PostgreSQL instance
- Credential:
PostgresOnSupabase(ID: Hw9XWerQ5RNHaVTk) - Tables accessed:
ceaAlerts,youthEntrepreneursReal
- Credential:
Environment Variables¶
No environment variables are explicitly used in this workflow. Database connection details are managed through n8n credentials.
Data Flow¶
Input Parameters:
- phoneNumber (string) - Customer identifier
- reason (string) - Alert reason
- priority (string) - Alert priority
- summary (string) - Alert description
- profitSnapshot (JSON) - Profit data snapshot
Database Operations:
- Inserts new record in ceaAlerts table with status 'open'
- Updates youthEntrepreneursReal table with alert timestamp and engagement status
Output: - Formatted confirmation message containing alert ID, phone number, reason, and priority
Error Handling¶
This workflow does not implement explicit error handling. Database operation failures will cause the workflow to stop and return error details 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 Workflow: Import the workflow JSON into your n8n instance
-
Configure Database Credentials:
- Create or verify PostgreSQL credential named "PostgresOnSupabase"
- Ensure connection to Supabase database with 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 Execution:
- Call this workflow from another workflow with sample data
- Verify alert record creation and user status updates
- Check output message format
-
Integration:
- Configure calling workflows to pass required parameters
- Ensure proper error handling in parent workflows