Skip to content

Update Bottleneck and Diagnoses

This workflow records AI-diagnosed bottlenecks and recommended micro-actions for youth participants in coaching sessions. It serves as a data persistence layer that captures diagnostic insights and actionable recommendations to help track progress and intervention effectiveness.

Purpose

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

Based on the workflow structure and data fields, this appears to support a youth coaching or mentorship program where AI analysis identifies specific bottlenecks (like "Fear of Starting") that participants face at different stages of their journey. The workflow captures these diagnoses along with tailored micro-actions to help youth overcome obstacles.

How It Works

  1. Receives diagnostic data from another workflow containing youth session analysis
  2. Validates required inputs including youth ID, session ID, stage, bottleneck identification, and AI reasoning
  3. Inserts a new record into the bottleneck_diagnoses database table with timestamp
  4. Stores the complete diagnosis including the recommended micro-action for follow-up

Workflow Diagram

graph TD
    A[When Executed by Another Workflow] --> B[Insert rows in a table]

    A --> |youth_id, session_id, stage, bottleneck_name, confidence, ai_reasoning, micro_action_recommended| B
    B --> |Database Record| C[(bottleneck_diagnoses table)]

Trigger

Execute Workflow Trigger: This workflow is called by other workflows and expects the following inputs: - stage - The current stage identifier (e.g., "S3") - bottleneck name - Identified bottleneck (e.g., "Fear of Starting") - confidence - AI confidence level in the diagnosis - ai_reasoning - Explanation of why this bottleneck was identified - micro_action_recommended - Specific actionable step suggested - youth id - Unique identifier for the participant - session id - Unique identifier for the coaching session

Nodes Used

Node Type Node Name Purpose
Execute Workflow Trigger When Executed by Another Workflow Receives diagnostic data from calling workflows
Postgres Insert rows in a table Persists the bottleneck diagnosis to the database

External Services & Credentials Required

Database

  • PostgreSQL Database: Stores bottleneck diagnoses and recommendations
  • Required Credential: Postgres account 2 - Database connection with write access to the bottleneck_diagnoses table

Environment Variables

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

Data Flow

Input Data

1
2
3
4
5
6
7
8
9
{
  "youth_id": "76651100-8328-43e0-956c-dc295fbe3763",
  "session_id": "cb77c700-4052-4391-ac3b-fd0bb38dc35f", 
  "stage": "S3",
  "bottleneck_name": "Fear of Starting",
  "confidence": "high",
  "ai_reasoning": "The youth repeatedly says they are not ready...",
  "micro_action_recommended": "Ask one person in your household..."
}

Output Data

The workflow inserts a record into the bottleneck_diagnoses table with these fields: - session_id - Links to the coaching session - youth_id - Links to the participant - stage - Current program stage - bottleneck_name - Identified obstacle - ai_reasoning - Diagnostic explanation - micro_action_recommended - Suggested next step - diagnosed_at - Timestamp of when the diagnosis was recorded

Error Handling

This workflow uses basic n8n error handling. If the database insert fails, the workflow will stop and report an error. No custom error handling or retry logic is implemented.

Known Limitations

  • No validation of input data format or required fields beyond database constraints
  • No duplicate detection - multiple diagnoses for the same session/youth combination are allowed
  • No rollback mechanism if the database operation fails
  • Relies entirely on the calling workflow to provide clean, validated data

This workflow is designed to be called by other workflows that perform AI analysis of coaching sessions. Look for workflows that: - Analyze session transcripts or notes - Perform bottleneck identification - Generate micro-action recommendations

Setup Instructions

  1. Import the workflow into your n8n instance
  2. Configure PostgreSQL credentials:
    • Create a new PostgreSQL credential named "Postgres account 2"
    • Ensure the database contains a bottleneck_diagnoses table with the required schema
  3. Verify database schema:
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    CREATE TABLE bottleneck_diagnoses (
      id SERIAL PRIMARY KEY,
      session_id VARCHAR NOT NULL,
      youth_id VARCHAR NOT NULL,
      stage VARCHAR NOT NULL,
      bottleneck_name VARCHAR NOT NULL,
      ai_reasoning TEXT NOT NULL,
      micro_action_recommended TEXT,
      diagnosed_at TIMESTAMP DEFAULT NOW()
    );
    
  4. Test the workflow by calling it from another workflow with sample data
  5. Activate the workflow to make it available for execution by other workflows

The workflow is ready to use once the database connection is established and the calling workflows are configured to pass the required input parameters.