π Generate student course schedules based on prerequisites with GPT and Google Sheets
β‘ 616 views Β· π Project Management
Description
Create a Fall 2025 course schedule for each student based on what theyβve already completed, catalog prerequisites, and term availability (Fall/Both). Reads students from Google Sheets β asks an AI agent to select exactly 5 courses (target 15β17 credits, no duplicates, prereqs enforced) β appends each studentβs schedule to a schedule tab.
π§ Summary
- Trigger: Manual β βWhen clicking βExecute workflowββ
- I/O: Google Sheets in β OpenAI decisioning β Google Sheets out
- Ideal for: Registrars, advisors, degree-planning prototypes
β What this template does
- Reads:
StudentID, Name, Program, Year, CompletedCourses(pipe-separated CourseIDs) from Sheet1 - Decides: AI Scheduling Agent chooses 5 courses per student following catalog rules and prerequisites
- Writes: Appends
StudentID+Schedulestrings to schedule worksheet - Credits target: 15β17 total per term
- Catalog rules (enforced in the agent prompt):
- Use Fall or Both courses for Fall 2025
- Enforce AND prereqs (e.g.,
CS-102|CS-103means both) - Priority: Major Core β Major Elective β Gen Ed (include Gen Ed if needed)
- No duplicates or already-completed courses
- Prefer 200-level progression when prereqs allow
βοΈ Setup (only 2 steps)
1) Connect Google Sheets (OAuth2)
- In n8n β Credentials β New β Google Sheets (OAuth2), sign in and grant access
- In the Google Sheets nodes, select your spreadsheet and these tabs:
- Sheet1 (input students)
- schedule (output)
> Example spreadsheet (replace with your own):
> - Input: .../edit#gid=0
> - Output: .../edit#gid=572766543
2) Connect OpenAI (API Key)
- In n8n β Credentials β New β OpenAI API, paste your key
- In the OpenAI Chat Model node, select that credential and a chat model (e.g.,
gpt-4o)
π₯ Required input (Sheet1)
- Columns:
StudentID,Name,Program,Year,CompletedCourses - CompletedCourses: pipe-separated IDs (e.g.,
GEN-101|GEN-103|CS-101) - Program names should match those referenced in the embedded catalog (e.g., Computer Science BS, Business Administration BBA, etc.)
π€ Output (schedule tab)
- Columns:
StudentIDScheduleβ a selected course string (written one row per course after splitting)
π§© Nodes in this template
- Manual Trigger β Get Student Data (Google Sheets) β Scheduling Agent (OpenAI)
β Split Schedule β Set Fields β Clear sheet β Append Schedule (Google Sheets)
π Configuration tips
- If you rename tabs, update both Get Student Data and Append Schedule nodes
- Keep
CompletedCoursesconsistent (use|as the delimiter) - To store rationale as well, add a column to the output and map it from the agentβs JSON
π§ͺ Test quickly
- Add 2β3 sample student rows with realistic
CompletedCourses - Run the workflow and verify:
- 5 course rows per student in schedule
- Course IDs respect prereqs & Fall/Both availability
- Credits sum ~15β17
π§― Troubleshooting
- Sheets OAuth error: Reconnect βGoogle Sheets (OAuth2)β and re-select the spreadsheet & tabs
- Empty schedules: Ensure
CompletedCoursesuses|and that programs/courses align with the provided catalog names - Prereq violations: Check that students actually have all AND-prereqs in
CompletedCourses - OpenAI errors (401/429): Verify API key, billing, and rate-limit β retry with lower concurrency
π Privacy & data handling
- Student rows are sent to OpenAI for decisioning. Remove or mask any fields you donβt want shared.
- Google Sheets retains input/output. Use spreadsheet sharing controls to limit access.
πΈ Cost & performance
- OpenAI: Billed per token; cost scales with student count and prompt size
- Google Sheets: Free within normal usage limits
- Runtime: Typically seconds to a minute depending on rows and rate limits
π§± Limitations & assumptions
- Works for Fall 2025 only (as written). For Spring, update availability rules in the agent prompt
- Assumes catalog in the agent system message is your source of truth
- Assumes Program names match catalog variants (case/spacing matter for clarity)
π§© Customization ideas
- Add a Max Credits column to cap term credits per student
- Include Rationale in the sheet for advisor review
- Add a βGen Ed needed?β flag per student to force at least one Gen Ed selection
- Export to PDF or email the schedules to advisors/students
π§Ύ Version & maintenance
- n8n version: Tested on recent n8n Cloud builds (2025)
- Community nodes: Not required
- Maintenance: Update the embedded catalog and offerings each term; keep prerequisites accurate
π Tags & category
- Category: Education / Student Information Systems
- Tags: scheduling, registrar, google-sheets, openai, prerequisites, degree-planning, catalog, fall-term
π Changelog
- v1.0.0 β Initial release: Sheets in/out, Fall 2025 catalog rules, prereq enforcement, 5-course selection, credits target
π¬ Contact
Need help customizing this (e.g., cohort logic, program-specific rules, adding rationale to the sheet, or emailing PDFs)?
- π§ rbreen@ynteractive.com
- π Robert Breen β https://www.linkedin.com/in/robert-breen-29429625/
- π ynteractive.com β https://ynteractive.com
π Nodes Used
Google Sheets, AI Agent, OpenAI Chat Model, Structured Output Parser
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File