feat(workflows): make the LLM summarizer template real - #2497
Open
Hoang130203 wants to merge 1 commit into
Open
Conversation
config/n8n/llm-summarizer.json was a manualTrigger plus a sticky note
saying "Customize the nodes below to match your setup", with
"connections": {} — an empty canvas behind a catalog card advertising
"Summarize long text with your local LLM".
Now: POST /webhook/ods-summarize with {text, style?, max_words?} ->
llama-server /v1/chat/completions -> JSON summary.
Three things the node graph handles rather than leaving to the caller:
- `text` is clamped to 24000 characters before the call, so a large paste
cannot overrun the context window and fail the whole request. The
response reports `truncated` so the caller knows it happened.
- `style` is validated against bullets/paragraph/tldr and `max_words` is
clamped to 20..800, so a bad value degrades to the default instead of
going into the prompt verbatim.
- A missing `text` returns 400 naming the field, instead of sending an
empty prompt to the model.
The system prompt tells the model not to add facts and to summarize only
what it was given, which matters given the truncation above.
This was referenced Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
config/n8n/llm-summarizer.jsonwas a placeholder — amanualTrigger, asticky note reading "This is a template workflow… Customize the nodes below to
match your setup", and
"connections": {}. The catalog card advertises"Summarize long text with your local LLM" with
"setupTime": "1 minute";importing it gave you an empty canvas.
This makes it a working workflow, per
ods/CONTRIBUTING.md's ask for"Workflow templates — pre-built n8n workflows that solve actual problems
people have."
Choices worth reviewing
textis cut to 24000 characters beforethe call so a large paste cannot overrun the context window and fail the
whole request; the response carries
truncated: trueso the caller knows.max_wordsis clamped to 20–800 andstyleis validated againstbullets/paragraph/tldr, so a bad value degrades to the defaultinstead of being interpolated into the prompt verbatim.
to summarize only what it was given and not to add facts.
textreturns 400 naming the field, rather than sending an emptyprompt to the model and returning whatever comes back.
http://llama-server:8080— the manifest's in-networkport, not thepublished
external_port_default, so the request stays onods-network.AI Assistance
AI assisted with drafting the node graph, the prompt wording, and this
description. I chose the endpoint and clamps against the service manifests and
validated the file against the real node package before pushing.
Release Lane
release/2.6.xmainStable hotfix reason:
Changed Surface
(One JSON file under
config/n8n/. It is an import payload for n8n; no ODScode executes it. The catalog entry — id, file, name, description, category,
dependencies — is unchanged.)
Risk And Validation
git diff --checkrelease/2.6.xCommands/results:
Caveat: Docker is not running on my dev host, so I could not stand up
n8n + llama-server and fire a real request end to end. The validation above is
static against the real node definitions — it proves the file imports and that
no node carries an invented parameter or version, but not that the response
flows through the expressions at runtime.
Return Summaryreads$json.choices[0].message.content, the standard OpenAI-compatible chat shapellama.cpp's server returns and the same path
scripts/ods-test-functional.shasserts on. Happy to get a live run on a machine with Docker if you want one
before merging.
Operational Change Check
An import payload for n8n. Nothing in the installer, compose stack,
ods-cli,or dashboard-api executes it — dashboard-api reads only
catalog.jsonfor theWorkflows listing, and the file is handed to n8n's import API when a user
clicks install. No existing install changes until a user imports it.
Notes For Reviewers
Same two open questions as #2496, repeated here so this PR stands alone:
"model": "local-model". llama.cpp ignoresit and serves whatever it was started with. Reading the configured
LLM_MODELinstead would need n8n to have it in its environment, whichcompose.yamldoes not pass today — I would rather send that as its ownchange than smuggle an env addition into a workflow PR.
ods-summarize. No other catalog workflow claims it. Tellme if there is a naming convention for ODS-shipped webhooks.
The 24000-character clamp is a guess at a safe default — it is comfortably
inside a 32K-context tier but wasteful on a 128K one. If you would rather it
scale with
MAX_CONTEXT, that needs the same env plumbing as the model id.