A CometAPI video task can return an HTTP response successfully and still be a failed job. With n8n’s Never Error enabled, even a non-2xx HTTP response can follow the HTTP Request node’s success path. That path is not permission to mark the video complete.
For example, consider a synthetic polling response with HTTP 200 and a body task state of failed. The HTTP request succeeded, but the CometAPI tutorial’s task-failure branch should record the error in ai_jobs and stop—not finalize the video. A non-2xx response with Never Error enabled needs a different branch: inspect the HTTP failure without assuming the video task itself has reached a terminal state.
For an adaptation of CometAPI’s asynchronous video workflow, use two gates: HTTP status first, task status second.
What the two n8n options change
The n8n HTTP Request documentation defines these separately:
- Never Error: the node returns success regardless of the returned HTTP code, instead of treating only 2xx responses as success.
- Include Response Headers and Status: output includes the body, headers, and HTTP status code rather than only the body.
If you enable Never Error to handle HTTP failures in your own branches, also include the response status. Otherwise, the downstream logic may have only the body to work with. Neither option makes a failed upstream job successful.
Apply it to the CometAPI video polling flow
The official CometAPI n8n tutorial describes an asynchronous video example with these task-state branches: queued or in_progress goes back to Wait; completed proceeds to Finalize Video with a result-URL check; failed or error records the error in ai_jobs and stops. This is an English paraphrase of the Thai tutorial, not a universal response schema for every CometAPI model.
The proposed change is to put an HTTP-status gate before that task-state switch, not replace the switch with the HTTP Request node’s success output.
Before wiring it, have the tutorial’s polling flow and job record available, and inspect the response structure for your chosen endpoint. This is a branching adaptation, not an importable workflow or a tested endpoint recipe.
- On the polling HTTP Request node, enable Never Error and Include Response Headers and Status.
- Inspect the full-response output and map its HTTP status and body into the next branch. Do not blindly reuse body-only expressions: a task
statusor result URL may now need a different path through the response body. - Divert non-2xx responses to a diagnostic/failure-handling path. Do not let them reach Finalize Video or mark
ai_jobscompleted. Missing or unusable HTTP status should also stop normal completion. - Only for a 2xx response, inspect the body’s task status and preserve the tutorial’s branches:
| Task state in the successful response body | Proposed destination |
|---|---|
queued or in_progress |
Wait, then poll again within a separately defined polling limit |
completed, with the required result URL |
Finalize Video |
completed, without the required result URL |
Diagnostic path; do not mark the job completed |
failed or error |
Record the task error in ai_jobs and stop |
| Unknown or missing state | Diagnostic path, not an assumed success |
The HTTP failure path and the terminal task-failure path are different. A non-2xx polling response alone does not establish the video task’s terminal state; it establishes that this response must not drive completion. By contrast, the tutorial explicitly treats a body task state of failed or error as terminal.
Check the branches before using real jobs
Use synthetic response fixtures to check these expected destinations; these are proposed checks, not reported test results:
- Non-2xx with any body → HTTP diagnostic path, never Finalize Video.
- 2xx with
failed→ task error recorded and processing stopped. - 2xx with
queued→ Wait, subject to the polling limit. - 2xx with
completedbut no result URL → diagnostic path. - 2xx with
completedand the expected URL → Finalize Video. - 2xx with an unrecognized state → diagnostic path.
Never Error’s documented behavior concerns returned HTTP codes. Do not assume it also handles timeouts, connection failures, or response-parsing failures; design those paths separately. It does not supply retries, idempotency, or safe resubmission. In particular, do not turn the diagnostic branch into an unconditional new video submission.
The completion rule for this CometAPI adaptation is therefore narrower than “the n8n node succeeded”: require an acceptable HTTP response, the tutorial’s completed task state, and its expected result URL before entering Finalize Video.