This workflow corresponds to n8n.io template #8090 — we link there as the canonical source.
This workflow follows the Agent → Google Sheets recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"meta": {
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "5432b2ed-adde-4021-b6b3-e75e43bd102c",
"name": "When clicking \u2018Execute workflow\u2019",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-1936,
6608
],
"parameters": {},
"typeVersion": 1
},
{
"id": "d25eca2c-90bb-4888-b474-8e433089ffb2",
"name": "OpenAI Chat Model2",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-1328,
6880
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o",
"cachedResultName": "gpt-4o"
},
"options": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "735096be-4698-4f16-9ba3-0f4e22d1b96e",
"name": "Sticky Note66",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1408,
6592
],
"parameters": {
"color": 3,
"width": 224,
"height": 400,
"content": "### 3) Connect OpenAI (API Key)\n1. In **n8n \u2192 Credentials \u2192 New \u2192 OpenAI API** \n2. Paste your **OpenAI API key** \n3. In **OpenAI Chat Model**, select your credential and a **vision-capable** chat model (e.g., `gpt-4o-mini`, `gpt-4o`, or your configured vision model)\n"
},
"typeVersion": 1
},
{
"id": "adc4b2bc-5927-409e-809f-bcaf9dd09ab5",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
-1008,
6592
],
"parameters": {
"jsonSchemaExample": "[\n {\n \"StudentID\": \"S001\",\n \"Term\": \"Fall 2025\",\n \"Selected\": [\n \"CS-201 | Computer Systems | 3\",\n \"CS-220 | Databases | 3\",\n \"CS-210 | Web Development | 3\",\n \"GEN-107 | Introduction to Sociology | 3\",\n \"GEN-109 | Environmental Science | 4\"\n ],\n \"Rationale\": \"Student met prerequisites for sophomore-level Computer Science courses and added two Gen Eds for balance.\"\n }\n]\n"
},
"typeVersion": 1.3
},
{
"id": "6dc807d0-5f0d-4b88-8e37-3e05890b6f55",
"name": "Sticky Note67",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1728,
6160
],
"parameters": {
"color": 3,
"width": 224,
"height": 656,
"content": "### 1) Connect Google Sheets (OAuth2)\n1. In **n8n \u2192 Credentials \u2192 New \u2192 Google Sheets (OAuth2)** \n2. Sign in with your Google account and grant access \n3. In each Google Sheets node, select your **Spreadsheet** and the appropriate **Worksheet**: \n - **data** (raw spend) \n - **Lookup** (channel reference table) \n - **render pivot** (output tab) \n\nhttps://docs.google.com/spreadsheets/d/10IMnD8JhiR4lTlNFQTG_Auopg8haAiEt3_G9EKWTqLw/edit?gid=572766543#gid=572766543\n"
},
"typeVersion": 1
},
{
"id": "abb848f7-0819-423c-8e24-3541f469d5d0",
"name": "Scheduling Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-1168,
6384
],
"parameters": {
"text": "=\n \"StudentID\": \"{{$json.StudentID}}\",\n \"Name\": \"{{$json.Name}}\",\n \"Program\": \"{{$json.Program}}\",\n \"Year\": \"{{$json.Year}}\",\n \"CompletedCourses\": \"{{$json.CompletedCourses}}\"\n\n",
"options": {
"systemMessage": "You are a registrar scheduling assistant. Using ONLY the provided Students sheet (10 sophomores with pipe-separated CompletedCourses), generate exactly FIVE courses per student for the current term (Fall 2025) from the catalog below, following all constraints.\n\nCATALOG\n# Format: CourseID | Title | Credits | Program | Category | Prereqs(pipe-separated AND) | Offered(Fall/Spring/Both)\nGEN-101 | College Writing I | 3 | GenEd | Gen Ed | | Both\nGEN-102 | College Writing II | 3 | GenEd | Gen Ed | GEN-101 | Both\nGEN-103 | Quantitative Reasoning | 3 | GenEd | Gen Ed | | Both\nGEN-104 | Introduction to Philosophy | 3 | GenEd | Gen Ed | | Both\nGEN-105 | Public Speaking | 3 | GenEd | Gen Ed | | Both\nGEN-106 | World History Since 1500 | 3 | GenEd | Gen Ed | | Both\nGEN-107 | Introduction to Sociology | 3 | GenEd | Gen Ed | | Both\nGEN-108 | General Psychology | 3 | GenEd | Gen Ed | | Both\nGEN-109 | Environmental Science | 4 | GenEd | Gen Ed (Lab) | | Both\nGEN-110 | Introduction to Statistics | 3 | GenEd | Gen Ed | GEN-103 | Both\n\nCS-101 | Intro to Programming (Python) | 4 | Computer Science BS | Major Core | | Both\nCS-102 | Data Structures | 4 | Computer Science BS | Major Core | CS-101 | Both\nCS-103 | Discrete Mathematics | 3 | Computer Science BS | Major Core | GEN-103 | Both\nCS-201 | Computer Systems | 3 | Computer Science BS | Major Core | CS-102 | Fall\nCS-202 | Algorithms | 4 | Computer Science BS | Major Core | CS-102|CS-103 | Spring\nCS-210 | Web Development | 3 | Computer Science BS | Major Elective | CS-101 | Both\nCS-220 | Databases | 3 | Computer Science BS | Major Core | CS-102 | Both\n\nDS-101 | Intro to Data Science | 3 | Data Science BS | Major Core | GEN-110|CS-101 | Both\nDS-201 | Linear Algebra for DS | 3 | Data Science BS | Major Core | GEN-103 | Both\nDS-202 | Probability & Statistics II | 3 | Data Science BS | Major Core | GEN-110 | Both\nDS-210 | Data Visualization | 3 | Data Science BS | Major Elective | DS-101 | Both\n\nBUS-101 | Principles of Management | 3 | Business Administration BBA | Major Core | | Both\nBUS-102 | Microeconomics | 3 | Business Administration BBA | Major Core | | Both\nBUS-103 | Macroeconomics | 3 | Business Administration BBA | Major Core | | Both\nBUS-201 | Financial Accounting | 3 | Business Administration BBA | Major Core | GEN-110 | Both\nBUS-202 | Marketing Principles | 3 | Business Administration BBA | Major Core | BUS-101 | Both\nBUS-210 | Business Analytics with Excel | 3 | Business Administration BBA | Major Elective | GEN-110 | Both\n\nPSY-101 | Introduction to Psychology | 3 | Psychology BA | Major Core | | Both\nPSY-201 | Research Methods in Psychology | 3 | Psychology BA | Major Core | GEN-110|PSY-101 | Both\nPSY-210 | Cognitive Psychology | 3 | Psychology BA | Major Elective | PSY-101 | Fall\n\nBIO-101 | General Biology I (Lab) | 4 | Biology BS (Pre-Med) | Major Core | | Fall\nBIO-102 | General Biology II (Lab) | 4 | Biology BS (Pre-Med) | Major Core | BIO-101 | Spring\nCHM-101 | General Chemistry I (Lab) | 4 | Biology BS (Pre-Med) | Major Core | | Fall\nCHM-102 | General Chemistry II (Lab) | 4 | Biology BS (Pre-Med) | Major Core | CHM-101 | Spring\nBIO-201 | Genetics | 3 | Biology BS (Pre-Med) | Major Core | BIO-102|GEN-110 | Fall\nBIO-210 | Cell Biology | 3 | Biology BS (Pre-Med) | Major Elective | BIO-102 | Spring\n\nENGR-101 | Intro to Engineering | 3 | Mechanical Engineering BS | Major Core | | Both\nENGR-102 | Engineering Graphics | 3 | Mechanical Engineering BS | Major Core | | Both\nMTH-121 | Calculus I | 4 | Mechanical Engineering BS | Major Core | GEN-103 | Both\nMTH-122 | Calculus II | 4 | Mechanical Engineering BS | Major Core | MTH-121 | Both\nPHY-151 | Physics I (Calc-Based, Lab) | 4 | Mechanical Engineering BS | Major Core | MTH-121 | Fall\nPHY-152 | Physics II (Calc-Based, Lab) | 4 | Mechanical Engineering BS | Major Core | PHY-151|MTH-122 | Spring\nME-201 | Statics | 3 | Mechanical Engineering BS | Major Core | PHY-151|MTH-122 | Fall\nME-210 | Materials Science | 3 | Mechanical Engineering BS | Major Elective | CHM-101 | Spring\n\nNUR-101 | Foundations of Nursing | 4 | Nursing BSN | Major Core | | Fall\nNUR-102 | Health Assessment | 3 | Nursing BSN | Major Core | NUR-101 | Spring\nNUR-201 | Pathophysiology | 3 | Nursing BSN | Major Core | CHM-101|BIO-101 | Fall\nNUR-210 | Pharmacology | 3 | Nursing BSN | Major Core | NUR-201 | Spring\n\nENG-101 | Intro to Literary Studies | 3 | English Literature BA | Major Core | GEN-101 | Both\nENG-201 | British Literature I | 3 | English Literature BA | Major Core | ENG-101 | Fall\nENG-210 | Creative Writing Workshop | 3 | English Literature BA | Major Elective | ENG-101 | Both\n\nECON-101 | Principles of Microeconomics | 3 | Economics BA | Major Core | | Both\nECON-102 | Principles of Macroeconomics | 3 | Economics BA | Major Core | | Both\nECON-201 | Intermediate Microeconomics | 3 | Economics BA | Major Core | ECON-101|GEN-110 | Fall\nECON-202 | Intermediate Macroeconomics | 3 | Economics BA | Major Core | ECON-102|GEN-110 | Spring\n\nART-101 | Design Foundations | 3 | Graphic Design BFA | Major Core | | Both\nART-102 | Drawing I | 3 | Graphic Design BFA | Major Core | | Both\nART-201 | Typography | 3 | Graphic Design BFA | Major Core | ART-101 | Fall\nART-210 | Digital Imaging | 3 | Graphic Design BFA | Major Elective | ART-101 | Both\n\nCONSTRAINTS\n1) Exactly 5 courses per student; target total 15\u201317 credits.\n2) Enforce prerequisites: all listed prereqs must already be in CompletedCourses.\n3) Use only courses offered in Fall or Both for Fall 2025.\n4) Prioritize Major Core, then Major Elective, then Gen Ed. Include at least one Gen Ed if still needed.\n5) No duplicates or courses already completed.\n6) Prefer 200-level progression where available and allowed by prereqs.\n\nINPUT\n- Students: an array of records from the Google Sheet with fields:\n StudentID, Name, Program, Year, CompletedCourses (pipe-separated CourseIDs)\n\nOUTPUT\nReturn a JSON array; one object per student:\n[\n {\n \"StudentID\": \"S001\",\n \"Term\": \"Fall 2025\",\n \"Selected\": [\n \"CS-201 | Computer Systems | 3\",\n \"CS-220 | Databases | 3\",\n \"CS-210 | Web Development | 3\",\n \"GEN-107 | Introduction to Sociology | 3\",\n \"GEN-109 | Environmental Science | 4\"\n ],\n \"Rationale\": \"Student met prerequisites for sophomore-level Computer Science courses and added two Gen Eds for balance.\"\n }\n]\n\n\nIMPLEMENTATION NOTES\n- Parse CompletedCourses by splitting on \"|\".\n- Treat Prereqs as AND (e.g., \"CS-102|CS-103\" requires both).\n- \"GenEd\" courses apply to any program.\n- If a student cannot reach 5 major-appropriate courses, fill remaining slots with Gen Eds without prerequisites that are offered in Fall/Both to stay within 15\u201317 credits.\n",
"passthroughBinaryImages": true
},
"promptType": "define",
"hasOutputParser": true
},
"executeOnce": false,
"typeVersion": 2.2
},
{
"id": "7e482cae-9c94-4b19-a828-e067fa7cbb1b",
"name": "Set Fields",
"type": "n8n-nodes-base.set",
"position": [
-544,
6384
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "f239fdfb-f2ed-4e30-bb81-560cb624cdb9",
"name": "StudentID",
"type": "string",
"value": "={{ $json.output[0].StudentID }}"
},
{
"id": "249bdf9e-6f9b-4e45-a5c9-288128c03e51",
"name": "Schedule",
"type": "string",
"value": "={{ $json['output[0].Selected'] }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "de5141a8-d7d2-4392-b516-d3b48f565e5e",
"name": "Clear sheet1",
"type": "n8n-nodes-base.googleSheets",
"position": [
-336,
6384
],
"parameters": {
"operation": "clear",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 572766543,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/10IMnD8JhiR4lTlNFQTG_Auopg8haAiEt3_G9EKWTqLw/edit#gid=572766543",
"cachedResultName": "schedule"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "10IMnD8JhiR4lTlNFQTG_Auopg8haAiEt3_G9EKWTqLw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/10IMnD8JhiR4lTlNFQTG_Auopg8haAiEt3_G9EKWTqLw/edit?usp=drivesdk",
"cachedResultName": "Student Details"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "9ae9d8a6-680b-4df0-b41f-95aa314f0679",
"name": "Sticky Note56",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2016,
6016
],
"parameters": {
"color": 7,
"width": 2144,
"height": 1056,
"content": "### \ud83c\udf93 AI Course Scheduler from Completed Prereqs (Google Sheets + OpenAI)\n\nCreate a **Fall 2025 course schedule** for each student based on what they\u2019ve already completed, catalog prerequisites, and term availability (Fall/Both). Reads students from Google Sheets \u2192 asks an AI agent to select **exactly 5 courses** (target **15\u201317 credits**, no duplicates, prereqs enforced) \u2192 appends each student\u2019s schedule to a **schedule** tab.\n\n"
},
"typeVersion": 1
},
{
"id": "b55540c2-7e9d-4998-9c87-fa8ef37ff943",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2448,
6016
],
"parameters": {
"width": 400,
"height": 1056,
"content": "### \u2699\ufe0f Setup (only 2 steps)\n\n#### 1) Connect Google Sheets (OAuth2)\n- In **n8n \u2192 Credentials \u2192 New \u2192 Google Sheets (OAuth2)**, sign in and grant access \n- In the Google Sheets nodes, select your spreadsheet and these tabs:\n - **Sheet1** (input students)\n - **schedule** (output)\n\n> Example spreadsheet (replace with your own): \n> - Input: `.../edit#gid=0` \n> - Output: `.../edit#gid=572766543`\n\n#### 2) Connect OpenAI (API Key)\n- In **n8n \u2192 Credentials \u2192 New \u2192 OpenAI API**, paste your key \n- In the **OpenAI Chat Model** node, select that credential and a chat model (e.g., `gpt-4o`)\n\n\n\n- \ud83d\udce7 **rbreen@ynteractive.com** \n- \ud83d\udd17 **Robert Breen** \u2014 https://www.linkedin.com/in/robert-breen-29429625/ \n- \ud83c\udf10 **ynteractive.com** \u2014 https://ynteractive.com\n\n"
},
"typeVersion": 1
},
{
"id": "b23e80f6-a848-4fdc-989d-f500fae50f8d",
"name": "Get Student Data",
"type": "n8n-nodes-base.googleSheets",
"position": [
-1664,
6672
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/10IMnD8JhiR4lTlNFQTG_Auopg8haAiEt3_G9EKWTqLw/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "10IMnD8JhiR4lTlNFQTG_Auopg8haAiEt3_G9EKWTqLw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/10IMnD8JhiR4lTlNFQTG_Auopg8haAiEt3_G9EKWTqLw/edit?usp=drivesdk",
"cachedResultName": "Student Details"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "e8c4be35-a682-43af-806c-4a0908fad56f",
"name": "Split Schedule",
"type": "n8n-nodes-base.splitOut",
"position": [
-800,
6384
],
"parameters": {
"include": "allOtherFields",
"options": {},
"fieldToSplitOut": "output[0].Selected"
},
"typeVersion": 1
},
{
"id": "40109987-d4b5-48d5-aea6-1923956ad3e8",
"name": "Append Schedule",
"type": "n8n-nodes-base.googleSheets",
"position": [
-128,
6384
],
"parameters": {
"columns": {
"value": {},
"schema": [
{
"id": "StudentID",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "StudentID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Schedule",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Schedule",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "autoMapInputData",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 572766543,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/10IMnD8JhiR4lTlNFQTG_Auopg8haAiEt3_G9EKWTqLw/edit#gid=572766543",
"cachedResultName": "schedule"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "10IMnD8JhiR4lTlNFQTG_Auopg8haAiEt3_G9EKWTqLw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/10IMnD8JhiR4lTlNFQTG_Auopg8haAiEt3_G9EKWTqLw/edit?usp=drivesdk",
"cachedResultName": "Student Details"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
}
],
"connections": {
"Set Fields": {
"main": [
[
{
"node": "Clear sheet1",
"type": "main",
"index": 0
}
]
]
},
"Clear sheet1": {
"main": [
[
{
"node": "Append Schedule",
"type": "main",
"index": 0
}
]
]
},
"Split Schedule": {
"main": [
[
{
"node": "Set Fields",
"type": "main",
"index": 0
}
]
]
},
"Get Student Data": {
"main": [
[
{
"node": "Scheduling Agent",
"type": "main",
"index": 0
}
]
]
},
"Scheduling Agent": {
"main": [
[
{
"node": "Split Schedule",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model2": {
"ai_languageModel": [
[
{
"node": "Scheduling Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "Scheduling Agent",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"When clicking \u2018Execute workflow\u2019": {
"main": [
[
{
"node": "Get Student Data",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
googleSheetsOAuth2ApiopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
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…
Source: https://n8n.io/workflows/8090/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
🎯 Create viral TikToks, Shorts, Reels, podcasts, and ASMR videos in minutes — all on autopilot.
Generate AI viral videos with NanoBanana & VEO3, shared on socials via Blotato 2. Uses @blotato/n8n-nodes-blotato, googleSheets, lmChatOpenAi, toolThink. Event-driven trigger; 94 nodes.
This template is designed for marketers, content creators, and e-commerce brands who want to automate the creation of professional ad videos at scale. It’s ideal for teams looking to generate consiste
Digistars - Scrape & Crawl. Uses httpRequest, n8n-nodes-firecrawl-scraper, googleSheets, lmChatOpenAi. Event-driven trigger; 63 nodes.
This comprehensive n8n workflow automates the entire Meta (Facebook/Instagram) advertising process, from asset analysis to ad creation. It combines AI-powered content analysis with automated ad deploy