Bug Description
We've been experimenting with the much appreciated new streaming feature.
However, when streaming is enabled, Postgres Chat Memory node fails to respect contextWindowLength, storing unlimited conversation history instead of the given limit.
Environment
@n8n/n8n-nodes-langchain.memoryPostgresChat v1.3
- PostgreSQL database
- Affects: AI Agent + Webhook streaming combination
To Reproduce
-
Create workflow with:
- Webhook:
responseMode: "streaming"
- AI Agent:
enableStreaming: true
- Postgres Chat Memory:
contextWindowLength: 2
-
Send 5+ messages with same sessionId
-
Verify AI responses reference messages beyond 2-message limit
Results:
- ❌ Webhook streaming: Ignores context limit
- ✅ Webhook responseNode: Works correctly, respects limit
- ✅ Chat Trigger: Works correctly, respects limit
Expected behavior
Expected: Memory limited to specified most recent interactions
Actual: Unlimited conversation history available to AI Agent
Debug Info
Debug info
core
- n8nVersion: 1.105.2
- platform: docker (cloud)
- nodeJsVersion: 22.17.0
- database: sqlite
- executionMode: regular
- concurrency: 5
- license: community
- consumerId: 00000000-0000-0000-0000-000000000000
storage
- success: all
- error: all
- progress: false
- manual: true
- binaryMode: filesystem
pruning
- enabled: true
- maxAge: 168 hours
- maxCount: 2500 executions
client
- userAgent: mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36 (khtml, like gecko) chrome/138.0.0.0 safari/537.36
- isTouchDevice: false
Generated at: 2025-08-05T19:37:36.564Z
Operating System
macintosh
n8n Version
1.105.2
Node.js Version
22.17.0
Database
PostgreSQL
Execution mode
main (default)
Hosting
n8n cloud
Bug Description
We've been experimenting with the much appreciated new streaming feature.
However, when streaming is enabled, Postgres Chat Memory node fails to respect
contextWindowLength, storing unlimited conversation history instead of the given limit.Environment
@n8n/n8n-nodes-langchain.memoryPostgresChatv1.3To Reproduce
Create workflow with:
responseMode: "streaming"enableStreaming: truecontextWindowLength: 2Send 5+ messages with same
sessionIdVerify AI responses reference messages beyond 2-message limit
Results:
Expected behavior
Expected: Memory limited to specified most recent interactions
Actual: Unlimited conversation history available to AI Agent
Debug Info
Debug info
core
storage
pruning
client
Generated at: 2025-08-05T19:37:36.564Z
Operating System
macintosh
n8n Version
1.105.2
Node.js Version
22.17.0
Database
PostgreSQL
Execution mode
main (default)
Hosting
n8n cloud