Decide at the page boundary
In a merchandising script that waits for its output and writes one result to a folder, a synchronous request can be easier to follow. In a catalog admin page, a staff member might close a tab after starting a dress preview. Use a stored run ID so the next visit can recover that request without starting a second generation. Save the listing ID, input revision and FASHN run ID together before presenting an in-progress status.
| What the API returns | What the catalog should show |
|---|---|
A run ID from POST /v1/agent/images/run |
Request accepted. Keep the current product image visible. |
A status of processing |
Still working. FASHN documents no partial results at this stage. |
A status of completed |
Review completed prediction entries and their result images against the current SKU before publishing. |
A status of failed |
Show a failure or retry decision even if the status lookup returned HTTP 200. |
Poll the existing run with GET /v1/agent/status/{id}. If you use a completion webhook, route it into the same update for that ID so the store handles one completed job once. The Agent includes intermediate operations in its prediction list. An earlier completed image does not necessarily match the final catalog requirement. Check the required garment variant, pose or packshot framing before selecting one result.