# Start a long-running job and wait until it finishes

Sends your input as-is to a job API you run, then checks the job's status every 30 seconds until it reports done or failed, for up to 20 checks (about 10 minutes). It shows the final status response, and the run fails if the job is still running after the last check. Replace the two URLs with your endpoints; the status check sends the start response's body so your API can find the job. Both endpoints must answer JSON.

**Use cases:** Automation, Engineering and IT

**Tags:** polling, async job, webhook, wait, status check, integration

[Create this agent](https://seclai.com/agent-examples/create/poll_job_until_done)

## How it starts

Trigger: dynamic input.

## Steps

- Start the job
- Repeat until the job finishes
  - Each try: Wait 30 seconds
  - Check the job's status
  - The status response
- Show the final status
