diff --git a/src/backend/langflow/api/chat_manager.py b/src/backend/langflow/api/chat_manager.py index cafa6bb5f..e52e99832 100644 --- a/src/backend/langflow/api/chat_manager.py +++ b/src/backend/langflow/api/chat_manager.py @@ -124,7 +124,8 @@ class ChatManager: history = self.chat_history.get_history(client_id, filter=False) file_responses = [] if history: - for msg in history: + # Iterate backwards through the history + for msg in reversed(history): if isinstance(msg, FileResponse): file_responses.append(msg) if msg.type == "start":