CourseContentAgent¶
This workflow provides an AI-powered assistant that serves educational course content for Educate!'s "Leading a Team" lesson. It acts as a specialized content retrieval system that can list available lessons or return specific lesson sections in structured JSON format for integration with learning management systems.
Purpose¶
No business context provided yet — add a context.md to enrich this documentation.
This workflow appears to support educational content delivery by providing programmatic access to course materials. The system can respond to queries about lesson curricula and extract specific lesson sections with precise formatting, making it suitable for integration with chatbots, learning platforms, or content management systems.
How It Works¶
- Query Reception: The workflow receives a query through the Execute Workflow Trigger, which accepts a "Query" parameter
- AI Processing: The query is processed by a specialized AI agent configured with detailed instructions for handling course content
- Content Analysis: The agent analyzes the query to determine if it's asking for:
- A list of available lessons and their section counts
- Specific lesson content in JSON format
- Response Generation: Based on the query type, the agent either provides a lesson overview or extracts the requested section content in strict JSON format
- Output Delivery: The processed response is returned to the calling workflow or system
Workflow Diagram¶
graph TD
A[When Executed by Another Workflow] --> B[Sub agent]
C[OpenAI Chat Model] --> B
B --> D[Response Output]
style A fill:#e1f5fe
style B fill:#f3e5f5
style C fill:#fff3e0
style D fill:#e8f5e8
Trigger¶
Execute Workflow Trigger: This workflow is designed to be called by other workflows rather than running independently. It accepts a single input parameter:
- Query: Text input containing the user's request for lesson information or specific content
Nodes Used¶
| Node Type | Node Name | Purpose |
|---|---|---|
| Execute Workflow Trigger | When Executed by Another Workflow | Receives queries from parent workflows with a "Query" parameter |
| LangChain Agent | Sub agent | Processes queries using AI to extract or list course content according to specific formatting rules |
| OpenAI Chat Model | OpenAI Chat Model | Provides the underlying language model (GPT-4o-mini) for content processing and extraction |
External Services & Credentials Required¶
- OpenAI API: Required for the GPT-4o-mini model
- Credential name: "OpenAI Assistants API"
- Used for natural language processing and content extraction
Environment Variables¶
No environment variables are explicitly configured in this workflow. All configuration is handled through node parameters and credentials.
Data Flow¶
Input:
- Query (string): User request for lesson information or specific content
Processing: - The AI agent analyzes the query against embedded course content for "Lesson 6: Leading a Team" - Determines response type based on query intent - Formats output according to strict rules
Output:
- For curriculum queries: Plain text list of lessons with section counts
- For content queries: JSON object with:
- sectionNumber: Section identifier
- sectionTitle: Section title (e.g., "EDU_6_1_10_Lesson_1")
- sectionContent: Exact section content with preserved formatting
Error Handling¶
No explicit error handling nodes are present in this workflow. Error handling relies on: - n8n's default error propagation to calling workflows - OpenAI API's built-in error responses - The agent's instruction to avoid casual conversation and stick to structured responses
Known Limitations¶
Based on the workflow configuration: - Content is limited to "Lesson 6: Leading a Team" only - Requires exact lesson and section references for content extraction - JSON output format is strictly enforced with no flexibility for alternative formats - No validation of query parameters before processing
Related Workflows¶
This workflow is designed to be called by other workflows but no specific parent workflows are identified in the current configuration.
Setup Instructions¶
-
Import the Workflow
- Import the workflow JSON into your n8n instance
- Ensure the workflow is activated
-
Configure Credentials
- Set up OpenAI API credentials with the name "OpenAI Assistants API"
- Ensure the credential has access to GPT-4o-mini model
-
Test the Workflow
- Use the Execute Workflow node from another workflow
- Pass test queries like:
- "List all available lessons"
- "Get Section Content for Lesson 'Leading a Team', Section 2"
-
Integration
- Call this workflow from parent workflows using the Execute Workflow node
- Pass user queries through the "Query" parameter
- Handle the returned content according to your application needs
-
Customization
- Modify the system message in the Sub agent node to add more lessons
- Adjust the temperature setting (currently 0) if you need more creative responses
- Update the lesson content in the system message as curriculum evolves