Skip to content

Update Bottleneck Diagnoses

This workflow records AI-generated bottleneck diagnoses for youth participants and updates their current stage in the system. It serves as a critical data capture mechanism for tracking youth progress and identifying areas where participants may be struggling in their development journey.

Purpose

No business context provided yet — add a context.md to enrich this documentation.

Based on the workflow structure, this appears to be part of a youth development or coaching system that uses AI to identify bottlenecks in a participant's progress and recommend micro-actions for improvement.

How It Works

  1. Receive Diagnosis Data: The workflow is triggered with bottleneck diagnosis information including the youth's current stage, identified bottleneck, AI reasoning, and recommended actions
  2. Record Diagnosis: Inserts a new record into the bottleneck_diagnoses table with all the provided information and a timestamp
  3. Update Youth Profile: Updates the youth's current stage in their profile to reflect their progression

Workflow Diagram

graph TD
    A[updatebottleneckdiagnoses<br/>Execute Workflow Trigger] --> B[Execute a SQL query1<br/>Insert Bottleneck Diagnosis]
    B --> C[Update Youth Stage1<br/>Update Youth Profile]

Trigger

Execute Workflow Trigger - This workflow is designed to be called by other workflows or external systems. It expects the following input parameters:

  • stage - The current stage of the youth participant
  • bottleneck_name - Name/identifier of the identified bottleneck
  • ai_reasoning - AI-generated explanation for why this bottleneck was identified
  • micro_action_recommended - Specific action recommended to address the bottleneck
  • youth_id - Unique identifier for the youth participant
  • session_id - Identifier for the current session or interaction

Nodes Used

Node Type Node Name Purpose
Execute Workflow Trigger updatebottleneckdiagnoses Receives input parameters from calling workflow
Postgres Execute a SQL query1 Inserts bottleneck diagnosis record into database
Postgres Update Youth Stage1 Updates youth profile with current stage

External Services & Credentials Required

PostgreSQL Database

  • Credential Name: "Postgres account 2"
  • Purpose: Stores bottleneck diagnoses and youth profile data
  • Required Permissions: INSERT and UPDATE access to bottleneck_diagnoses and youth_profiles tables

Environment Variables

No environment variables are explicitly used in this workflow. All configuration is handled through the PostgreSQL credential.

Data Flow

Input

The workflow expects these parameters: - stage (string) - Youth's current development stage - bottleneck_name (string) - Identified bottleneck - ai_reasoning (string) - AI explanation for the diagnosis - micro_action_recommended (string) - Recommended action - youth_id (string) - Youth participant identifier - session_id (string) - Session identifier

Output

  • Returns the inserted bottleneck diagnosis record
  • Returns the updated youth profile record
  • Both include database-generated fields like timestamps and IDs

Database Schema Requirements

The workflow assumes these table structures:

bottleneck_diagnoses table: - session_id, youth_id, stage, bottleneck_name, ai_reasoning, micro_action_recommended, diagnosed_at

youth_profiles table: - id, current_stage, updated_at

Error Handling

This workflow does not include explicit error handling nodes. Database errors (such as constraint violations or connection issues) will cause the workflow to fail and should be handled by the calling workflow or monitoring system.

Known Limitations

  • No validation of input parameters before database insertion
  • No error handling for database connection failures
  • No rollback mechanism if the youth profile update fails after diagnosis insertion
  • Assumes youth_id exists in the youth_profiles table

No related workflows are documented in the provided context.

Setup Instructions

  1. Import the Workflow

    • Copy the workflow JSON and import it into your n8n instance
  2. Configure PostgreSQL Credential

    • Create a new PostgreSQL credential named "Postgres account 2"
    • Configure connection details for your database
    • Ensure the credential has INSERT and UPDATE permissions
  3. Database Setup

    • Ensure the bottleneck_diagnoses table exists with the required columns
    • Ensure the youth_profiles table exists with id, current_stage, and updated_at columns
    • Verify foreign key relationships if applicable
  4. Test the Workflow

    • Call the workflow with sample data to verify database connectivity
    • Check that records are properly inserted and updated
  5. Integration

    • Configure other workflows or systems to call this workflow with the required parameters
    • Ensure calling systems handle potential database errors appropriately