FlowiseAI/Flowise · error · Error
Assistant ${selectedAssistantId} not found
Error message
Assistant ${selectedAssistantId} not found What it means
OpenAIAssistant agent looks up the configured assistant by id in the local `Assistant` repository (the Flowise-stored assistant record, not OpenAI). If `findOneBy({ id: selectedAssistantId })` returns null, the node throws — the assistant was deleted or the id is wrong before any OpenAI call is made.
Source
Thrown at packages/components/nodes/agents/OpenAIAssistant/OpenAIAssistant.ts:238
streamResponse(sseStreamer, chatId, e.message)
}
return formatResponse(e.message)
}
}
let tools = nodeData.inputs?.tools
tools = flatten(tools)
const formattedTools = tools?.map((tool: any) => formatToOpenAIAssistantTool(tool)) ?? []
const usedTools: IUsedTool[] = []
const fileAnnotations = []
const artifacts = []
const assistant = await appDataSource.getRepository(databaseEntities['Assistant']).findOneBy({
id: selectedAssistantId
})
if (!assistant) throw new Error(`Assistant ${selectedAssistantId} not found`)
const credentialData = await getCredentialData(assistant.credential ?? '', options)
const openAIApiKey = getCredentialParam('openAIApiKey', credentialData, nodeData)
if (!openAIApiKey) throw new Error(`OpenAI ApiKey not found`)
const openai = new OpenAI({ apiKey: openAIApiKey })
// Start analytics
const analyticHandlers = AnalyticHandler.getInstance(nodeData, options)
await analyticHandlers.init()
const parentIds = await analyticHandlers.onChainStart('OpenAIAssistant', input)
try {
const assistantDetails = JSON.parse(assistant.details)
const openAIAssistantId = assistantDetails.id
// Retrieve assistant
const retrievedAssistant = await openai.beta.assistants.retrieve(openAIAssistantId)View on GitHub (pinned to abe4a8601a)
Solutions
- Open Assistants management and confirm an assistant with that id exists in this environment.
- Re-select the assistant in the agent node's parameter to refresh the stored id.
- If the assistant was deleted, recreate it and rebind the node.
- If migrating between environments, export/import the assistant record alongside the flow.
- Check the DB directly: `SELECT id FROM assistant WHERE id = '<id>'`.
Defensive patterns
Strategy: validation
Validate before calling
const repo = appDataSource.getRepository(databaseEntities['Assistant'])
const exists = await repo.exist({ where: { id: selectedAssistantId } })
if (!exists) throw new Error(`No assistant found in this environment for id ${selectedAssistantId}; create or import it first.`) Try / catch
try {
await assistantNode.run(nodeData, input, options)
} catch (e) {
if (/Assistant .* not found/.test((e as Error).message)) refreshAssistantBinding()
throw e
} Prevention
- Re-select the assistant in the node after environment migrations.
- Export assistant records together with flows that reference them.
- Avoid hard-coding assistant ids; let the picker store them.
- Before runtime, verify the id exists via the Assistants API/UI.
When it happens
Trigger: selectedAssistantId refers to an assistant record that was deleted, the workspace/database was reset, the id was hand-edited, or a flow was imported into an environment that lacks that assistant row.
Common situations: Assistant deleted via UI after the agent node was configured; environment mismatch (dev flow pointing at a prod-only assistant id); DB migration lost rows; typo/paste error in the id.
Related errors
- OpenAI ApiKey not found
- Error executing tool. Tool: ${tool.name}. Thread ID: ${threa
- Error submitting tool outputs. Thread ID: ${threadId}. Run I
- Error processing thread: ${state}, Thread ID: ${threadId}
- ${error}
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/269b273f02bbc6e9.
Report an issue: GitHub.