# WhatsApp expense tracker with OpenRouter and Postgres: n8n workflow

> Started by an incoming WhatsApp message, and works across Postgres and WhatsApp. It hands the judgement calls to OpenRouter.

Source: https://millionrounds.com/workflow/whatsapp-expense-tracker-with-openrouter-and-postgres (Millionrounds; every figure on the page links to its filing or article)

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

# WhatsApp expense tracker with OpenRouter and Postgres

Started by an incoming WhatsApp message, and works across Postgres and WhatsApp. It hands the judgement calls to OpenRouter. 45 steps, 1 branch: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenRouter

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fwhatsapp-expense-tracker-with-openrouter-and-postgres)

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

**1** Branch: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 2 Model 28 Logic 7 Service 8

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

- 1 **Date and time** Tool Code *Model*
- 2 **Structured Output Parser** Output Parser Structured *Model*
- 3 **OpenRouter Chat Model** Lm Chat Open Router *Model*
- 4 **OpenRouter Chat Model1** Lm Chat Open Router *Model*
- 5 **Calculator** Tool Calculator *Model*
- 6 **OpenRouter Chat Model3** Lm Chat Open Router *Model*
- 7 **OpenRouter Chat Model4** Lm Chat Open Router *Model*
- 8 **Postgres2** Postgres Tool *Service*
- 9 **OpenRouter Chat Model5** Lm Chat Open Router *Model*
- 10 **Calculator1** Tool Calculator *Model*
- 11 **Structured Output Parser2** Output Parser Structured *Model*
- 12 **OpenRouter Chat Model6** Lm Chat Open Router *Model*
- 13 **Incoming WhatsApp Trigger** Whats App trigger *Starts it*
- 14 **Daily 8AM Trigger** Schedule trigger *Starts it*
- 15 **Date and time1** Tool Code *Model*
- 16 **Date and time2** Tool Code *Model*
- 17 **Date and time3** Tool Code *Model*
- 18 **Date and time4** Tool Code *Model*
- 19 **Date and time5** Tool Code *Model*
- 20 **OpenRouter Chat Model2** Lm Chat Open Router *Model*
- 21 **OpenRouter Chat Model7** Lm Chat Open Router *Model*
- 22 **OpenRouter Chat Model8** Lm Chat Open Router *Model*
- 23 **Parse & Validate Transaction** Agent *Model*
- 24 **Message Intent Classifier** Agent *Model*
- 25 **Build Custom Report Query** Agent *Model*
- 26 **Build Custom Financial Summary** Agent *Model*
- 27 **Build Daily Report Query** Agent *Model*
- 28 **Execute Daily Report Query** Agent *Model*
- 29 **Build Daily Financial Summary** Agent *Model*
- 30 **Build Confirmation Message** Agent *Model*
- 31 **simple conversation** Agent *Model*
- 32 **Split Transaction Lines** Split Out *Logic*
- 33 **Route by Intent** Switch *Logic*
- 34 **Transform Custom Query for Postgres** Code *Logic*
- 35 **Send Custom Report** Whats App *Service*
- 36 **Transform Custom Query for Postgres1** Code *Logic*
- 37 **Send Daily Report** Whats App *Service*
- 38 **Send Financial Response** Whats App *Service*
- 39 **Normal Conversation** Whats App *Service*
- 40 **Format Transaction JSON** Code *Logic*
- 41 **Execute Custom Report Query** Postgres *Service*
- 42 **Validate Transaction Fields** Code *Logic*
- 43 **Format Custom Query Results** Code *Logic*
- 44 **Insert Transaction into DB** Postgres *Service*
- 45 **Convert to File** Convert To File *Service*

## How it's built

- **Starts on:** An incoming WhatsApp message
- **Steps:** 45, with 1 branch
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Postgres, WhatsApp
- **Model:** OpenRouter

## Questions

What does it need to run?

An n8n account, plus your own Postgres and WhatsApp accounts, and a key for OpenRouter. 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 OpenRouter. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 45 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 45 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%2Fwhatsapp-expense-tracker-with-openrouter-and-postgres)
- **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.

[Postgres](https://millionrounds.com/workflows?service=Postgres#library)[WhatsApp](https://millionrounds.com/workflows?service=WhatsApp#library)

## Workflows like it

Also money admin, with the same services where possible, closest in size first.

- [**WhatsApp productivity assistant with OpenAI and Gmail** 47 steps · calls a model · Gmail, Google Calendar](https://millionrounds.com/workflow/whatsapp-productivity-assistant-with-openai-and-gmail)
- [**WhatsApp expense tracker with OpenAI and Postgres** 52 steps · calls a model · Postgres, WhatsApp](https://millionrounds.com/workflow/whatsapp-expense-tracker-with-openai-and-postgres)
- [**Track and classify expenses with Mindee OCR and OpenAI** 32 steps · calls a model · Google Drive, Postgres](https://millionrounds.com/workflow/track-and-classify-expenses-with-mindee-ocr-and-openai)
- [**Score leads and send WhatsApp proposals with Gemini** 28 steps · calls a model · Apify, GoHighLevel](https://millionrounds.com/workflow/score-leads-and-send-whatsapp-proposals-with-gemini-2)
- [**Score leads and send WhatsApp proposals with Gemini** 28 steps · calls a model · Apify, GoHighLevel](https://millionrounds.com/workflow/score-leads-and-send-whatsapp-proposals-with-gemini)
- [**Invoice processing: Email to PostgreSQL database with OpenAI** 23 steps · calls a model · Discord, Email](https://millionrounds.com/workflow/invoice-processing-email-to-postgresql-database-with-openai)
