n8n-io/n8n · error · NodeOperationError

No task_id returned from video generation request

Error message

No task_id returned from video generation request

What it means

Thrown by the t2v video operation when POST /video_generation returned success (status_code 0) but createResponse.task_id is missing. Same response-shape inconsistency as error 869 but on the text-to-video path; the node cannot poll without a task_id and aborts.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/vendors/MiniMax/actions/video/generate.t2v.operation.ts:150

	if (options.promptOptimizer !== undefined) {
		body.prompt_optimizer = options.promptOptimizer;
	}

	const createResponse = (await apiRequest.call(this, 'POST', '/video_generation', {
		body,
	})) as VideoGenerationResponse;

	if (createResponse.base_resp?.status_code !== 0) {
		throw new NodeOperationError(
			this.getNode(),
			`Failed to create video task: ${createResponse.base_resp?.status_msg || 'Unknown error'}`,
		);
	}

	const taskId = createResponse.task_id;
	if (!taskId) {
		throw new NodeOperationError(
			this.getNode(),
			'No task_id returned from video generation request',
		);
	}

	const { fileId } = await pollVideoTask.call(this, taskId);
	const videoUrl = await getVideoDownloadUrl.call(this, fileId);

	const jsonData: IDataObject = {
		videoUrl,
		taskId,
		fileId,
	};

	if (downloadVideo && videoUrl) {
		const videoResponse = await this.helpers.httpRequest({
			method: 'GET',
			url: videoUrl,

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Retry the create request.
  2. Log the full createResponse to confirm task_id absence.
  3. Verify the credentials base URL is the official MiniMax endpoint.
  4. If recurring, report to MiniMax with the response body.
Defensive patterns

Strategy: retry

Validate before calling

// No caller-side input prevents an upstream success-without-task_id glitch.
// Validate only the request shape before sending.
function validateT2vRequestShape(body: IDataObject): string | null {
  if (typeof body.prompt !== 'string' || body.prompt.length === 0) return 'body.prompt must be a non-empty string';
  if (typeof body.model !== 'string') return 'body.model is required';
  return null;
}

Type guard

function hasTaskId(r: unknown): r is { task_id: string } {
  return typeof (r as { task_id?: unknown })?.task_id === 'string' &&
    ((r as { task_id: string }).task_id.length > 0);
}

Try / catch

async function createT2vWithRetry(apiRequest: any, body: IDataObject, maxAttempts = 3): Promise<string> {
  for (let attempt = 0; attempt < maxAttempts; attempt++) {
    const createResponse = (await apiRequest.call(this, 'POST', '/video_generation', { body })) as VideoGenerationResponse;
    if (createResponse.base_resp?.status_code !== 0) {
      throw new NodeOperationError(this.getNode(), `Failed to create video task: ${createResponse.base_resp?.status_msg || 'Unknown error'}`);
    }
    if (createResponse.task_id) return createResponse.task_id;
    await sleep(1000 * (attempt + 1));
  }
  throw new NodeOperationError(this.getNode(), 'No task_id returned from video generation request');
}

Prevention

When it happens

Trigger: Transient backend inconsistency returning success without task_id; API revision relocating the field; proxy stripping the field; truncated response under load.

Common situations: Rare upstream glitch; non-official base URL filtering the response.

Related errors


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