n8n logon8n Automation Hub
Debugging notes

Splitting One Big LLM Call Into Three Broke Everything Downstream, One Bug at a Time

Debugging notes · n8n workflow · August 31, 2026

The fix for the first bug was one line of reasoning: the request was too big, so send it in pieces. That fix was correct, and it was also the moment two more bugs β€” both invisible until then β€” became reachable for the first time.

Workflow at a glance
  1. A 70-minute transcript sent as one LLM call hit Groq's TPM (tokens-per-minute) limit: 21251 tokens requested against a 12000 limit
  2. Fix: split the transcript into ~6000-token groups, one LLM call per group instead of one call for the whole transcript
  3. That immediately broke a downstream Code node's pairedItem lookups β€” it had only ever run against a single item before
  4. Fixing the lineage lookup surfaced a third bug: clip numbering restarted at 1 for every group, silently overwriting earlier groups' rendered files
  5. All three fixes shipped together and validated on a real 70-minute episode: 15 clips, correctly numbered, zero filename collisions
  6. The pipeline only reached a genuinely confirmed working state after the third fix β€” the first two each looked complete on their own
Screenshot of the actual n8n workflow canvas: the AI clipping pipeline's transcript-parsing and Groq LLM node chain that had to be rewired to fan out into multiple calls

The actual workflow canvas, straight from my n8n instance.

The token limit that only shows up on long input

After fixing the audio-size limit on the transcription step (a separate bug, same episode), the pipeline got one step further and failed again β€” this time at the LLM call that picks the best moments from the transcript. Groq returned Request too large ... TPM: Limit 12000, Requested 21251. A seventy-minute transcript's raw text, even after merging Whisper's output into clean sentence-boundary chunks, is simply too many tokens for one call under that model's per-minute limit.

The obvious fix: send it in pieces

The transcript-parsing node already grouped Whisper's segments into sentence-boundary chunks. The fix extended that: group those chunks further into batches under a roughly 6000-token budget, and instead of returning one big blob of text, return one item per batch. n8n processes multiple input items through the next node automatically, one at a time β€” so the single downstream LLM node, completely unchanged, now just runs once per batch instead of once total. A seventy-minute episode turned into about three batches instead of one oversized request. A small delay between calls (65 seconds) was added too, since Groq's rate limit is a rolling account-wide window, not a per-request check β€” three requests fired back-to-back could still trip the same limit even though each one is individually small enough.

Splitting the input didn't just distribute the risk β€” it multiplied the assumptions

The very next node in the chain reconstructs each moment's absolute timestamp and other metadata by reaching back to the transcript-parsing node's output for the item it belongs to. That code had always been written as $input.item... β€” fine, even correct, when there was exactly one input item, because β€œthe item” was never ambiguous. The moment there were three items instead of one, that same code had no way to know which batch a given LLM response actually belonged to.

The fix was to loop over every response explicitly and use n8n's own pairedItem lookup ($('Node').itemMatching(idx)) to trace each result back to its originating batch, instead of assuming there was only ever one. This is the kind of bug that a single-item pipeline can carry silently for months β€” it was never wrong before, because the situation that would expose it had never occurred.

Bug three: numbering that assumed there was only ever one group

With lineage tracking fixed, the pipeline ran further β€” and then rendered clips that silently overwrote each other on disk. Every batch's clip-numbering code started counting from 1 independently, with no shared counter across batches, because that code had also been written back when there was only ever one batch to number. Batch one's clip 3 and batch two's clip 3 both rendered to the exact same filename, and the second write quietly clobbered the first with no error from anything in the chain.

The fix: derive each clip's number from its batch index as well as its position within the batch (batchIndex * 100 + i + 1), so clip numbers across the whole episode never collide regardless of how many batches it took. The same reasoning applied to the fallback path used when an LLM response fails to parse β€” its fallback timestamps also had to be offset by the batch's own start time instead of assuming the video started at zero.

What finally counted as β€œdone”

Each of the first two fixes looked complete in isolation β€” the pipeline ran further than it had before, with no error, which is exactly what makes a partial fix easy to mistake for a finished one. The episode wasn't confirmed genuinely working until a full re-run produced 15 correctly-numbered clips (three batches of five) with zero filename collisions and every clip's timestamp traceable back to the right source batch. Splitting one call into many isn't just a request-size change β€” it turns every downstream assumption that quietly depended on β€œthere is only ever one of these” into a bug waiting for the next multi-item run to expose it.

Debugging an n8n workflow that only breaks once real multi-item data hits it?

I debug and harden production n8n pipelines against the item-count and scale assumptions that don't show up in small test runs.