One status field is often insufficient
Your local queue state, AISwapLab generation status, private download outcome and creative approval answer different questions. A completed remote job can still await local delivery, and a delivered file can fail the user's brief. Preserve those distinctions instead of overwriting everything with success or error. The suggested record columns belong to your application database; adding fields such as internal_task_id to an AISwapLab creation body is not implied by this design.
What to do next
- 01
Create the record before dispatch
Persist the intended model, exact body and unique identifier before sending the first creation request. Record who approved the spending ceiling and which quote was reviewed.
- 02
Attach remote identifiers promptly
When a response arrives, save job ID and returned routes before notifying a transient frontend. Keep the original payload immutable so a network retry can recover the same task.
- 03
Track delivery and acceptance
Record validated download completion and the user's review separately from technical generation. Use safe identifiers in logs while retaining private content only in authorized storage.
A concrete example
Illustrative record: a task can be locally delivered, remotely completed and creatively rejected at the same time. Those three facts explain both the successful technical path and why the project still has no approved final image.
Task event and recovery ledger
| Observed local event | Persist before moving on | Recovery after a crash |
|---|---|---|
| Approved but not sent | Owner, exact body snapshot, quote/approval and idempotency value | Dispatch only that approved task |
| Send attempted; response absent | Send-attempt time and original request identity | Recover unchanged submission; do not invent a fresh task |
| Remote completed; local delivery incomplete | Returned job/content route and validated transfer state | Retrieve that result without another creation |
| Delivered but creatively rejected | Artifact version and specific review finding | New revision needs separate approval and identity |
Before you call it ready
- Approval exists before network dispatch.
- Remote task identity is durable.
- Delivery and creative acceptance have separate fields.
When to stop or choose another method
If your schema cannot represent accepted-but-unknown or completed-but-undelivered work, add those states before launch. Otherwise ordinary failures can become hidden duplication or lost customer output.
