Skip to content

How should my app track reference uploads that never become generation jobs?

Track an upload as its own application record before it is attached to a generation action. Record ownership, intended draft and whether submission ever occurred. Clean up your own abandoned temporary material under your retention policy, while treating upstream uploaded references separately; do not invent a public AISwapLab file-delete endpoint.

SHIP A RELIABLE INTEGRATIONAISwapLab team · Editorial methodPublished 3 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval
Article workflow: Record the upload lifecycle; Attach references at approval; Run a bounded abandonment review.
Workflow diagram: Record the upload lifecycle → Attach references at approval → Run a bounded abandonment review. Read the article for evidence and limits.

An uploaded reference is not yet a generation job

A user can upload a file, abandon the editor and never approve a paid request. If your database only records completed submissions, that reference can disappear from your operational inventory even though a copy remains somewhere. Model the upload-to-draft relationship explicitly. The proposed register lives in your application and should distinguish local temporary files, successful upstream file identifiers and accepted generation requests.

What to do next

  1. 01

    Record the upload lifecycle

    Create a local upload identifier linked to the authorized user and draft. Mark whether the upload is local-only, being forwarded, accepted upstream or rejected. Retain the owned upstream file identifier only after a valid response. Store necessary provenance without copying raw portraits into logs. A user selecting a file should not be represented as a submitted generation merely because the upload completed.

  2. 02

    Attach references at approval

    When the user approves a generation, bind the intended accepted file identifier to the immutable action record. Keep any earlier unused upload distinguishable from the selected reference. If the draft changes, update the draft relationship without rewriting the submitted action. This allows your inventory to explain why a file exists even when no resulting job was created and avoids using job counts as a storage inventory.

  3. 03

    Run a bounded abandonment review

    Identify uploads with no active draft or submitted action after your documented local retention window. Remove only application-controlled temporary copies that meet that policy and record the cleanup. For upstream or provider copies, use documented product controls or contact the operator where necessary. Do not claim that a local row deletion removes remote storage, and do not create a paid task merely to give an orphan reference a job identifier.

A concrete example

Illustrative example: a user uploads reference U1, later selects U2 and submits one action using U2. The inventory shows U1 as unused and U2 as attached to the action. A local cleanup removes U1's temporary proxy copy under policy without asserting that every remote copy was erased.

Before you call it ready

  • Upload and generation identities are separate.
  • Unused references remain explainable.
  • Cleanup claims match the storage actually controlled.

When to stop or choose another method

Stop cleanup when ownership, attachment or remote retention is unclear. Preserve the necessary inventory and investigate; do not expose abandoned references through a public list or invent deletion API calls outside the documented contract.

Sources

One task. A recoverable workflow.

Check the contract, approve the quote and retain the job.

Open API documentation