gitwtfhub

wtf is n8n-at-scale-snippets?

ryuk-builds/n8n-at-scale-snippets — explained in plain English

Analysis updated 2026-05-18

4JavaScriptAudience · developerComplexity · 3/5LicenseSetup · moderate

TL;DR

Production-ready n8n snippets: a Gemini chat-history fixer and a queue-and-retry webhook pattern for reliable workflows.

Mindmap

mindmap
  root((n8n-at-scale-snippets))
    What it does
      Fixes chat history bug
      Dead-letter queue pattern
    Tech stack
      JavaScript
      n8n workflows
      Redis streams
    Use cases
      Fix Gemini agent errors
      Reliable webhook processing
      AI-assisted workflow design
    Audience
      n8n users
      Automation developers
    Design
      Production tested
      MIT licensed

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Fix Gemini function-call errors caused by broken chat history in an n8n AI agent workflow.

REASON 2

Set up a webhook that responds instantly while queueing and safely retrying failed work.

REASON 3

Use the included prompts to get an AI assistant to generate more production-ready n8n workflows.

What's in the stack?

JavaScriptn8nRedis

How it stacks up

ryuk-builds/n8n-at-scale-snippetsanil-matcha/open-poe-aiarata-ae/purupurupngtuber
Stars444
LanguageJavaScriptJavaScriptJavaScript
Last pushed2026-06-25
MaintenanceActive
Setup difficultymoderatemoderatemoderate
Complexity3/53/53/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

The dead-letter workflow needs Redis (or a Postgres queue table swap) and a notification webhook URL configured.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

Wtf does this do

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.

Yoink these prompts

Prompt 1
Explain how the sanitize-chat-history.js script fixes the Gemini function-call pairing error.
Prompt 2
Walk me through importing the dead-letter-webhook.n8n.json workflow into my n8n instance.
Prompt 3
Show me how to adapt the dead-letter pattern to use Postgres instead of Redis Streams.
Prompt 4
Use the ai-generated-workflows prompts to help me design a production-shaped n8n workflow.

Frequently asked questions

wtf is n8n-at-scale-snippets?

Production-ready n8n snippets: a Gemini chat-history fixer and a queue-and-retry webhook pattern for reliable workflows.

What language is n8n-at-scale-snippets written in?

Mainly JavaScript. The stack also includes JavaScript, n8n, Redis.

What license does n8n-at-scale-snippets use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is n8n-at-scale-snippets to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is n8n-at-scale-snippets for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.