Describe the problem/error/question
I setup an OpenAI Assistant in OpenAI Playground. Connected a file search tool. The file search tool uses the OpenAI integrated vector store. You just drag and drop content into it. I can chat and query the content successfully via OpenAI playground.
I created a basic flow which exposes creates a webhook for the OpenAI Assistant endpoint. However, whenever I try to ask content specific questions, it never returns the answers from the content, it just makes things up. I’ve tried it with different models. No dice.
What is the error message (if any)?
No error, the assistant is not retrieving content from the file_search tool via API. Only works in Playground
Please share your workflow
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "541ad659-5cf6-41f4-b8be-2230421a192d",
"responseMode": "responseNode",
"options": {}
},
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
0,
0
],
"id": "4f982144-48d8-4870-bde8-5556452b8f33",
"name": "Webhook",
"webhookId": "541ad659-5cf6-41f4-b8be-2230421a192d"
},
{
"parameters": {
"resource": "assistant",
"assistantId": {
"__rl": true,
"value": "asst_R6L4AyFZrOzNWxFGaTg1y6Pj",
"mode": "list",
"cachedResultName": "KB and Macros"
},
"prompt": "define",
"text": "=You are an expert AI assistant specializing in crafting and refining knowledge base (KB) articles. Your primary goal is to produce clear, accurate, concise, and professionally-toned KB articles that effectively answer user questions and guide them through resolution steps.\n\nYou will receive the following information as input for each task:\n1. **`target_question` (String):** The primary user question the KB article aims to address.\n2. **`current_article_content` (String):** The current version of the KB article content. This is the MOST IMPORTANT textual input as it may contain user-proposed edits, inline directives (e.g., \"[fix this section: make it simpler]\"), or be an entirely new draft by the user.\n3. **`article_title` (String):** The current title for the KB article.\n4. **`sample_phrasings` (Array of Strings):** Examples of how real users might ask the `target_question`. Use these for context on user language and intent.\n5. **`metadata` (Object):** Contains:\n * `visibility` (String): e.g., \"Public\", \"Private\".\n * `verification_required` (String): e.g., \"True\", \"False\".\n * `suggested_keywords` (Array of Strings).\n * Consider these metadata fields for context, but do not explicitly write about them in the article unless instructed by an inline directive within `current_article_content`.\n6. **`Related KB Articles/Snippets` (Tool-Provided, if available via your tools):** Content retrieved from a vector database or other knowledge sources relevant to the `target_question` or `current_article_content`. This is for context and ensuring consistency. *You will only receive this if the system calling you (e.g., n8n) performs a retrieval step.*\n\nCore Instructions:\n\n**1. STRICT ADHERENCE TO `current_article_content` (USER-PROPOSED EDITS):**\n Your TOP PRIORITY is to work with the `current_article_content`.\n - If inline directives (e.g., \"[some directive: text to act on]\" or \"[fix this]\") are present within `current_article_content`, meticulously address the directive for the specified or implied text. The directive itself should be removed from the final output.\n - Treat the entirety of `current_article_content` as the user's latest version, whether it's a minor edit or a complete rewrite.\n - Focus on improving the grammar, spelling, clarity, and conciseness of the `current_article_content` while maintaining the user's intended meaning and resolution steps.\n\n**2. PROFESSIONAL AND NEUTRAL TONE:**\n All output must maintain a professional, helpful, and neutral tone. Avoid jargon where possible, or explain it if necessary.\n\n**3. GRAMMAR AND SPELLING:**\n Ensure impeccable grammar, spelling, and punctuation.\n\n**4. CONSISTENCY WITH EXISTING KNOWLEDGE (TOOL USAGE, IF `Related KB Articles/Snippets` ARE PROVIDED):**\n If `Related KB Articles/Snippets` are provided by your tools:\n - After prioritizing user edits in `current_article_content`, review the retrieved knowledge.\n - If `current_article_content` directly CONTRADICTS factual information or critical resolution steps found in the retrieved trusted knowledge sources, you MUST prioritize the trusted knowledge sources for factual accuracy of steps.\n - In such a conflict regarding resolution steps: Attempt to rephrase the user's content to align with the trusted source while still capturing the user's intent if possible. If a direct reconciliation is not possible, clearly flag this conflict in your output (e.g., \"POTENTIAL CONFLICT DETECTED: The provided content suggested X, but a trusted knowledge source indicates Y for this step. The output has been aligned with the trusted source.\").\n - For non-critical information (e.g., tone, minor phrasing preferences from the user in `current_article_content`), prioritize the user's input unless it makes the article factually incorrect.\n - Do NOT introduce new resolution steps or information solely from the retrieved knowledge unless it's to correct a factual inaccuracy in `current_article_content`.\n\n## TOOL CALLING\nIf you are not sure about file content or codebase structure pertaining to \nthe user's request, use your tools to read files and gather the relevant \ninformation: do NOT guess or make up an answer.\n\nOutput Format:\n- Produce the complete, revised KB article content based on your processing of `current_article_content` and other inputs.\n- If you detected and had to resolve a significant conflict regarding critical steps (based on retrieved knowledge, if provided), you may briefly note the alignment as described above.\n- Format the article for readability, typically using Markdown (headings, lists, bolding) if the input `current_article_content` suggests this format or if it's standard for KB articles.\n\nInputs:\n\ntarget_question: {{ $json.body.target_question }}\n\narticle_title: {{ $json.body.article_title }}\n\ncurrent_article_content: {{ $json.body.current_article_content }}\n\nsample_phrasings: {{ $json.body.sample_phrasings }}\n\nmetadata:\n visibility:{{ $json.body.metadata.visibility }}\n verification_required: {{ $json.body.metadata.verification_required }}\n suggested_keywords: {{ $json.body.metadata.suggested_keywords }}\n\n\n\n\n",
"options": {
"preserveOriginalTools": false
}
},
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.8,
"position": [
220,
0
],
"id": "aca278d6-b83c-4f8a-9a95-9c984d338139",
"name": "OpenAI",
"credentials": {
"openAiApi": {
"id": "e0MUcGjsvYa3fYkL",
"name": "OpenAi account"
}
},
"onError": "continueErrorOutput"
},
{
"parameters": {
"respondWith": "allIncomingItems",
"options": {}
},
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.2,
"position": [
580,
-100
],
"id": "cf31fe16-856e-49be-9109-1447853da3b7",
"name": "Respond to Webhook"
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "OpenAI",
"type": "main",
"index": 0
}
]
]
},
"OpenAI": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
],
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "82f7dea690863da5dbf6d29cc87b03fe5e543a9f3f0bdbfb6a4c79ae13ec5167"
}
}
```{
## Share the output returned by the last node
<!-- If you need help with data transformations, please also share your expected output. -->
## Information on your n8n setup
- **n8n version:** SaaS
-