Skip to main content

How do I trigger a flow when a product is back in stock?

How to automatically notify contacts when a product comes back in stock, using the Back in stock trigger.

Written by Peter

Once visitors have signed up through your Back in stock form, you can notify them automatically when the product returns to stock. Both a form and a flow are needed — the form captures signups, and the flow sends the notification when the product is back.

If you haven't set up a Back in stock form yet, see How do I set up a Back in stock form? first.

Step 1: Create a flow in Spoks

You have two options:

  • Use the Back in stock blueprint — When creating a new flow, select the Back in stock blueprint. This sets up the flow with the trigger and a starter notification for you.

  • Create the flow from scratch — Create a new flow from scratch and set the trigger to Back in stock.

Most merchants will want to start from the blueprint, since it gives you the trigger, notification, and personalization already in place.

Step 2: Filter the trigger to specific products (optional)

By default, the trigger fires for any product variant that returns to stock. If you only want the flow to run for specific products or collections, you can add a Products or Collections trigger filter and select the products or collections the flow should apply to.

Step 3: Configure what the flow does

From here, the flow works like any other Spoks flow. Add whatever actions you want to run for subscribers when a product comes back in stock — most often, this is a post that notifies them the product is available again.

You can personalize the notification with variant-specific information — the product title, image, price, direct-to-cart link, and more. The flow editor's personalization picker shows the full list of available tokens.

How the trigger fires

The Back in stock trigger fires whenever Spoks receives an in-stock event from Shopify for a variant. When it fires, the flow runs for every contact who is currently subscribed to that specific variant.

A few things to know about how subscriptions work:

  • Subscriptions are at the variant level, not the product level. A product with multiple variants (like different sizes or colors) tracks subscribers per variant. Each variant returning to stock fires its own trigger and notifies its own subscribers.

  • Once a subscriber is notified, their subscription ends. If they want to be notified about a future stock event for the same variant, they need to sign up again.

  • A contact can only have one subscription per variant. Signing up multiple times for the same variant doesn't create multiple subscriptions.

  • Deleting a variant drops its subscriptions. If you delete a variant in Shopify, any subscriptions for it are removed. Subscriptions to other variants of the same product are unaffected.

  • Renaming a variant doesn't affect subscriptions. Spoks tracks variants by their Shopify ID, so renames are safe.

A note on multi-location inventory

The trigger fires based on total inventory across all your Shopify locations, not just inventory at your online fulfillment location.

If your store has multiple locations — for example, an online warehouse and one or more retail stores — subscribers may be notified when a product becomes available at any location, including ones that don't fulfill online orders. In that case, the subscriber would receive a notification even though the product still shows as sold out on the online store.

Please let us know if you would like the have a back in stock notification that tracks only specific locations.

Back in stock vs. Form submission triggers

Back in stock forms interact with two different triggers:

  • The Back in stock trigger (this article) fires when a product returns to stock, running the flow for subscribers to that product.

  • The Form submission trigger fires when a visitor submits a form.

In most cases, the Back in stock trigger is the one you want, since the notification email should go out when the product is available. You can also use the Form submission trigger if you want to run a separate flow at signup time — for example, sending a confirmation like "We'll let you know when it's back."

Did this answer your question?