Automation library · Data collection

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.

LargeCalls a model: GeminiRetrieval

41 stepsLarge: read it before trusting it with anything live
8Branches: places the flow splits
1Loop or waits
3Services it connects to

The flow

Starts it 2Model 4Logic 15Service 20

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

  1. 1When Every Day at 10:30 AMSchedule triggerStarts it
  2. 2On WhatsApp Message ReceptionWhats App triggerStarts it
  3. 3Google Gemini ClassifierLm Chat Google GeminiModel
  4. 4Parse AI ResponseOutput Parser StructuredModel
  5. 5Maintain Chat Memory in RedisMemory Redis ChatModel
  6. 6Retrieve Absent Students from SheetsGoogle SheetsService
  7. 7Set Message DetailsSetLogic
  8. 8Classify Absence ReasonAgentModel
  9. 9Check If Reason is MissingIfLogic
  10. 10Verify Message Contains TextIfLogic
  11. 11Assess If Reason Is GivenIfLogic
  12. 12Send Absence Notice on WhatsAppWhats AppService
  13. 13Confirm Message is Text TypeIfLogic
  14. 14Update Student Data in SheetsGoogle SheetsService
  15. 15Request Reason ClarificationWhats AppService
  16. 16Store Notice in RedisRedisService
  17. 17Verify Dedup Key in RedisRedisService
  18. 18Warn Non-Text Message on WhatsAppWhats AppService
  19. 19Dispatch Confirmation MessageWhats AppService
  20. 20Free Lock After ClarificationRedisService
  21. 21Determine Message DuplicationIfLogic
  22. 22Release Lock Post ConfirmationRedisService
  23. 23Ignore Duplicate Message EntryNo OpLogic
  24. 24Log Dedup Key in RedisRedisService
  25. 25Retrieve Message Buffer from RedisRedisService
  26. 26Save Message to BufferSetLogic
  27. 27Store Message Buffer in RedisRedisService
  28. 28Log Message Timestamp in RedisRedisService
  29. 29Pause 1s for DebounceWaitLogic
  30. 30Retrieve Latest Timestamp from RedisRedisService
  31. 31Verify Latest Message StatusIfLogic
  32. 32Check Processing Lock in RedisRedisService
  33. 33Abort Stale Message ProcessNo OpLogic
  34. 34Detect Active Processing LockIfLogic
  35. 35Cancel Locked ProcessingNo OpLogic
  36. 36Gain Processing Lock in RedisRedisService
  37. 37Acquire Final Buffer from RedisRedisService
  38. 38Create Combined Message BufferSetLogic
  39. 39Remove Buffer from RedisRedisService
  40. 40Read Student Data from SheetsGoogle SheetsService
  41. 41Check Student Reason PresenceIfLogic

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.