{"product_id":"n8n-teacher-substitute-matching-google-sheets-gpt-4o-gmail-telegram","title":"n8n Teacher Substitute Matching: Google Sheets + GPT-4o + Gmail\/Telegram","description":"\u003ch3\u003eAutomatically match teacher leave requests to the right substitute—and notify everyone in minutes\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow captures teacher leave requests, pulls timetable and substitute availability from \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e, uses \u003cstrong\u003eOpenAI (gpt-4o-mini)\u003c\/strong\u003e to choose the best substitute, then sends updates via \u003cstrong\u003eGmail\u003c\/strong\u003e and \u003cstrong\u003eTelegram\u003c\/strong\u003e—while logging coverage and payroll back to Google Sheets.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives a leave request\u003c\/strong\u003e from an \u003cstrong\u003en8n form\u003c\/strong\u003e (teacher name, email, leave date, reason).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLoads data from Google Sheets\u003c\/strong\u003e: retrieves the full timetable and the substitute availability pool.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFinds affected classes\u003c\/strong\u003e by filtering the timetable to the absent teacher’s classes on the requested leave date and creating one item per affected class.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eBuilds a structured prompt per class\u003c\/strong\u003e (subject fit, availability, and weekly hours).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eUses OpenAI to select the best substitute\u003c\/strong\u003e with \u003cstrong\u003egpt-4o-mini\u003c\/strong\u003e, then parses the returned JSON to extract the selected substitute, match reason, and confidence.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNotifies stakeholders\u003c\/strong\u003e: emails the assigned substitute via \u003cstrong\u003eGmail\u003c\/strong\u003e, notifies affected students via \u003cstrong\u003eGmail\u003c\/strong\u003e, and sends an assignment summary to \u003cstrong\u003ean admin via Telegram\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eUpdates operations records\u003c\/strong\u003e in \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e: marks coverage and appends a payroll log entry for the substitute.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eA school admin wants \u003cstrong\u003eautomatic substitute assignment\u003c\/strong\u003e when teachers request leave.\u003c\/li\u003e\n  \u003cli\u003eAn operations team needs \u003cstrong\u003econsistent coverage tracking\u003c\/strong\u003e and \u003cstrong\u003epayroll logging\u003c\/strong\u003e in Google Sheets.\u003c\/li\u003e\n  \u003cli\u003eAutomation engineers building an \u003cstrong\u003en8n workflow for education scheduling\u003c\/strong\u003e with AI-assisted matching.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n Form Trigger\u003c\/strong\u003e to collect leave requests.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e integration (Timetable, Substitutes, SubstitutePayroll sheets; replace \u003ccode\u003eYOUR_SPREADSHEET_ID\u003c\/code\u003e and timetable IDs).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eOpenAI\u003c\/strong\u003e using \u003cstrong\u003egpt-4o-mini\u003c\/strong\u003e for substitute selection and JSON parsing.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGmail\u003c\/strong\u003e for emailing substitutes and notifying students (OAuth2 credential required).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eTelegram\u003c\/strong\u003e for admin assignment summaries.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNodes used\u003c\/strong\u003e: code, gmail, telegram, sticky note (and related helper logic).\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45862247399603,"sku":"N8N-18324","price":67.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/t1L1isyVM10XbF8TSbU3C_J4j8qWrX.png?v=1786957623","url":"https:\/\/buyflowscripts.com\/products\/n8n-teacher-substitute-matching-google-sheets-gpt-4o-gmail-telegram","provider":"N8N Commerce","version":"1.0","type":"link"}