Youth Stage¶
A simple workflow that updates a youth participant's current stage in the database. This workflow provides a reusable way to track progression through different stages of a youth program.
Purpose¶
No business context provided yet — add a context.md to enrich this documentation.
How It Works¶
- Receive Input: The workflow accepts two parameters - a youth ID and the new stage value
- Update Database: Executes a SQL UPDATE query to set the youth's current stage and update the timestamp
- Return Result: Returns the updated youth profile record
Workflow Diagram¶
graph TD
A[setYouthStage Trigger] --> B[Update Youth Stage]
B --> C[Updated Record]
Trigger¶
Execute Workflow Trigger - This workflow is designed to be called by other workflows or external systems. It accepts the following inputs:
- youth_id - The unique identifier for the youth participant
- stage - The new stage value to set
Nodes Used¶
| Node Name | Type | Purpose |
|---|---|---|
| setYouthStage | Execute Workflow Trigger | Receives input parameters and starts the workflow |
| Update Youth Stage | PostgreSQL | Updates the youth's current stage in the database |
External Services & Credentials Required¶
- PostgreSQL Database: Requires connection to a Postgres database containing the
youth_profilestable- Credential: "Postgres account 2"
- Database must have a
youth_profilestable with columns:id,current_stage,updated_at
Environment Variables¶
No environment variables are used in this workflow.
Data Flow¶
Input:
1 2 3 4 | |
Output:
Returns the complete updated youth profile record from the database, including all columns from the youth_profiles table.
Error Handling¶
This workflow does not include explicit error handling. Potential failure points:
- Invalid youth_id that doesn't exist in the database
- Database connection issues
- Invalid stage values (depending on database constraints)
Known Limitations¶
- No validation of input parameters
- No error handling for database failures
- Assumes the
youth_profilestable structure exists - No logging of stage changes for audit purposes
Related Workflows¶
No related workflows identified from the current context.
Setup Instructions¶
-
Import the Workflow
- Copy the workflow JSON and import it into your n8n instance
-
Configure Database Connection
- Set up a PostgreSQL credential named "Postgres account 2"
- Ensure the database contains a
youth_profilestable with these columns:id(primary key)current_stage(text/varchar)updated_at(timestamp)
-
Database Schema
1 2 3 4 5 6 7
-- Example table structure (adjust as needed) CREATE TABLE youth_profiles ( id VARCHAR PRIMARY KEY, current_stage VARCHAR, updated_at TIMESTAMP, -- other columns as needed ); -
Test the Workflow
- Call the workflow with test parameters:
1 2 3 4
{ "youth_id": "test-youth-123", "stage": "enrolled" }
- Call the workflow with test parameters:
-
Integration
- Use the "Execute Workflow" node in other workflows to call this one
- Or trigger via n8n's API endpoints for external system integration