Describe the bug
The GET /api/v1/chatmessage/:id endpoint does not respect the limit and page query parameters when the chatflow is of type AgentFlow. Regardless of the values sent, the API returns the full set of messages for the given period in every response, causing data duplication when iterating over pages.
The same request works correctly for Chatflow type chatflows, where pagination behaves as expected.
To Reproduce
- Create an AgentFlow chatflow and generate some messages
- Fetch total message count via GET /api/v1/stats/:id with a startDate and endDate
- Calculate total pages: totalPages = Math.ceil(totalMessages / limit)
- Request page 1: GET /api/v1/chatmessage/:id?startDate=...&endDate=...&order=ASC&page=1&limit=100
- Request page 2: GET /api/v1/chatmessage/:id?...&page=2&limit=100
- Observe that both responses return the same full dataset (e.g. 138 messages on both pages)
Expected behavior
The endpoint should respect limit and page for AgentFlow chatflows, consistent with how it already behaves for Chatflow chatflows.
Screenshots
No response
Flow
No response
Use Method
Docker
Flowise Version
3.1.1
Operating System
Windows
Browser
Chrome
Additional context
Tested with a Chatflow chatflow using the same parameters — pagination works correctly
The issue appears to be isolated to AgentFlow type chatflows
Workaround: remove pagination and fetch all messages in a single request (acceptable for low message volumes, but not scalable)
Describe the bug
The GET /api/v1/chatmessage/:id endpoint does not respect the limit and page query parameters when the chatflow is of type AgentFlow. Regardless of the values sent, the API returns the full set of messages for the given period in every response, causing data duplication when iterating over pages.
The same request works correctly for Chatflow type chatflows, where pagination behaves as expected.
To Reproduce
Expected behavior
The endpoint should respect limit and page for AgentFlow chatflows, consistent with how it already behaves for Chatflow chatflows.
Screenshots
No response
Flow
No response
Use Method
Docker
Flowise Version
3.1.1
Operating System
Windows
Browser
Chrome
Additional context
Tested with a Chatflow chatflow using the same parameters — pagination works correctly
The issue appears to be isolated to AgentFlow type chatflows
Workaround: remove pagination and fetch all messages in a single request (acceptable for low message volumes, but not scalable)