The flow
Starts it 1Model 6Logic 24Service 2
The steps in the order they run, from what starts it.
- 1When chat message receivedChat triggerStarts it
- 2Simple MemoryMemory Buffer WindowModel
- 3OpenRouter Chat ModelLm Chat Open RouterModel
- 4localVariablesSetLogic
- 5OpenRouterAgentAgentModel
- 6IfOpenAIIfLogic
- 7isExecutableIfLogic
- 8AgentNameSetLogic
- 9setOutputByProviderSetLogic
- 10wordsForUser1SetLogic
- 11getAssistantsListOpen AiModel
- 12IfErrorIfLogic
- 13IfIfLogic
- 14AutoErrorFixingIfLogic
- 15SwitchSwitchLogic
- 16isAssistantExistsCodeCodeLogic
- 17issueOnOpenAiSideSetLogic
- 18IsMaxAutoErrorReachedIfLogic
- 19askUserHowToHandleErrorSetLogic
- 20Execute_AI_resultPostgresService
- 21Execute a SQL queryMy SqlService
- 22isAssistantExistsIfLogic
- 23collectErrorLoopDetails1CodeLogic
- 24mergeExecutionsResultCodeLogic
- 25GenerateErrorPromptCodeLogic
- 26assistantSetLogic
- 27createOpenAiAssistantOpen AiModel
- 28maxAutoErrorLimitReachedSetLogic
- 29collectErrorLoopDetailsCodeLogic
- 30isOpenAIIfLogic
- 31OpenAIMainBrainOpen AiModel
- 32executedSQLQuerySetLogic
- 33setThreadIdSetLogic
How it's built
- Starts on
- Someone opening a chat with it
- Steps
- 33, with 9 branches
- Size
- Large: read it before trusting it with anything live
- Connects to
- MySQL, Postgres
- Model
- OpenAI, OpenRouter
- 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 MySQL and Postgres accounts, and a key for OpenAI and OpenRouter. You connect your own accounts after importing it; none are included.
What starts it?
It starts on someone opening a chat with it.
Does it use AI?
Yes. It calls OpenAI and OpenRouter. 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 33 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 33 steps before you point it at anything that matters.