Message Templates Workflow¶
This workflow serves as a message template database and AI-powered message generator for the Sifa business coaching chatbot. It stores comprehensive message templates for different phases of youth entrepreneur coaching and uses AI to generate contextually appropriate responses based on conversation context and business data.
Purpose¶
No business context provided yet — add a context.md to enrich this documentation.
How It Works¶
- Template Storage: The workflow maintains a comprehensive database of message templates for the Sifa coaching program, covering onboarding, daily profit tracking, credit recovery, and weekly reporting phases
- Context Processing: When triggered, it receives conversation context and instructions about what type of message is needed
- AI Generation: An AI agent analyzes the context against the template library to generate appropriate responses
- Message Adaptation: The AI adapts templates to match the youth's tone, language (Sheng/Swahili/English mix), and current situation
- Output Formatting: Returns a contextually appropriate message that follows Sifa's communication guidelines
Mermaid Diagram¶
graph TD
A[Execute Workflow Trigger] --> B[Template Database]
B --> C[AI Agent]
D[OpenRouter Chat Model] --> C
C --> E[Edit Fields]
A -.->|instructions| B
B -.->|message templates| C
C -.->|generated message| E
E -.->|formatted output| F[Return Result]
Trigger¶
This workflow is triggered by other workflows in the Sifa system via the Execute Workflow Trigger node. It expects an instructions parameter containing conversation context and requirements for message generation.
Nodes Used¶
| Node Type | Purpose |
|---|---|
| Execute Workflow Trigger | Receives instructions and context from calling workflows |
| Set (Template Database) | Stores comprehensive message templates for all coaching phases |
| AI Agent | Processes context and generates appropriate messages using templates |
| OpenRouter Chat Model | Provides GPT-5.3 language model capabilities for message generation |
| Set (Edit Fields) | Formats the final output for return to calling workflow |
External Services & Credentials Required¶
- OpenRouter API: Provides access to GPT-5.3 chat model for AI message generation
- Credential:
openRouterApi(ID: G93R2GMN2KkJcfuP) - Required for: AI-powered message adaptation and generation
- Credential:
Environment Variables¶
No environment variables are directly used in this workflow. All configuration is handled through the OpenRouter API credentials.
Data Flow¶
Input:
- instructions: Conversation context, youth data, and message generation requirements
Processing: - Template database provides structured message templates for different coaching phases - AI agent analyzes context against templates to determine appropriate response - Message is adapted for tone, language, and specific situation
Output:
- output: Generated message text ready for delivery to youth entrepreneur
Error Handling¶
The workflow relies on the AI agent's built-in error handling. If the AI cannot generate an appropriate response, it will fall back to basic template structures. No explicit error handling nodes are present in the current implementation.
Known Limitations¶
Based on the template structure, this workflow has several built-in constraints: - Messages are limited to 2-minute reading time maximum - Specific tone requirements (Sheng language mix, no shaming, encouraging) - Template adherence varies by phase (exact reproduction vs. adaptive generation) - Requires proper context formatting from calling workflows
Related Workflows¶
This workflow is designed to be called by other workflows in the Sifa coaching system, particularly those handling: - Daily profit tracking interactions - Credit recovery conversations - Weekly reporting generation - Youth onboarding processes
Setup Instructions¶
- Import Workflow: Import the JSON into your n8n instance
- Configure Credentials:
- Set up OpenRouter API credentials with access to GPT-5.3
- Ensure the credential ID matches
G93R2GMN2KkJcfuPor update the node configuration
- Template Customization:
- Review the message templates in the first Set node
- Adapt templates for your specific coaching program if needed
- Ensure variable placeholders match your data structure
- AI Agent Configuration:
- Verify the system message aligns with your coaching methodology
- Adjust tone and style guidelines as needed
- Testing:
- Test with sample instructions to verify message generation
- Validate that generated messages match expected tone and content
- Integration:
- Update calling workflows to use this workflow's ID
- Ensure proper instruction formatting for optimal results