# Match teacher substitutes and send notifications with OpenAI: n8n workflow

> Started by someone submitting a form, and works across Gmail, Google Calendar, Google Sheets, Slack and two others. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/match-teacher-substitutes-and-send-notifications-with-openai (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Alerts and monitoring](https://millionrounds.com/workflows?category=Alerts+and+monitoring#library)

# Match teacher substitutes and send notifications with OpenAI

Started by someone submitting a form, and works across Gmail, Google Calendar, Google Sheets, Slack and two others. It hands the judgement calls to OpenAI. 29 steps, 2 branches: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fmatch-teacher-substitutes-and-send-notifications-with-openai)

**29 steps** Large: read it before trusting it with anything live

**2** Branches: places the flow splits

**0** Loops or waits

**6** Services it connects to

## The flow

Starts it 3 Model 1 Logic 8 Service 17

The steps in the order they run, from what starts it.

- 1 **Receive Teacher Leave Request** Form trigger *Starts it*
- 2 **Weekly Schedule Trigger (Mondays 8am)** Schedule trigger *Starts it*
- 3 **On Workflow Error** Error trigger *Starts it*
- 4 **Fetch Full Timetable from Sheets** Google Sheets *Service*
- 5 **Fetch Substitute Availability** Google Sheets *Service*
- 6 **Fetch Today's Assigned Substitutes** Google Sheets *Service*
- 7 **Read Payroll Sheet for Digest** Google Sheets *Service*
- 8 **Slack, Send Workflow Error Alert** Slack *Service*
- 9 **Telegram, Send Workflow Error Alert** Telegram *Service*
- 10 **Filter Classes for Absent Teacher** Code *Logic*
- 11 **Aggregate Substitute Workload** Code *Logic*
- 12 **Build AI Substitute Ranking Prompt** Code *Logic*
- 13 **Slack, Send Weekly Workload Digest** Slack *Service*
- 14 **AI Rank Substitute Candidates** Open Ai *Model*
- 15 **Parse Ranked Candidates** Code *Logic*
- 16 **Pick Next Available Candidate** Code *Logic*
- 17 **IF: Candidate Available?** If *Logic*
- 18 **Telegram, Confirm With Substitute** Telegram *Service*
- 19 **Telegram, Escalate to Admin** Telegram *Service*
- 20 **IF: Substitute Accepted?** If *Logic*
- 21 **Email Assigned Substitute Teacher** Gmail *Service*
- 22 **Log Decline & Increment Attempt** Code *Logic*
- 23 **Twilio, SMS Backup to Substitute** Twilio *Service*
- 24 **Google Calendar, Block Substitute Time** Google Calendar *Service*
- 25 **Notify Students of Class Change** Gmail *Service*
- 26 **Send Admin Telegram Summary** Telegram *Service*
- 27 **Mark Class as Covered in Timetable** Google Sheets *Service*
- 28 **Log Substitute Hours to Payroll Sheet** Google Sheets *Service*
- 29 **Append to Audit Log** Google Sheets *Service*

## How it's built

- **Starts on:** Someone submitting a form
- **Steps:** 29, with 2 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, Google Calendar, Google Sheets, Slack, Telegram, Twilio
- **Model:** OpenAI

## Questions

What does it need to run?

An n8n account, plus your own Gmail, Google Calendar, Google Sheets, Slack, Telegram and Twilio accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on someone submitting a form.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 29 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 29 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fmatch-teacher-substitutes-and-send-notifications-with-openai)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Gmail](https://millionrounds.com/workflows?service=Gmail#library)[Google Calendar](https://millionrounds.com/workflows?service=Google+Calendar#library)[Google Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)[Slack](https://millionrounds.com/workflows?service=Slack#library)[Telegram](https://millionrounds.com/workflows?service=Telegram#library)[Twilio](https://millionrounds.com/workflows?service=Twilio#library)

## Workflows like it

Also alerts and monitoring, with the same services where possible, closest in size first.

- [**Detect procurement fraud and monitor supplier compliance** 29 steps · calls a model · Email, Slack](https://millionrounds.com/workflow/detect-procurement-fraud-and-monitor-supplier-compliance)
- [**Monitor favorite YouTube channels with RSS** 29 steps · calls a model · Gmail, RSS](https://millionrounds.com/workflow/monitor-favorite-youtube-channels-with-rss)
- [**Monitor semiconductor board reliability with OpenAI and Slack** 29 steps · calls a model · Email, Google Sheets](https://millionrounds.com/workflow/monitor-semiconductor-board-reliability-with-openai-and-slac)
- [**X (Twitter) brand sentiment analysis with Gemini and Slack** 29 steps · calls a model · Google Sheets, Slack](https://millionrounds.com/workflow/x-twitter-brand-sentiment-analysis-with-gemini-and-slack)
- [**AI chatbot call center: Telegram call in with Postgres** 29 steps · Postgres, Redis](https://millionrounds.com/workflow/ai-chatbot-call-center-telegram-call-in-with-postgres)
- [**AI chatbot call center: demo call back with Postgres and Redis** 29 steps · Postgres, Redis](https://millionrounds.com/workflow/ai-chatbot-call-center-demo-call-back-with-postgres-and-redi)
