Skip to content

Flowise AgentFlow V2 Not Returning sourceDocuments from Chatflow #5949

@abdelhafid-cloud

Description

@abdelhafid-cloud

Describe the bug

When a Chatflow that uses RAG is executed directly in Flowise, the response correctly includes the retrieved document sources (sourceDocuments). However, when the same Chatflow is called inside an AgentFlow V2 using the Execute Flow node, the sources are no longer returned.

The Chatflow itself works correctly:

  • It uses Cohere Embeddings and Qdrant as the vector database.
  • RAG retrieval works as expected.
  • When tested directly, the response includes the associated sourceDocuments.
  • But when the Chatflow is executed through AgentFlow V2 → Execute Flow:
  • The Chatflow runs successfully.
  • The text response is returned correctly.
  • The sourceDocuments field is missing from the response.

As a result, the RAG sources are lost when the Chatflow is executed from AgentFlow V2, even though they are available when running the Chatflow directly.

To Reproduce

  1. Create a Chatflow in Flowise that uses:
  • Cohere Embeddings

  • Qdrant Vector Database

  • A RAG pipeline that retrieves documents.

  1. Test the Chatflow directly in the Flowise chat interface.

  2. Ask a question related to the indexed documents.

  3. Observe that the response includes the retrieved sourceDocuments.

  4. Create an AgentFlow V2.

  5. Add an Execute Flow node and configure it to call the previously created Chatflow.

  6. Run the AgentFlow and ask the same question.

  7. Observe the response returned by the agent.

Result:
The response text is returned correctly, but the sourceDocuments field is missing.

Expected behavior

When a Chatflow that performs RAG retrieval is executed inside AgentFlow V2 using the Execute Flow node, the response should include the same sourceDocuments as when the Chatflow is executed directly.

The AgentFlow should propagate the full response from the Chatflow, including:

  • The generated text response
  • The retrieved sourceDocuments (RAG sources)

This would allow the agent to preserve and use document sources even when the Chatflow is called as part of an AgentFlow.

Screenshots

No response

Flow

No response

Use Method

None

Flowise Version

3.0.4

Operating System

None

Browser

None

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions