n8n-io/n8n · error · NodeOperationError

Video generation succeeded but no file_id was returned

Error message

Video generation succeeded but no file_id was returned

What it means

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.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/vendors/MiniMax/transport/index.ts:70

	pollIntervalMs: number = DEFAULT_POLL_INTERVAL_MS,
): Promise<{ fileId: string; status: string }> {
	for (let attempt = 0; attempt < MAX_POLL_ATTEMPTS; attempt++) {
		const response = await apiRequest.call(this, 'GET', '/query/video_generation', {
			qs: { task_id: taskId },
		});

		const status = response?.status as string;

		if (VIDEO_TERMINAL_STATUSES.includes(status)) {
			if (status === 'Fail') {
				const errorCode = response?.base_resp?.status_code || 'UNKNOWN';
				const errorMessage = response?.base_resp?.status_msg || 'Video generation task failed';
				throw new NodeOperationError(this.getNode(), `Task failed: [${errorCode}] ${errorMessage}`);
			}

			const fileId = response?.file_id as string;
			if (!fileId) {
				throw new NodeOperationError(
					this.getNode(),
					'Video generation succeeded but no file_id was returned',
				);
			}

			return { fileId, status };
		}

		await sleep(pollIntervalMs);
	}

	throw new NodeOperationError(
		this.getNode(),
		`Video task ${taskId} did not complete within the maximum polling time. You can query the task manually using the task ID.`,
	);
}

export async function getVideoDownloadUrl(

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Re-query the task by task_id (GET /query/video_generation) — file_id may appear on a subsequent poll.
  2. Log the full response to confirm file_id is absent vs. relocated.
  3. Verify the credentials base URL is the official MiniMax endpoint.
  4. If it persists, resubmit the video generation task.
Defensive patterns

Strategy: retry

Validate before calling

// No caller-side input prevents an upstream Success-without-file_id inconsistency.
// The useful pre-check is re-querying the task rather than validating inputs.
// (See tryCatchPattern for the re-query approach.)

Type guard

function isSuccessWithFileId(r: unknown): r is { status: 'Success'; file_id: string } {
  return (r as { status?: string })?.status === 'Success' &&
    typeof (r as { file_id?: unknown })?.file_id === 'string' &&
    ((r as { file_id: string }).file_id.length > 0);
}

Try / catch

// After a Success-without-file_id, re-query the same task a few times
// before giving up — file_id often appears a poll or two later.
async function pollForFileId(apiRequest: any, taskId: string, maxRequeries = 3): Promise<string> {
  for (let i = 0; i < maxRequeries; i++) {
    const response = await apiRequest.call(this, 'GET', '/query/video_generation', { qs: { task_id: taskId } });
    if (response?.status === 'Success' && response?.file_id) return response.file_id as string;
    await sleep(5000);
  }
  throw new NodeOperationError(this.getNode(), 'Video generation succeeded but no file_id was returned');
}

Prevention

When it happens

Trigger: 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.

Common situations: Rare upstream glitch; non-official base URL filtering the response; degraded backend under high load.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/ba3490e2c9b49f9b. Report an issue: GitHub.