{"record":{"id":"ba3490e2c9b49f9b","repo":"n8n-io/n8n","slug":"video-generation-succeeded-but-no-file-id-was-retu","errorCode":null,"errorMessage":"Video generation succeeded but no file_id was returned","messagePattern":"Video generation succeeded but no file_id was returned","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/vendors/MiniMax/transport/index.ts","lineNumber":70,"sourceCode":"\tpollIntervalMs: number = DEFAULT_POLL_INTERVAL_MS,\n): Promise<{ fileId: string; status: string }> {\n\tfor (let attempt = 0; attempt < MAX_POLL_ATTEMPTS; attempt++) {\n\t\tconst response = await apiRequest.call(this, 'GET', '/query/video_generation', {\n\t\t\tqs: { task_id: taskId },\n\t\t});\n\n\t\tconst status = response?.status as string;\n\n\t\tif (VIDEO_TERMINAL_STATUSES.includes(status)) {\n\t\t\tif (status === 'Fail') {\n\t\t\t\tconst errorCode = response?.base_resp?.status_code || 'UNKNOWN';\n\t\t\t\tconst errorMessage = response?.base_resp?.status_msg || 'Video generation task failed';\n\t\t\t\tthrow new NodeOperationError(this.getNode(), `Task failed: [${errorCode}] ${errorMessage}`);\n\t\t\t}\n\n\t\t\tconst fileId = response?.file_id as string;\n\t\t\tif (!fileId) {\n\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t'Video generation succeeded but no file_id was returned',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn { fileId, status };\n\t\t}\n\n\t\tawait sleep(pollIntervalMs);\n\t}\n\n\tthrow new NodeOperationError(\n\t\tthis.getNode(),\n\t\t`Video task ${taskId} did not complete within the maximum polling time. You can query the task manually using the task ID.`,\n\t);\n}\n\nexport async function getVideoDownloadUrl(","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vendors/MiniMax/transport/index.ts#L52-L88","documentation":"Thrown by pollVideoTask when GET /query/video_generation returns a terminal 'Success' status but response.file_id is missing. An internal inconsistency: MiniMax marked the job succeeded without producing the downloadable file reference the node needs to retrieve the video.","triggerScenarios":"Transient backend inconsistency returning Success with no file_id; API revision moving file_id to a different field; race where status flipped to Success before the file was registered; intermediary proxy stripping the field.","commonSituations":"Rare upstream glitch; non-official base URL filtering the response; degraded backend under high load.","solutions":["Re-query the task by task_id (GET /query/video_generation) — file_id may appear on a subsequent poll.","Log the full response to confirm file_id is absent vs. relocated.","Verify the credentials base URL is the official MiniMax endpoint.","If it persists, resubmit the video generation task."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// No caller-side input prevents an upstream Success-without-file_id inconsistency.\n// The useful pre-check is re-querying the task rather than validating inputs.\n// (See tryCatchPattern for the re-query approach.)","typeGuard":"function isSuccessWithFileId(r: unknown): r is { status: 'Success'; file_id: string } {\n  return (r as { status?: string })?.status === 'Success' &&\n    typeof (r as { file_id?: unknown })?.file_id === 'string' &&\n    ((r as { file_id: string }).file_id.length > 0);\n}","tryCatchPattern":"// After a Success-without-file_id, re-query the same task a few times\n// before giving up — file_id often appears a poll or two later.\nasync function pollForFileId(apiRequest: any, taskId: string, maxRequeries = 3): Promise<string> {\n  for (let i = 0; i < maxRequeries; i++) {\n    const response = await apiRequest.call(this, 'GET', '/query/video_generation', { qs: { task_id: taskId } });\n    if (response?.status === 'Success' && response?.file_id) return response.file_id as string;\n    await sleep(5000);\n  }\n  throw new NodeOperationError(this.getNode(), 'Video generation succeeded but no file_id was returned');\n}","preventionTips":["On Success-without-file_id, re-query the task a few times before treating it as fatal — file registration often lags status.","Log the full response to detect a real API field rename versus a transient gap.","Use the official MiniMax base URL to avoid proxies stripping fields.","If it persists across re-queries, resubmit the video generation task."],"tags":["minimax","video-generation","polling","response-shape","file-id"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}