Wait For A Hedra Job To Finish
hedra_wait_for_jobPoll a Hedra job until it completes or fails, then return the full result. Simplifies waiting without custom polling code.
Instructions
Poll a job until it reaches COMPLETED or FAILED (or the timeout elapses), then return the full result in one call. This is the simplest way to generate-and-wait without managing your own poll loop.
For batches of jobs, call this once per job_id rather than trying to wait on several at once — there is no multi-job wait tool by design, to keep timeout/backoff behavior predictable per job.
Args:
job_id (string, required): the job id from hedra_submit_job.
timeout_ms (number, optional, default 300000/5min, max 1200000/20min): give up and return the last-known status after this many milliseconds if the job hasn't finished.
poll_interval_ms (number, optional, default 4000): delay between status checks.
Returns: JSON {job_id, status, outputs, error, timed_out}. timed_out is true if the timeout elapsed before completion — in that case status reflects the last poll and the job may still finish later; call hedra_get_job again after more time.
Examples:
Use when: "generate this video and tell me when it's ready" -> submit, then wait
Don't use when: doing many jobs in parallel and want to check on all of them periodically yourself (poll hedra_get_job_status per job instead, to avoid blocking on one at a time)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | Yes | The job's id, formatted job_<uuid> — returned by hedra_submit_job. | |
| timeout_ms | No | Max time to wait in ms (default 300000, max 1200000). | |
| poll_interval_ms | No | Delay between polls in ms (default 4000). |