Skip to content

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

  1. Receives Input Parameters: The workflow accepts phone number, reason, priority, summary, and profit snapshot data from another workflow
  2. Creates Alert Record: Inserts a new CEA alert into the ceaAlerts database table with status "open"
  3. Updates User Record: Flags the corresponding user in youthEntrepreneursReal table with alert timestamp, reason, and engagement status
  4. 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:
    • ceaAlerts table
    • youthEntrepreneursReal table

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 number
  • reason (string): Reason for creating the alert
  • priority (string): Priority level of the alert
  • summary (string): Summary description
  • profitSnapshot (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.

No related workflows specified in the current context.

Setup Instructions

  1. Import the Workflow

    • Copy the workflow JSON
    • Import into your n8n instance
  2. 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
  3. Verify Database Schema

    • Ensure ceaAlerts table exists with columns: phoneNumber, reason, priority, summary, profitSnapshot, status, id, createdAt
    • Ensure youthEntrepreneursReal table exists with columns: phoneNumber, ceaAlertTimestamp, ceaAlertReason, ceaEngagementStatus
  4. Test the Workflow

    • Execute from another workflow with sample data
    • Verify alert creation and user record updates
    • Check output message format
  5. Integration

    • Call this workflow from other workflows using the "Execute Workflow" node
    • Pass required parameters: phoneNumber, reason, priority, summary, profitSnapshot