Automation library · Content

Automate WhatsApp tests and rank results with Postgres

Started by an incoming WhatsApp message, and works across Postgres and WhatsApp. 30 steps, 4 branches: large, and worth reading before you trust it with anything live.

Large

30 stepsLarge: read it before trusting it with anything live
4Branches: places the flow splits
0Loops or waits
2Services it connects to

The flow

Starts it 1Logic 7Service 22

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

  1. 1WhatsApp TriggerWhats App triggerStarts it
  2. 2InitializationSetLogic
  3. 3Get Bot StatusPostgresService
  4. 4Define FlowSwitchLogic
  5. 5StartsWhats AppService
  6. 6CommandsSwitchLogic
  7. 7Get AnswerPostgresService
  8. 8Upsert Bot Status on STARTPostgresService
  9. 9Main MenuWhats AppService
  10. 10List?IfLogic
  11. 11Get Question variantsPostgresService
  12. 12Update Bot Status on START PostgresService
  13. 13Get TestsPostgresService
  14. 14Get Tests PostgresService
  15. 15Update AnswerPostgresService
  16. 16Union Number with QuestionSetLogic
  17. 17Get TestPostgresService
  18. 18Get Non-Answered QuestionsPostgresService
  19. 19Union listSummarizeService
  20. 20TestWhats AppService
  21. 21Any questions?IfLogic
  22. 22List TestsWhats AppService
  23. 23Get Questions AND AnswersPostgresService
  24. 24Randomize questionsSortLogic
  25. 25Calculate answersPostgresService
  26. 26Upsert pred AnswerPostgresService
  27. 27ResultWhats AppService
  28. 28Request AnswerWhats AppService
  29. 29Update Bot Status on STARTPostgresService
  30. 30Update Bot Status on TESTPostgresService

How it's built

Starts on
An incoming WhatsApp message
Steps
30, with 4 branches
Size
Large: read it before trusting it with anything live
Connects to
Postgres, WhatsApp
Model
None. This is plumbing, not judgement

Questions

What does it need to run?

An n8n account, plus your own Postgres and WhatsApp accounts. 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?

No. Every step is fixed logic or a call to a service, so it does the same thing every time.

How long does it take to set up?

Take your time. At 30 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 30 steps before you point it at anything that matters.