Getting started

Create new app

When you are first sign up for Shypyard, you will want to create your first app. Click on "Create new app" button, then provide an app name.

App Dashboard

When you first open the app, you will see the app dashboard. Here contains an overview of your tasks.

  1. This area contains the list of automation tasks you have created. It shows the name, description, the status, and last update time.

  2. This area shows the number of runs you have incurred in the past month.

  3. This section shows recent task run history

  4. Button to create new automation task

Add Shopify integration

First, you should add your Shopify integration. Click on the "integration" tab

Then add the credentials from your custom Shopify app.

Create and run a simple task

So let's go through a simple task. Click on (4) the "Create New Task" button, which will show a pop-up with some example task you can try. We will continue to add more tasks to this library

For simplicity sake, lets just click on "Start a brand new task" on the bottom right of the pop-up.

The new task will be created and the page will be redirected to the task overview page.

Right now, nothing is set up yet. So let's get started by clicking on the "Update script" button, which will open the task editor interface.

There's a couple things here:

  1. This area is the code for the task. This is the script that will run when the task is triggered

  2. This button allows you to run the code and test it right away on the browser

  3. Set up task triggers

  4. Add any javascript libraries

we will first click on the "Test code" button so you can see how testing and running code is like.

Next you will notice a panel show up at the bottom. This panel will show the logs from test running the code you currently have in the editor. You are free to run the code without saving the changes to see if it is doing what you intended.

So we will try a very simple task, which is printing out the product data when a product is created or updated.

First, change the code to the following. It will get the Shopify library (see Platform SDK section), then call the product API to get product data.

const { auths, libs } = require('platform');

module.exports = async (event) => {
  const shopify = libs.shopify.get();
  const product = await shopify.product.get(event.data.id);
  console.log("product data", product);
};

We can test it by setting up a test data. Click on "Test Event", then set it up like the following. Find a. real product ID from your store.

Now, click on "Test code" again, and you show see the product data being printed out

So the code is working. Next we want to set up the task triggers. Click on "Add triggers", select Shopify, then add products/create and products/update

After adding the 2 events, the triggers section should look like this

Now, save your changes. Once you do, you will notice the "Deploy" red button show up. Click into that, which will open the deploy page. In Kiwi Automation, there are development and production environment. Any changes you made to the editor interface is only in the development environment and to have it reflected in the production environment, you have to deploy the changes.

Click on the "Deploy" button. Then we will start with the deploy process!

Now, if you go back to your Shopify admin panel, and create or update a product, you will see the task being triggered and show up in log history. It may take up to 10 seconds for the log to show up in the app.

If you click into the log, you can see more details like the entire event data and the logs during the task execution.

That's it! You have now set up an automation task and have it triggered successfully! now you can get started with something more complex :)

Last updated