Automation library · AI assistants

Update Amazon transaction memos in YNAB with Gmail

Started by another system calling it, and works across Gmail. It hands the judgement calls to OpenAI. 23 steps, 4 branches, 2 loops or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAI

23 stepsLarge: read it before trusting it with anything live
4Branches: places the flow splits
2Loops or waits
1Service it connects to

The flow

Starts it 3Model 3Logic 13Service 4

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

  1. 1When clicking ‘Test workflow’Manual triggerStarts it
  2. 2WebhookWebhookStarts it
  3. 3Schedule TriggerSchedule triggerStarts it
  4. 4CalculatorTool CalculatorModel
  5. 5OpenAI Chat ModelLm Chat Open AiModel
  6. 6BudgetIDSetLogic
  7. 7Memo AI AgentAgentModel
  8. 8Get All Unapproved TransactionsHttp RequestService
  9. 9Check if AI Able to parse itemsIfLogic
  10. 10Split out TransactionsSplit OutLogic
  11. 11Update Transaction Memo FieldHttp RequestService
  12. 12Update memo with ErrorHttp RequestService
  13. 13Extract Needed DataSetLogic
  14. 14Check Next TransactionNo OpLogic
  15. 15Check if Amazon PurchaseIfLogic
  16. 16Wait 5 seconds to avoid Rate LimitingWaitLogic
  17. 17Check if Memo field is EmptyIfLogic
  18. 18Loop Over TransactionsSplit In BatchesLogic
  19. 19Search Emails for Transaction AmountGmailService
  20. 20Check if emails foundIfLogic
  21. 21Format EmailsSetLogic
  22. 22No Emails FoundNo OpLogic
  23. 23Join emails togetherAggregateLogic

How it's built

Starts on
Another system calling it
Steps
23, with 4 branches, 2 loops or waits
Size
Large: read it before trusting it with anything live
Connects to
Gmail
Model
OpenAI

Questions

What does it need to run?

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

What starts it?

It starts on another system calling it.

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 23 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 23 steps before you point it at anything that matters.