Turn studio product shots into lifestyle scenes on new Shopify drafts

By General Input

When a new draft product lands in Shopify, decide whether its photo needs a scene, then swap the plain backdrop for a lifestyle setting with Recraft before the listing goes live.

Integrations

  • Shopify
  • Recraft

Type

Agentic Task

Categories

  • Marketing

When Shopify emits a new product webhook (products/create), run an agent that decides whether the product's photo would benefit from a lifestyle scene and, if so, replaces the background with one generated from the product's own copy. The trigger is a Shopify webhook on the products/create event, so this fires the moment a product is created.

Step 1 — Pull the current product. Use Shopify Get Product with the ID from the webhook payload. Read status, title, body_html (description), tags, product_type, and the images array.

Step 2 — Filter. Skip and stop the run immediately if any of the following are true: status is not 'draft' (never touch active or archived products); the images array is empty (nothing to work with); the images array has more than one image (assume a merchandiser is already handling it). Only continue when the product is a draft with exactly one image.

Step 3 — Judge the photo. Have the agent look at the single image and decide whether it is a plain studio-style shot (white/gray/seamless backdrop, isolated product, no environmental context) that would visibly benefit from a lifestyle scene. If the photo is already a lifestyle shot, or is a diagram/illustration/packaging flat, stop the run without changes.

Step 4 — Compose the scene prompt. From the title, description, tags, and product_type, write a short scene description that fits the product (for example: a ceramic pour-over kettle -> 'sunlit modern kitchen counter with a linen napkin and a wooden cutting board, morning light through a window'). Keep the product itself unchanged; describe only the setting, lighting, and props.

Step 5 — Generate the new image with Recraft. Default path: call Recraft Replace Background with model recraftv3, passing the current product image URL and the scene prompt. If the subject is visually complex or the agent expects background detection to struggle (thin/wispy shapes, transparent materials, jewelry on a bust, clothing on a hanger), fall back to Recraft Generate Background with model recraftv3 for finer masking. Note: both endpoints require model recraftv3 — V4 is not supported for these edits.

Step 6 — Attach the new image to the product. Use Shopify Update Product to add the newly generated lifestyle image as the product's primary image. Preserve the original studio photo by keeping it in the images array attached to a variant (variant_ids), so the file is never destroyed. Do not change status, title, description, tags, price, or inventory — only images. Do not publish the product; leave it in draft.

Guardrails: never operate on a product whose status is not 'draft'; never remove or replace an existing image outright — always append and reassign the primary; never touch a product with more than one existing image; if Recraft returns an error or the output looks degenerate, stop the run and leave the product exactly as it was. Log a one-line summary at the end (product id, action taken, whether replace or generate was used).

Related prompts

Explore more prompts
Receiving dock console for inspecting and restocking Loop returnsSee which influencer creators actually drove Shopify salesMorning dispatch board for your local delivery runsAnswer Instagram and Messenger DMs with the order on screenWhite glove queue for the VIP customers waiting on youReturns and warranty claim desk that follows your policyFraud lookup desk for any email, phone, IP address or linkReview high risk Shopify orders before anything gets pickedFraud review desk for the Shopify orders you should holdMorning repricing console for Shopify with margin-safe rules