Ok solved it. Putting the solution here for if anyone else has the same issue.
The fix for me was setting EXECUTIONS_PROCESS to main.
Gemini tells me:
This environment variable controls how the execution process is managed. It has a few settings, but the one that might help you is
main.By setting
EXECUTIONS_PROCESS=main, you eliminate the inter-process communication and potential for serialization/deserialization issues that might be at the heart of this bug. It essentially makes your n8n instance run as a single, monolithic process.The error seems to happen when the main process hands off the workflow to a worker process. In that handoff, the
AI Agentnodeās definition is somehow lost or corrupted because theTelegram Triggeris also present. By forcing the execution to stay in themainprocess, you skip this handoff entirely. The process that loaded the workflow from the database is the same one that will execute it, which should prevent the node definition from getting lost.