{"record":{"id":"269b273f02bbc6e9","repo":"FlowiseAI/Flowise","slug":"assistant-selectedassistantid-not-found","errorCode":null,"errorMessage":"Assistant ${selectedAssistantId} not found","messagePattern":"Assistant (.+?) not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/agents/OpenAIAssistant/OpenAIAssistant.ts","lineNumber":238,"sourceCode":"                    streamResponse(sseStreamer, chatId, e.message)\n                }\n                return formatResponse(e.message)\n            }\n        }\n\n        let tools = nodeData.inputs?.tools\n        tools = flatten(tools)\n        const formattedTools = tools?.map((tool: any) => formatToOpenAIAssistantTool(tool)) ?? []\n\n        const usedTools: IUsedTool[] = []\n        const fileAnnotations = []\n        const artifacts = []\n\n        const assistant = await appDataSource.getRepository(databaseEntities['Assistant']).findOneBy({\n            id: selectedAssistantId\n        })\n\n        if (!assistant) throw new Error(`Assistant ${selectedAssistantId} not found`)\n\n        const credentialData = await getCredentialData(assistant.credential ?? '', options)\n        const openAIApiKey = getCredentialParam('openAIApiKey', credentialData, nodeData)\n        if (!openAIApiKey) throw new Error(`OpenAI ApiKey not found`)\n\n        const openai = new OpenAI({ apiKey: openAIApiKey })\n\n        // Start analytics\n        const analyticHandlers = AnalyticHandler.getInstance(nodeData, options)\n        await analyticHandlers.init()\n        const parentIds = await analyticHandlers.onChainStart('OpenAIAssistant', input)\n\n        try {\n            const assistantDetails = JSON.parse(assistant.details)\n            const openAIAssistantId = assistantDetails.id\n\n            // Retrieve assistant\n            const retrievedAssistant = await openai.beta.assistants.retrieve(openAIAssistantId)","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/agents/OpenAIAssistant/OpenAIAssistant.ts#L220-L256","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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>'`."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const repo = appDataSource.getRepository(databaseEntities['Assistant'])\nconst exists = await repo.exist({ where: { id: selectedAssistantId } })\nif (!exists) throw new Error(`No assistant found in this environment for id ${selectedAssistantId}; create or import it first.`)","typeGuard":null,"tryCatchPattern":"try {\n  await assistantNode.run(nodeData, input, options)\n} catch (e) {\n  if (/Assistant .* not found/.test((e as Error).message)) refreshAssistantBinding()\n  throw e\n}","preventionTips":["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."],"tags":["agent","openai-assistant","not-found","database","config"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}