The flow
Model 3Logic 13Service 7
The steps in the order they run, from what starts it.
- 1Email Trigger (IMAP)Email Read ImapService
- 2OpenAI Chat ModelLm Chat Open AiModel
- 3Structured Output ParserOutput Parser StructuredModel
- 4IfIfLogic
- 5Basic LLM ChainChain LlmModel
- 6CodeCodeLogic
- 7MergeMergeLogic
- 8If1IfLogic
- 9If2IfLogic
- 10Extract from File1Extract From FileService
- 11DiscordDiscordService
- 12Prepare Company DataSetLogic
- 13Check CompanyPostgresService
- 14IF Company Does Not ExistIfLogic
- 15Add CompanyPostgresService
- 16Set Existing Company IDSetLogic
- 17Set New Company IDSetLogic
- 18Merge Company IDMergeLogic
- 19Check InvoicePostgresService
- 20IF Invoice Does Not ExistIfLogic
- 21Add InvoicePostgresService
- 22Invoice ExistsSetLogic
- 23Merge EndMergeLogic
How it's built
- Starts on
- An arriving email
- Steps
- 23, with 5 branches
- Size
- Large: read it before trusting it with anything live
- Connects to
- Discord, Email, Postgres
- Model
- OpenAI
Questions
What does it need to run?
An n8n account, plus your own Discord, Email and Postgres accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.
What starts it?
It starts on an arriving email.
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 itNothing 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.