Comfy Ui api automation

Title: API automation cannot retrieve SaveVideo output although video is generated in ComfyUI UI

Hi, I’m trying to automate a WanCamera Image-to-Video workflow via the ComfyUI HTTP API.

What works:

  • Workflow runs successfully in the UI

  • Video is generated and saved correctly via SaveVideo

  • Video is visible in ComfyUI output/assets

  • GPU is A100 and generation completes

What fails:

  • When polling /history/{prompt_id}, the job sometimes:

    • never returns the SaveVideo node output

    • or /history times out after several minutes

  • Attempting to download via /view?filename=... often results in 404 / timeout

  • This happens even though the video is already saved and visible in the UI

Notes:

  • I am queuing the workflow using /prompt

  • Polling /history/{prompt_id} until completion

  • Looking specifically for the SaveVideo node output

  • This is consistent across runs (not intermittent)

Question:
Is there a reliable API-supported way to:

  1. Detect that SaveVideo has completed

  2. Programmatically retrieve the final video file

  3. Or query ComfyUI’s output directory directly via API

If this is a known limitation of /history or SaveVideo, guidance would really help.

Thanks!