Runway waitForTaskOutput timeout does not cancel the task

Runway's waitForTaskOutput gives up after ten minutes but the task keeps running and billing. How to cancel on timeout, and the same rule on Sume jobs.

5 min readSume
All posts

Runway's SDK helper waitForTaskOutput waits ten minutes by default and then throws a timeout error, but the page is explicit that hitting the timeout, or triggering the abort signal, does not cancel the task. You must call the cancellation endpoint yourself. A Sume client has the same trap: stopping your wait does not stop the job, so call cancel.

What Runway says

The Node page says the default is ten minutes, null waits forever and that is not recommended because your server can hang if the project hits its concurrency limit or Runway has an outage. In a web handler it recommends an abort signal tied to the request. The Python page repeats the same: the default timeout is ten minutes, and on timeout the task will not be cancelled.

Timeout behavior, read 2026-10-02
EventTask state afterwards
Default timeout reached (10 min)Task keeps running
Abort signal firedTask keeps running
Cancellation endpoint calledTask canceled

The same trap on Sume

Sume's Jobs API has POST /v1/jobs/{id}/cancel, and the job states include canceled. Dropping an HTTP connection, ending a polling loop or closing a browser tab does not cancel anything. If you want a job to stop, send the cancel request and then read the final state.

A safe timeout handler

Write the timeout handler once and use it in both integrations:

  • On timeout, send the cancel request before you return an error.
  • Read the job once more: it may have finished while you were canceling.
  • Store the task or job id so a later sweep can cancel orphans.
  • Do not disable the timeout to make an error go away.

Races are normal

A cancel on a task that already finished is a normal race, not an incident. Treat the final state you read as the truth, and bill and deliver from that.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume