Skip to content

Start a workflow from Shopify events

To run a workflow when Shopify reports a new order, a payment, a refund, or a changed customer or product, add a Webhook block whose Source is Shopify and give its URL to a webhook subscription of your Shopify app. Shopify posts one event per request. Each event starts its own run.

You need a Shopify app whose webhook subscriptions and credentials you can open, edit access to the workflow’s project, and the member role or higher in the workspace to save the app’s secret on a connection. The Shopify steps happen in Shopify’s own console.

Add the Webhook block and generate its URL

Section titled “Add the Webhook block and generate its URL”
  1. In a draft workflow, add a Webhook block. The block palette also lists Shopify webhook in the Start group, which adds the block with its source already set.
  2. Under Source, choose Shopify. The line under the setting reads “Verifies the signature · one run per event · skips duplicates”.
  3. Under Webhook URL, select Generate URL, then copy the URL.

The badge beside the URL reads “Runs start after publish”. The URL contains a token, and anyone who has the URL can send requests to it. Keep it out of shared documents.

Create the webhook subscription in Shopify

Section titled “Create the webhook subscription in Shopify”
  1. In your Shopify app, add a webhook subscription for each topic you want. A topic is Shopify’s name for an event type, such as orders/create.
  2. Paste the URL you copied as the address each subscription sends to.
  3. Save the subscriptions.

Create the subscriptions in the app whose secret you save in the next section. Shopify signs a request with the secret of the app that owns the subscription.

The Webhook block offers these Shopify topics: orders/create, orders/paid, orders/fulfilled, orders/cancelled, orders/updated, customers/create, customers/update, products/create, products/update, checkouts/create, refunds/create, and app/uninstalled.

Shopify signs each request with the app’s Client secret. That secret is the same for every webhook of the app, so OutWin does not save it on the block. You save it once on an API connection, and each Webhook block that receives from the app chooses that connection.

  1. In Shopify, open the Dev Dashboard, then Apps, your app, and Settings. Copy the Client secret under Credentials.
  2. In OutWin, open Connections. If the workspace has no API connection for Shopify, add one. In the dialog, leave Base URL empty and set Authentication to None. The connection then only receives events. If your workflows also call the Shopify API, enter its base URL and credential instead, or add them later on the connection’s page. This guide does not need them.
  3. On the connection’s page, under Receiving events, paste the secret into the field that shows “Paste the signing secret” and select Save. The section then shows only a masked hint and the saved date, with Replace and Remove.
  4. In the block’s settings, under Connection that holds the client secret, choose the connection. Each connection in the list is marked “secret saved” or “no secret yet”.

The line under the setting then starts “Verifying with the secret ending”, followed by the hint. Under Set up, the second line changes to “The client secret is saved: deliveries are verified.”

In a workspace with no API connection, the setting shows “No API connections yet.” in place of the list, with an Add one link that opens Connections. If you choose a connection that has no secret, the line reads “This connection has no client secret yet.” with a Save it on the connection link to its page.

A second Webhook block for the same app chooses the same connection. Removing the secret from the connection stops verification for every block that chose it.

With no connection chosen, or with a connection that has no secret, the block still starts runs, and nothing is verified: anyone who has the URL can start the workflow. Publishing then shows a warning that ends “has no signing secret saved, so its deliveries are not verified: anyone who has this URL can start this workflow”. The warning does not block publishing.

Under Events that start a run, tick the topics that start a run. With none ticked, every event Shopify sends starts a run. To start runs for a topic that is not listed, type it into the box under the list and select Add.

An event whose topic is not ticked is listed as Filtered out and starts no run. To narrow further by a field of the event, add a row under Only when. Webhook settings lists the comparisons.

  1. In Shopify, do something that causes one of the subscribed topics, such as placing a test order.
  2. In OutWin, look under Recent deliveries in the block’s settings.

Recent deliveries lists every event that reached the URL, including while the workflow is a draft. On a draft each event is listed as Dropped with “The workflow is not published, so nothing ran.” It starts no run and is not run later. The last line under Set up changes from “Waiting for the first event…” to, for example, “Received orders/create. Dropped.”

With a secret saved on the chosen connection, an event listed as Dropped on a draft has passed the signature check. A delivery that fails the check is listed as Refused.

If you have edit access, select an event to see what the block passed on. The list is kept for seven days, and the data of the newest 20 events is kept.

Each run receives one Shopify event. Shopify puts the topic, the id, and the time in request headers, so the body is the order, customer, or product itself and does not say what happened to it. Read the topic from event. An HTTP request block or a database block directly after the Webhook block reads the event with these expressions. An AI block such as Think receives the whole value as its input.

Expression What it holds
{{input.body}} The object as Shopify sent it: the order for an orders/create event, for example. Its fields depend on the topic.
{{input.body.id}} One field of the object. Read any other field the same way.
{{input.event.type}} The topic, such as orders/create. It is the request’s X-Shopify-Topic header.
{{input.event.id}} The event’s id. It is the request’s X-Shopify-Webhook-Id header.
{{input.event.time}} The event’s time as an ISO 8601 date and time. It is the request’s X-Shopify-Triggered-At header.
{{input.delivery.verified}} true only when the signature was checked and passed.

A block further along reads the same values through the Webhook block’s name, as in {{steps["Shopify"].body.id}} for a block named Shopify. Data and context describes what each block passes on.

Publish the workflow. From then on, each event that passes the filter starts a run. On a published workflow the block’s settings are read-only, including the choice of connection, and Recent deliveries is in the block’s inspector. You can still replace the secret on the connection’s page.

Outcome What happened
Ran The event started a run.
Waiting 10 runs of the workflow are already active. The event starts a run when one of them ends. An event that waits longer than an hour is listed as Dropped.
Duplicate A request with the same X-Shopify-Webhook-Id already ran in the last 72 hours. The line reads “This event was already received and run, so it did not run again.”

Runs start in the order events arrive. That is not always the order things happened, so do not build a workflow that relies on orders/create arriving before orders/paid.

Receiving an event costs no credits, and neither does an event that is filtered out or a duplicate. A run that starts uses credits for the blocks that run in it.

Open Recent deliveries and read the outcome and the sentence beside the newest event.

What you see Cause Fix
“Nothing has arrived yet.” No request has reached the URL. Check that the app has a subscription for the topic and that the subscription’s address is the block’s current URL. Rotate token on a published workflow changes the URL, and the old one stops working.
Dropped with “The workflow is not published, so nothing ran.” The workflow is a draft. Publish the workflow. Events that arrived before then are not run later.
Dropped with “The workflow is paused, so nothing ran.” The workflow is paused. Resume the workflow. Events that arrived while it was paused are not run later.
Filtered out with Events of type "orders/updated" are not chosen on this trigger. The event’s topic is not ticked under Events that start a run. Tick the topic, or clear every tick so that all events start a run. The settings are read-only on a published workflow.
Refused with “The signature did not match. Check that the secret saved here is the one the sender shows for this URL.” The secret on the chosen connection is not the Client secret of the app that owns the subscription. This can happen when the block chose another service’s connection, when the secret was copied from another app, or when the app’s secret was replaced in Shopify. Copy the Client secret from the app again and select Replace under Receiving events on the connection’s page. You do not republish the workflow.
Refused with “The request carried no signature.” A secret is saved on the chosen connection, and the request did not carry Shopify’s signature. A request sent by hand to try the URL has none. Cause the event in Shopify so that Shopify sends the request.

A delivery listed as Refused is answered with status 401 and starts nothing. OutWin keeps none of its data. For every other outcome in the table, Shopify receives a success response and OutWin does not run the event later.