# Ask Questions About Workflow Data

Source: https://openflow.run/en/templates/ask-questions-about-workflow-data/
Content language: en
Template revision: d291811835b4d4defcd934c79186ed436e74219f

AI

Ask a question and answer it with verified excerpts from records returned by a configured workflow.

[Use in Open Flow](https://console.openflow.run/flows?importUrl=https%3A%2F%2Fraw.githubusercontent.com%2Foomol-lab%2Fawesome-workflow-templates%2Fd291811835b4d4defcd934c79186ed436e74219f%2Fworkflows%2Fask-questions-about-workflow-data%2Ftemplates%2Fask-questions-about-workflow-data.openflow.json)

*   [Open Flow JSON](https://github.com/oomol-lab/awesome-workflow-templates/blob/d291811835b4d4defcd934c79186ed436e74219f/workflows/ask-questions-about-workflow-data/templates/ask-questions-about-workflow-data.openflow.json)
*   [n8n JSON](https://github.com/oomol-lab/awesome-workflow-templates/blob/d291811835b4d4defcd934c79186ed436e74219f/workflows/ask-questions-about-workflow-data/templates/ask-questions-about-workflow-data.n8n.json)

![Ask Questions About Workflow Data workflow in Open Flow](https://openflow.run/template-previews/ask-questions-about-workflow-data/light.webp)

Ask a question and answer it with verified excerpts from records returned by a configured workflow.

## Setup

1.  Import the workflow bundle. Open **Find Business Documents** and set the `records` input on **Search configured records** to an array of records you may share with OpenAI. Each record is a JSON object. The bundled worker searches for words from the question in the records. It starts with an empty list.
2.  To query your own data source, replace the search step inside **Find Business Documents** with a read from that source. Keep the Start input `query` as a string and the workflow output `documents` as an array of objects. Return one object per record in the order you want it presented.
3.  Publish **Find Business Documents**. In **Ask Questions About Workflow Data**, refresh the published workflow capability in **Retrieve workflow documents** and set the OpenAI connection in **Verify answer excerpts**.
4.  Run **Enter a question** manually with your question. Open **Return the answer** to see the result.

## Behavior

The workflow sends your question to the configured worker. When records are returned, OpenAI selects excerpts and the workflow checks each quote against the cited record. Sources are numbered in worker output order. An empty result yields `no_documents` without calling OpenAI. If the returned documents contain no answer, the result is `insufficient_evidence`. A worker error or an invalid model response fails the run.

Questions can be up to 2,000 characters. Each query can return up to 30 documents, within 60,000 characters of serialized documents and their numbering. Narrow the question or scope of the worker if the results exceed those limits. Include only fields the question needs and that you are authorized to share.

In n8n

Import the JSON. In **Retrieve workflow documents**, select a saved, authorized workflow as the database source and allow this caller to invoke it. Its Execute Sub-workflow Trigger must accept a string field named `query` or accept all input data. If the input mapper displays a `query` field, set it to `{{ $json.query }}`. Return one JSON object per document on the worker’s final output. Return zero items for a search with no results.

Set the question in **Enter a question**. In **Select evidence with OpenAI**, attach an HTTP Header Auth credential with the header `Authorization` and the value `Bearer YOUR_OPENAI_API_KEY`. Run the caller manually. It waits for the local worker and returns the same answer fields.

Inspiration & credits

## Changes to the source

*   Provide an editable business data worker for Open Flow. The n8n caller selects an authorized worker on the same instance.
*   Verify cited excerpts against the original records and return a clear result when retrieval finds zero records.

Adapted from [AI: Ask questions about any data source (using the n8n workflow retriever)](https://n8n.io/workflows/1958-ai-ask-questions-about-any-data-source-using-the-n8n-workflow-retriever/) by the n8n Team, collected in [enescingoz/awesome-n8n-templates](https://github.com/enescingoz/awesome-n8n-templates). [Fixed source workflow](https://github.com/enescingoz/awesome-n8n-templates/blob/827110332c21cbe000ab13f6d292d5adb1f1f8db/OpenAI_and_LLMs/AI_%20Ask%20questions%20about%20any%20data%20source%20\(using%20the%20n8n%20workflow%20retriever\).json).

Source collection notice: © 2024–2026 Enes Cingoz, [CC BY 4.0](https://github.com/enescingoz/awesome-n8n-templates/blob/827110332c21cbe000ab13f6d292d5adb1f1f8db/LICENSE). This adaptation includes the changes above. See [repository licensing](https://github.com/oomol-lab/awesome-workflow-templates/blob/d291811835b4d4defcd934c79186ed436e74219f/README.md#licensing).

## Apps used

*   [**OpenAI**`openai`](https://openflow.run/en/integrations/openai.md)

## What you’ll need

*   OpenAI connection
*   Business records you have permission to retrieve and send to OpenAI

*   ai
*   openai
*   document retrieval
*   question answering

[View on GitHub](https://github.com/oomol-lab/awesome-workflow-templates/blob/d291811835b4d4defcd934c79186ed436e74219f/workflows/ask-questions-about-workflow-data/README.md)
