# Sync Shopify product changes to Algolia in real time

> When a product is created, updated, or deleted in Shopify, we update your Algolia search index within seconds so shoppers always see the current catalog.

- Workflow type: code
- Services: Shopify, Algolia
- Categories: Operations
- Published: 2026-07-17

## What it does

- Listens for product create, update, and delete events on your Shopify store.
- On a create or update, pulls the current product record from Shopify and writes a slim, predictable record into your Algolia index using the Shopify product id.
- On a delete, removes the matching record from your Algolia index straight away.
- Indexes only a small allowlist of fields (title, handle, vendor, price, tags, image, availability, product type) so indexing costs stay low and search behavior stays predictable.

## What you'll need

- A Shopify store you can add webhooks to.
- An Algolia account with an index for your products and an Admin API key.

## Prompt

Keep my Algolia catalog index in lockstep with Shopify so site search always reflects the current storefront.

Trigger: webhook when Shopify emits a products/create, products/update, or products/delete event. Ignore any other event type.

On a products/create or products/update event, call Shopify Get Product using the product id from the webhook payload to pull the full current record. Then call Algolia Add or Replace Record on my catalog index, using the Shopify product id (as a string) as the objectID.

On a products/delete event, call Algolia Delete Record on the same index with the Shopify product id (as a string) as the objectID. Do not fetch anything from Shopify in this branch. The webhook payload already tells us which record to remove.

For every Algolia record I write, project only a slim, allowlisted set of Shopify fields so indexing costs stay low and the record shape stays predictable:

- title: product.title

- handle: product.handle

- vendor: product.vendor

- product_type: product.product_type

- tags: product.tags split into an array of strings

- price: the first variant's price coerced to a number, or the minimum price across variants if you prefer

- image_url: product.image.src, or null if the product has no image

- availability: true if any variant has inventory_quantity greater than 0 (or the variant does not track inventory) and the product status is active, otherwise false

This is a deterministic, node-based workflow. No LLM reasoning, no branching beyond the three webhook event types. Every step is a documented operation (Shopify Get Product, Algolia Add or Replace Record, Algolia Delete Record) or a small pure-function projection over the Shopify payload.

## How to customize

- Choose which Algolia index the workflow writes into.
- Change which product fields land on each record. Add color, material, or SKU if your shoppers search on them.
- Adjust how availability is determined (any variant in stock vs total inventory above a threshold).

## FAQ

### Does this update the Algolia record when stock or price changes?

Yes. Every Shopify product update fires the sync, so stock, price, and description edits all flow through the same path.

### What happens if I delete a product in Shopify?

The workflow removes the matching record from your Algolia index right away, so the product disappears from site search almost immediately.

### Will this work with product variants?

The default record uses product-level fields like title, handle, price, image, and availability. If your search needs variant-level results, that is a common customization to add.

### How fast does search reflect a Shopify change?

Usually within a few seconds. Shopify fires the webhook the moment a product changes, and the Algolia write is near-instant.

### Can I use this on more than one Shopify store?

Yes. Run one workflow per store and point each at its own Algolia index, or share an index and give each store its own objectID prefix.

Use this prompt in General Input: https://www.generalinput.com/prompts/sync-shopify-product-changes-to-algolia-in-real-time