
After your application restarts, recover submitted Imagild jobs from a durable operation table and reconcile their existing task IDs. Do not treat an empty in-memory queue as evidence that no request was accepted. Restart recovery should inspect persisted work before it submits anything new.
The Imagild API console provides the underlying asynchronous request contract. Your application still needs its own database and startup policy; this guide proposes that application design rather than promising indefinite provider retention or automatic recovery from every crash.
Key Takeaways
- Commit an operation identity and exact request parameters before making the paid POST.
- Recover accepted operations by task ID; recover uncertain submissions with the original idempotency identity.
- Coordinate restarting workers so that recovery does not become a burst of duplicate submissions or reads.
Persist enough to recognize the same work
A useful operation table separates your local scheduling state from the provider's state:
| Column | Why it survives a restart |
|---|---|
| application owner and operation ID | Restores ownership and business context |
| idempotency key and frozen request JSON | Identifies an uncertain submission without changing its meaning |
| provider task ID, when received | Allows direct status recovery |
| last remote status and observation time | Describes the last known result without inventing a new one |
| local reconciliation state | Tracks your worker's next action |
| next check time and worker lease | Coordinates your own workers |
These are application fields, not extra generation parameters. Store only the private information your use case needs, and keep credentials in a secret store rather than the operation row.
Classify rows before starting workers
Consider a deployment that restarts after a product image was accepted. If its task ID was committed, the first recovery action is a GET. If the process died after sending the POST but before saving its response, the task ID may be absent even though the original operation exists remotely.
Use this startup decision tree:
Has an owned provider task ID?
Yes -> GET that task; do not submit a replacement.
No -> Was submission attempted?
Yes -> Recover the original endpoint with the same
Idempotency-Key and unchanged parameters.
No -> Follow the original authorized submission plan.
A repeated matching submission reuses Imagild's existing task identity. A changed request under the same key conflicts. Neither rule justifies creating a fresh key on every worker delivery.
An initialization error is another case to record precisely. Do not promise that repeated GETs repair a task that remains initializing; preserve the operation and inspect its sanitized response or request support review.
Claim recovery work, then release the claim
If several application workers restart together, use your own database transaction or lease to claim a reconciliation row. Re-read the row after claiming it, because another worker may already have saved the task ID.
A lease expiring allows another worker to inspect the operation later; it should not mark the provider task failed. Do not describe this application lease as a distributed exactly-once generation guarantee.
Replicate's lifecycle documentation distinguishes ongoing predictions from completed results. The lesson for recovery is to read the relevant provider state; Replicate-specific deadlines and retention remain separate policies.
Stagger startup reads. Imagild currently allows 120 reads per account per minute, and multiple API keys do not create separate account budgets. A restart should not poll hundreds of records simultaneously and then misinterpret rate limiting as generation failure.
Reconcile billing and preserve outputs
For each readable task, save the returned data.status and data.usage.state. A confirmed failed generation releases its reserved points; an unknown video outcome needs review. Your database must not issue its own “refund” merely because the application restarted.
After success, download and verify approved media through the authenticated content route. Save authorized assets under your own retention policy when needed; the asset archive guide explains why temporary links should not replace a backup plan.
Test restart recovery with fixtures at three crash boundaries: before POST, after POST but before response persistence, and after task-ID persistence. Count one logical operation through all three. The failed-job guide provides a useful review path for rows that require human attention rather than another paid attempt.
Related tasks
- What Should You Check Before Retrying a Failed Image or Video Job?
- How to Archive Imagild Assets Before the 90-Day Storage Window Ends
Sources and scope
- Imagild API console and integration guide: Current Imagild entry point, active-member access, asynchronous task reading and authenticated output contract; implementation facts cross-checked in lib/relay and the 2026-10-28 claims manifest.
- Replicate Prediction Lifecycle: General distinction between an ongoing prediction and its reported outcome. Its provider deadlines, cancellation, billing and retention rules are not attributed to Imagild.
Product instructions were checked against the current Imagild API contract and the public model catalog. Code, budgets and acceptance checks are illustrative; this article does not claim a new paid generation test, an uptime measurement, a search-volume study or a ranking of AI citations.
Prepared by Imagild Editorial, the company editorial team responsible for these guides. AI assisted research and drafting. This is documentation-based guidance with proposed examples, not a claim of hands-on testing or an independent product review. Report a correction.
Cover: Original Imagild product screenshot captured on 28 October 2026; model availability and prices may change. This image is not an API response or a performance benchmark.