Summarization Chain generates many "Individual Summary Prompt" calls to the LLM

Describe the problem/error/question

I’m currently working on a workflow that helps me create a summary of a YouTube transcript in a way that allows for pre-reading. To achieve that I use summarization chain with custom prompts that give me the structured output.

What is the error message (if any)?

After updating the prompts, there are numerous calls for the “Individual Summary Prompt” (approximately 50), which are very costly to generate, and it seems that they are not necessary because the data was already summarized in previous steps. This behavior is inconsistent, as for certain models like LLama 4 Maverick, the number of prompts is correctly equal to n+1, where n is the number of text chunks + 1 for summary.

Please share your workflow

Share the output returned by the last node

The output is correct and expected, but there are too many recalls for the “Individual Summary Prompt.”

Information on your n8n setup

  • n8n version: 1.122.4
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu 24.04.3

Hello @paczkow, welcome to :n8n: community!

Your workflow looks great!

I do have a comment though..

After testing the workflow, I noticed something strange:
The Summarization Method is configured as “Map Reduce” but when I run it and check the logs (external logs), it actually uses StuffDocumentsChain!!

Am I missing something here? Maybe this related to the “Individual Summary Prompt” behaviour?

Hi,

First of all, thank you for your kind words and for your investigation.

I find this interesting; I wasn’t aware of that. How did you use these external locks? What tool did you use for them?

From what I can see, there is only the “Summarization Chain” node along with numerous calls to the model beneath it. However, only the first five calls are related to chunks created from the text. The rest are “Individual Summary Prompts” based on the summaries from the previous steps.

What is also interesting is that if I use LLama 4 Maverick, there are only 6 calls for the same file, and it’s the correct number since I have 5 chunks of text plus 1 for the summary.

Mistral Medium

LLama 4 Maverick

This is LangSmith, you can easily integrate it with n8n, look here:

Regarding the calls, when I increased the video length I was testing with, I started getting a lot more calls which seems normal..
However, I still end up with a StuffDocumentsChain at the end.

TBH, I’m not sure if this is the expected behavior, I rarely work with the “Summarization Chain” so this just caught my curiosity..

@mohamed3nan, thanks for introducing this tool.

I connected it, and it seems that there are multiple phases of summary chunks related to “Individual Summary Prompt”. In the first phase, a summary is generated from the transcript chunk, as expected. However, additional LLM chains are created that summarize the output from the previous step. I’m not sure if this is the expected behavior or if it’s a bug.

Here are the logs.