Skip to content

CourseContentAgent

A specialized AI workflow that serves as a Course Content Assistant for Educate! training materials, designed to help mentors access lesson curricula and retrieve specific section content in structured JSON format for educational delivery 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 two key functions: listing available lessons in the curriculum and extracting specific lesson sections in a standardized JSON format. The system is built around "Lesson 6: Leading a Team" content that focuses on win-win solutions in leadership and conflict resolution for student business clubs.

How It Works

  1. Query Reception: The workflow receives a query through the Execute Workflow Trigger, which accepts a "Query" parameter
  2. AI Processing: The query is processed by a specialized AI agent configured with detailed instructions for handling course content
  3. Content Analysis: The agent analyzes the query to determine if it's asking for:
    • A list of available lessons and their section counts
    • Specific section content from a particular lesson
  4. Response Generation: Based on the query type, the agent either provides a curriculum overview or returns structured JSON containing the exact lesson content
  5. 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[Output Response]

    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, not run independently. It expects an input parameter called "Query" that contains the user's request for lesson information or specific content.

Nodes Used

Node Type Purpose
Execute Workflow Trigger Receives queries from parent workflows with a "Query" input parameter
LangChain Agent Processes natural language queries and extracts/formats course content according to specific rules
OpenAI Chat Model Provides the AI language model (GPT-4o-mini) for understanding and responding to content requests

External Services & Credentials Required

  • OpenAI API: Required for the GPT-4o-mini language model
    • Credential name: "OpenAI Assistants API"
    • Needs valid OpenAI API key with access to GPT-4o-mini model

Environment Variables

No specific environment variables are configured in this workflow. All configuration is handled through node parameters and credentials.

Data Flow

Input: - Query (string): Natural language request for lesson information or specific content

Output: - For curriculum queries: Plain text list of lessons with section counts - For content queries: Structured JSON object containing: - sectionNumber: The section identifier number - sectionTitle: The section's title (e.g., "EDU_6_1_10_Lesson_1") - sectionContent: The complete, unmodified section content including formatting markers

Sample Input:

1
"Get Section Content for Lesson 'Leading a Team', Section 2"

Sample Output:

1
2
3
4
5
{
  "sectionNumber": 2,
  "sectionTitle": "EDU_6_1_2_Lesson_1",
  "sectionContent": "Conflict occurs when people have differing opinions, feelings, or goals..."
}

Error Handling

The workflow relies on the AI agent's built-in error handling. No explicit error handling nodes are configured, so errors would propagate back to the calling workflow. The agent is instructed to be strict about output format and not to invent content, which helps prevent data quality issues.

Known Limitations

  • Currently contains only "Lesson 6: Leading a Team" content
  • Designed for a specific content structure with EDU codes
  • Requires exact lesson titles for content retrieval
  • No validation of query format before processing
  • Limited to English language content

This workflow is designed to be called by other workflows but no specific parent workflows are identified in the current configuration. The pinned data suggests it's tested with queries about "Leading a Team" lesson content.

Setup Instructions

  1. Import the Workflow: Import the JSON configuration into your n8n instance

  2. Configure OpenAI Credentials:

    • Create an OpenAI API credential in n8n
    • Name it "OpenAI Assistants API" or update the credential reference
    • Add your OpenAI API key with GPT-4o-mini access
  3. Test the Configuration:

    • Use the pinned test data: {"Query": "Get Section Content for Lesson 'Leading a Team', Section 2"}
    • Verify the agent returns properly formatted JSON
  4. Integration Setup:

    • Call this workflow from parent workflows using the Execute Workflow node
    • Pass queries in the format: {"Query": "your question here"}
    • Handle the returned JSON or text responses in your calling workflow
  5. Content Updates:

    • To add more lessons, update the system message in the "Sub agent" node
    • Follow the existing EDU code structure for consistency
    • Test thoroughly after content changes

The workflow is ready to use once credentials are configured and can be immediately integrated into larger educational content delivery systems.