Skip to main content
Version: 5.0.0

Order Sync

In this guide, we'll take a look at how to use Alloy to configure Order Sync workflows with popular e-commerce applications

Use Case Overview

Let's assume you're building an app that needs to sync order data from an e-commerce system such as Shopify into your platform. You need to first obtain a historical listing of all the relevant orders and then subscribe to realtime events each and every time an order is placed.

To do this, we'll build a few workflows. Our first workflow will grab the historical list of all available orders. Our second workflow will set up realtime event forwarding to subscribe us to incoming orders placed and pass them along to your application. Lastly, our third and final workflow will subscribe to all order updates so you can be alerted each and every time an update (e.g. a status change) occurs on an order.

Let's dive in!

Syncing Historical Orders

Create a new workflow. For the trigger, we'll select "On Installation" as our trigger. This trigger tells Alloy to only run this workflow once, upon the user's initial install.

Next, add an e-commerce connector. For our demo, we'll use Shopify but you can easily use others like BigCommerce, Adobe Magento, WooCommerce, etc. Select the list all orders action.

Lastly, add a Stream Data connector. This connector will tell Alloy where to send all the order records to. Specify a destination URL of your choosing. You can see an example of this workflow below.

Realtime Order Alerts

Next, let's build another workflow that allows us to create an order in our e-commerce system. For this workflow, we'll choose a Custom Event Trigger as our starting point. This will allow Alloy to map the data and take action in our commerce system.

Next, add a e-commerce connector. Select the create an order action. This is where we will map our dynamic values from the event we will send to Alloy into the Shopify inputs.

Realtime Order Updates

Lastly, let's create a workflow that alerts us each time an order is updated in our e-commerce system. This is helpful to understand changes in the order state (i.e. if the status changed). For this workflow, we'll choose the Shopify Trigger as our starting point and subscribe to the Order Updated event.

Add a Stream Data connector to send over the order payload in real time to your application. You can see an example of this workflow below.

Wrapping Up

As you can see, it's easy to create workflows that subscribe to both historical and realtime order data in e-commerce systems. Let's take a look at what we covered in this tutorial:

  1. We used the On Installation connector to run a historical sync to fetch all historical Order records and send it back to your application.
  2. Next, we set up a workflow to push Order created events to Alloy and create that order inside of your e-commerce system.
  3. Lastly, we set up another workflow to update us whenever an Order record is updated.