Analysis updated 2026-05-18
Fix Gemini function-call errors caused by broken chat history in an n8n AI agent workflow.
Set up a webhook that responds instantly while queueing and safely retrying failed work.
Use the included prompts to get an AI assistant to generate more production-ready n8n workflows.
| ryuk-builds/n8n-at-scale-snippets | anil-matcha/open-poe-ai | arata-ae/purupurupngtuber | |
|---|---|---|---|
| Stars | 4 | 4 | 4 |
| Language | JavaScript | JavaScript | JavaScript |
| Last pushed | — | 2026-06-25 | — |
| Maintenance | — | Active | — |
| Setup difficulty | moderate | moderate | moderate |
| Complexity | 3/5 | 3/5 | 3/5 |
| Audience | developer | developer | general |
Figures from each repo's GitHub metadata at analysis time.
The dead-letter workflow needs Redis (or a Postgres queue table swap) and a notification webhook URL configured.
This repository is a small collection of code snippets and workflow patterns for people running n8n, a visual workflow automation tool, in a real production setting rather than just for demos. It was shared as a companion to a set of Reddit posts, and everything in it is meant to be dropped directly into an existing n8n setup. The first piece is a script meant to run inside a Code node in n8n. It fixes a specific error that shows up when using Google's Gemini as the language model behind an AI agent: Gemini expects every function call to be immediately followed by its matching function response in the conversation history, and if that pairing gets broken, for example by a crashed previous run or by messages arriving out of order during batch processing, Gemini rejects the whole request. The script cleans up the stored conversation history before it reaches the AI agent so that pairing is always intact, and if the history is empty or too broken to fix, it simply returns an empty history rather than crashing the workflow. The second piece is a ready to import n8n workflow implementing a common reliability pattern: a webhook that responds immediately to whoever called it, while the actual payload is pushed onto a queue and processed separately on a short timer. If processing a queued item fails, it gets moved to a separate failure queue and a notification is sent, and there is a manual workflow for retrying those failed items once the underlying problem is fixed. A third folder contains a system prompt, a rules document, and example prompts intended to help someone use an AI assistant like Claude to generate n8n workflows that are built to production standards, rather than the simpler, more fragile workflows an AI might produce by default. The author states both main snippets were pulled from real workflows they have run in production, with names and paths cleaned up before sharing. Everything in the repository is released under the MIT license.
Production-ready n8n snippets: a Gemini chat-history fixer and a queue-and-retry webhook pattern for reliable workflows.
Mainly JavaScript. The stack also includes JavaScript, n8n, Redis.
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.