{"record":{"id":"b151565c217936a9","repo":"n8n-io/n8n","slug":"video-generation-task-was-canceled","errorCode":null,"errorMessage":"Video generation task was canceled","messagePattern":"Video generation task was canceled","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"warning","filePath":"packages/@n8n/nodes-langchain/nodes/vendors/AlibabaCloud/transport/index.ts","lineNumber":86,"sourceCode":"\tthis: IExecuteFunctions,\n\ttaskId: string,\n\tpollIntervalMs: number = DEFAULT_POLL_INTERVAL_MS,\n): Promise<IDataObject> {\n\tfor (let attempt = 0; attempt < MAX_POLL_ATTEMPTS; attempt++) {\n\t\tconst response = await apiRequest.call(this, 'GET', `/api/v1/tasks/${taskId}`);\n\n\t\tconst taskStatus = response?.output?.task_status as string;\n\n\t\tif (TERMINAL_STATUSES.includes(taskStatus)) {\n\t\t\tif (taskStatus === 'FAILED') {\n\t\t\t\tconst errorCode = response?.output?.code || response?.code || 'UNKNOWN';\n\t\t\t\tconst errorMessage =\n\t\t\t\t\tresponse?.output?.message || response?.message || '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\tif (taskStatus === 'CANCELED') {\n\t\t\t\tthrow new NodeOperationError(this.getNode(), 'Video generation task was canceled');\n\t\t\t}\n\n\t\t\t// SUCCEEDED\n\t\t\treturn response as IDataObject;\n\t\t}\n\n\t\t// Wait before next poll\n\t\tawait sleep(pollIntervalMs);\n\t}\n\n\tthrow new NodeOperationError(\n\t\tthis.getNode(),\n\t\t`Task ${taskId} did not complete within the maximum polling time. Last status was not terminal. You can query the task manually using the task ID.`,\n\t);\n}\n","sourceCodeStart":68,"sourceCodeEnd":102,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vendors/AlibabaCloud/transport/index.ts#L68-L102","documentation":"Thrown by pollTaskResult when the AlibabaCloud DashScope task API returns a terminal status of 'CANCELED'. The polling loop detects this status and throws immediately with a fixed message. A CANCELED status means the task was explicitly terminated before completion — either by the user, by an administrator, or by the platform's internal timeout/cleanup process.","triggerScenarios":"The video generation task was canceled after creation but before reaching SUCCEEDED. This can happen if the task was manually canceled via the DashScope console or API, if the Alibaba Cloud platform canceled it due to resource constraints or policy, or if the associated account/subscription was modified during task processing.","commonSituations":"Task exceeded an internal platform timeout; account quota or subscription changed mid-task; manual cancellation via DashScope console; platform resource contention causing preemption.","solutions":["Check the DashScope console for the task's cancellation reason if available.","Retry the video generation — if it was a transient platform cancellation, a new task may succeed.","Verify the account's DashScope subscription and quota are still active.","If cancellations are recurring, reduce task complexity (lower resolution, shorter duration) or check for account-level restrictions."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const result = await pollTaskResult.call(this, taskId);\n  // ... process result ...\n} catch (error) {\n  if (error instanceof NodeOperationError && error.message.includes('was canceled')) {\n    // task was canceled — retry or notify the user\n    console.warn(`Video task ${taskId} was canceled. Retrying...`);\n    // optionally re-create the task\n  }\n  throw error;\n}","preventionTips":["Check the DashScope console for the cancellation reason if tasks are canceled frequently.","Ensure the Alibaba Cloud account/subscription is active and in good standing.","Retry canceled tasks — platform-initiated cancellations are often transient.","Reduce task complexity to minimize processing time and cancellation risk."],"tags":["video-generation","async-task","polling","alibabacloud","dashscope","canceled"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}