# Collect student absence reasons with WhatsApp: n8n workflow

> Started by an incoming WhatsApp message, and works across Google Sheets, Redis and WhatsApp.

Source: https://millionrounds.com/workflow/collect-student-absence-reasons-with-whatsapp (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Data collection](https://millionrounds.com/workflows?category=Data+collection#library)

# Collect student absence reasons with WhatsApp

Started by an incoming WhatsApp message, and works across Google Sheets, Redis and WhatsApp. It puts Gemini behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 41 steps, 8 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

Large Calls a model: Gemini Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fcollect-student-absence-reasons-with-whatsapp)

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

**8** Branches: places the flow splits

**1** Loop or waits

**3** Services it connects to

## The flow

Starts it 2 Model 4 Logic 15 Service 20

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

- 1 **When Every Day at 10:30 AM** Schedule trigger *Starts it*
- 2 **On WhatsApp Message Reception** Whats App trigger *Starts it*
- 3 **Google Gemini Classifier** Lm Chat Google Gemini *Model*
- 4 **Parse AI Response** Output Parser Structured *Model*
- 5 **Maintain Chat Memory in Redis** Memory Redis Chat *Model*
- 6 **Retrieve Absent Students from Sheets** Google Sheets *Service*
- 7 **Set Message Details** Set *Logic*
- 8 **Classify Absence Reason** Agent *Model*
- 9 **Check If Reason is Missing** If *Logic*
- 10 **Verify Message Contains Text** If *Logic*
- 11 **Assess If Reason Is Given** If *Logic*
- 12 **Send Absence Notice on WhatsApp** Whats App *Service*
- 13 **Confirm Message is Text Type** If *Logic*
- 14 **Update Student Data in Sheets** Google Sheets *Service*
- 15 **Request Reason Clarification** Whats App *Service*
- 16 **Store Notice in Redis** Redis *Service*
- 17 **Verify Dedup Key in Redis** Redis *Service*
- 18 **Warn Non-Text Message on WhatsApp** Whats App *Service*
- 19 **Dispatch Confirmation Message** Whats App *Service*
- 20 **Free Lock After Clarification** Redis *Service*
- 21 **Determine Message Duplication** If *Logic*
- 22 **Release Lock Post Confirmation** Redis *Service*
- 23 **Ignore Duplicate Message Entry** No Op *Logic*
- 24 **Log Dedup Key in Redis** Redis *Service*
- 25 **Retrieve Message Buffer from Redis** Redis *Service*
- 26 **Save Message to Buffer** Set *Logic*
- 27 **Store Message Buffer in Redis** Redis *Service*
- 28 **Log Message Timestamp in Redis** Redis *Service*
- 29 **Pause 1s for Debounce** Wait *Logic*
- 30 **Retrieve Latest Timestamp from Redis** Redis *Service*
- 31 **Verify Latest Message Status** If *Logic*
- 32 **Check Processing Lock in Redis** Redis *Service*
- 33 **Abort Stale Message Process** No Op *Logic*
- 34 **Detect Active Processing Lock** If *Logic*
- 35 **Cancel Locked Processing** No Op *Logic*
- 36 **Gain Processing Lock in Redis** Redis *Service*
- 37 **Acquire Final Buffer from Redis** Redis *Service*
- 38 **Create Combined Message Buffer** Set *Logic*
- 39 **Remove Buffer from Redis** Redis *Service*
- 40 **Read Student Data from Sheets** Google Sheets *Service*
- 41 **Check Student Reason Presence** If *Logic*

## How it's built

- **Starts on:** An incoming WhatsApp message
- **Steps:** 41, with 8 branches, 1 loop or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Google Sheets, Redis, WhatsApp
- **Model:** Gemini
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Google Sheets, Redis and WhatsApp accounts, and a key for Gemini. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an incoming WhatsApp message.

Does it use AI?

Yes. It calls Gemini. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 41 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 41 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%2Fcollect-student-absence-reasons-with-whatsapp)
- **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.

[Google Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)[Redis](https://millionrounds.com/workflows?service=Redis#library)[WhatsApp](https://millionrounds.com/workflows?service=WhatsApp#library)

## Workflows like it

Also data collection, with the same services where possible, closest in size first.

- [**AI real estate agent: end-to-end ops automation with OpenAI** 42 steps · calls a model · Google Docs, Google Sheets](https://millionrounds.com/workflow/ai-real-estate-agent-end-to-end-ops-automation-with-openai)
- [**Score job listings and generate tailored cover letters** 39 steps · calls a model · Apify, Gmail](https://millionrounds.com/workflow/score-job-listings-and-generate-tailored-cover-letters)
- [**An email assistant to manage your Gmail inbox with Gemini** 37 steps · calls a model · Email, Gmail](https://millionrounds.com/workflow/an-email-assistant-to-manage-your-gmail-inbox-with-gemini)
- [**Automate LinkedIn requests & icebreaker with Browserflow** 37 steps · calls a model · Google Sheets](https://millionrounds.com/workflow/automate-linkedin-requests-and-icebreaker-with-browserflow)
- [**Track n8n workflow changes over time with Google Sheets** 37 steps · Google Sheets](https://millionrounds.com/workflow/track-n8n-workflow-changes-over-time-with-google-sheets)
- [**Build a Google Drive internal knowledge base with OpenAI** 34 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/build-a-google-drive-internal-knowledge-base-with-openai)
