> ## Documentation Index
> Fetch the complete documentation index at: https://docs.factorize.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Stop and retry runs

> Avoid duplicate work and understand current stop behavior.

Ask: “Inspect this run, stop it if it is still active, and verify its final state.” Fetch `get_run`, then use `stop_run({"runId":"RUN_ID"})` for a starting, running or blocked run. The response requests `stopping`; poll until terminal and inspect diagnostics for cleanup.

**Current behavior:** `kill_run` calls the same stop operation as `stop_run`. It does not force a queued run to terminate or release its slot immediately. Both return `operation_failed` when the run is not active. Do not treat kill as stronger recovery; contact the hosted operator if a run remains stuck.

For a timed-out manual submission, repeat `invoke_job` with the **same** `idempotencyKey`. The response contains the original `invocationId`, `runId`, and `duplicate: true`. Retain the key you submitted: current `get_run` does not return `invocation.idempotency_key`. Never send its internal `invocation.claim_key` or a `manual:` prefix back as the key. If the key was lost, inspect existing runs before requesting another.

An intentional new run after failure needs a new key. First verify that the prior run is terminal, inspect whether it made external changes, and fix the cause. A retry may repeat those external effects: invocation deduplication is not transactional rollback of the agent's work. For `queue_full`, wait for capacity and reuse the key for the intended request. See [failed runs](/troubleshooting/runs).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.