{"record":{"id":"8a5b9670c5b9c54a","repo":"n8n-io/n8n","slug":"task-taskid-did-not-complete-within-the-maximum","errorCode":null,"errorMessage":"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.","messagePattern":"Task (.+?) did not complete within the maximum polling time\\. Last status was not terminal\\. You can query the task manually using the task ID\\.","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"warning","filePath":"packages/@n8n/nodes-langchain/nodes/vendors/AlibabaCloud/transport/index.ts","lineNumber":97,"sourceCode":"\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":79,"sourceCodeEnd":102,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vendors/AlibabaCloud/transport/index.ts#L79-L102","documentation":"Thrown by pollTaskResult when the polling loop exhausts all MAX_POLL_ATTEMPTS (60) without the task reaching any terminal status (SUCCEEDED, FAILED, or CANCELED). With a default poll interval of 15 seconds, this means the task remained in a non-terminal state (e.g. PENDING, RUNNING) for approximately 15 minutes. The error message includes the taskId so the user can query the task status manually afterward.","triggerScenarios":"A video generation task is still PENDING or RUNNING after 60 poll attempts (≈15 minutes at the default 15-second interval). Video generation can legitimately take longer than this window for complex or high-resolution outputs, especially under high load. The task is not necessarily failed — it simply did not finish within the node's polling budget.","commonSituations":"High-resolution or long-duration video generation exceeding the 15-minute window; DashScope service under heavy load causing slow processing; the poll interval or max attempts are insufficient for the model/output complexity; network issues causing missed status updates.","solutions":["Use the taskId from the error message to manually query the task status later via GET /api/v1/tasks/{taskId} on the DashScope API.","Increase the poll timeout by modifying the pollTaskResult parameters (pollIntervalMs or MAX_POLL_ATTEMPTS in transport/index.ts) if you control the node code.","Retry with a simpler task (lower resolution, shorter duration) to stay within the polling window.","Check the DashScope service status page for ongoing slowness incidents.","Split long video requests into multiple shorter-duration tasks that complete faster."],"exampleFix":"// before — default 60 attempts × 15s = ~15 min budget\nconst result = await pollTaskResult.call(this, taskId);\n\n// after — increase poll budget (requires node code modification)\nconst result = await pollTaskResult.call(this, taskId, 15_000); // but increase MAX_POLL_ATTEMPTS\n// or use the taskId to poll manually after the workflow continues","handlingStrategy":"retry","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('did not complete within the maximum polling time')) {\n    // Extract taskId from error and poll manually in a separate step\n    const taskIdMatch = error.message.match(/Task (\\S+) did not/);\n    const pendingTaskId = taskIdMatch?.[1];\n    // Store taskId for later manual polling via GET /api/v1/tasks/{taskId}\n  }\n  throw error;\n}","preventionTips":["Use simpler video parameters (lower resolution, shorter duration) to reduce generation time within the 15-minute polling window.","If you control the node code, increase MAX_POLL_ATTEMPTS or pollIntervalMs for long-running tasks.","For very long tasks, consider splitting into multiple shorter-duration tasks.","Save the taskId from the error message to manually check task status later via the DashScope API.","Avoid peak-load periods when DashScope processing may be slower."],"tags":["video-generation","async-task","polling","timeout","alibabacloud","dashscope"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}