No max tokens limit in n8n
- Feb 12
- 1 min read
Updated: Feb 13
What this means (non-technical)
If you do not set a maximum token limit for an AI node, the model can generate very long responses. The AI will continue generating until it reaches its internal limit or decides to stop.
You are charged for all generated tokens.
What usually goes wrong
Without a limit:
A short task may produce a very long response.
Costs become unpredictable.
Workflows take longer to finish.
Large outputs may break downstream nodes expecting shorter text.
This is especially risky inside loops or high-volume workflows.
You lose cost control and response predictability.
When this becomes urgent
This becomes urgent when:
The workflow runs frequently.
The AI output is not tightly constrained.
You operate under a fixed AI budget.
Long outputs cause downstream processing issues.
The more calls you make, the more unpredictable spending becomes.
Detect issues in your n8n workflows
|
Definitions
max_tokens: A setting that limits how many tokens an AI model can generate in its response.
Context window: The maximum amount of text an AI model can process or produce in a single request.
Disclaimer
This article highlights common patterns and risks seen in real-world n8n workflows. It’s meant to help you build more confidently and avoid surprises as your automation grows. Behavior can vary depending on your setup, version, and configuration.