Building your first workflow
In this guide we are going to walk through the steps required to make a workflow for the following example scenario.
Example Scenario
Our fictional store has multiple members of staff, but they rely on a single staff member to photograph the products before they are made available online.
To ensure that they can start photographing the new products as soon as they arrive at work, we would like to make sure that they are sent an email whenever a product is created that needs pictures to be taken.
Adding a workflow
From the Swoop home screen select Add workflow from the top right
This will take you to the workflow details page. Here, we can start filling out the required details.
The basics
We firstly need to add a Name and Description so we can easily find this workflow in the future if it ever needs changing.
Here, we've added a simple name, and a short description summarising what our new workflow will do. At this point we can also set the Status of the new workflow, the Status allows you to turn the Workflow off or on. The default for newly created Workflows is Active, meaning the rule will start working as soon as we save it.
For our new workflow, we want it to start working as soon as it's saved, so we're going to leave the default of Active. If we wanted to save this workflow and not have it work immediately, we can instead change the status to Inactive.
Adding the trigger
Next we need to give our new workflow a Trigger. This will determine when our workflow will run.
You can select from that list of triggers which Swoop provides. In our case we need to know when a new product is created, so we click on This workflow triggers and choose a new product is created.
Using advanced criteria
If our fictional store only sold products online, this would be all that is required to successfully trigger your new workflow. However, our store also sells small items in it's physical store that will never be sold online, so we want to make sure our photographer is only alerted to products that definitely require photographing.
To achieve this, we can select Use advanced criteria (optional).
Once this is selected, we can start adding rules to our trigger which will further refine when it runs. For our example, products that require photographing should always be set as a draft product until the correct images have been added. So we can use this as the starting point.
In the Advanced criteria section, click on Select field. You will see a list of values that are available on products. In our case, we want our workflow to run when the newly created product has a status set to draft, so select 'status' from the list of options, and in the Enter text field type 'draft'.
With this rule in place, our trigger will now run any time a new product is created and it has a status that equals 'draft'.
But for our fictional store, this isn't quite enough. There are still some scenarios where a draft product will be created that will not need any pictures taken.
In our example, the store merchants additionally give the draft product a tag of 'needs photos'. So we will configure the Workflow to look for this tag in our trigger. We can do this by adding an additional rule. Click on Add rule:
For this rule, we are going to evaluate the products tag. So, in Select field, click on 'tags' and in Enter text, type 'needs photos'. There is one extra change that this rule needs, Products can have multiple tags attached to them at any time, and we only want to match against one of them, not all of them, so instead of using is equal to as the operator for the rule. We will instead change it to contains.
At this point, your Trigger should look like this:
Check out the guide on using advanced criteria for more information about this feature.
With this final option in place, our new Workflow has everything to trigger exactly when we want it to. So we can now move onto to configuring what will happen when the Workflow does trigger.
Adding an action
The Actions section allows us define what will happen when our new Workflow runs.
At the moment, we only support one action - Send an email. As Swoop grows, we will be adding more actions for you to use. Look out for announcements from us as we add more.
If you have any suggestions or feedback about more actions to add, or about Swoop in general, please do get in touch with us via the orange help button. We're excited to hear what you'd find helpful, as we strive to make Swoop the best possible tool for you and your business.
We're now going to configure the workflow to email our photographer. Click on When this workflow triggers <choose an action> and select send an email. From there, we can select who the email will be sent To, what the email Subject should be, and what Message the email should have.
With this message in place, our Workflow is technically all ready to go. We could save it now, and it would do everything our fictional store needs. But what if we could make the Message sent to the photographer a little more useful?
Adding information from the product to the message
Adding the product title
Let's add the title of the new product to the Message.
To do this, the Actions section has information available to it from the newly created product, in a similar fashion to the Advanced criteria we can use with our Trigger.
The available Product data can be found on the text formatting menu under the text block that was added to the Message. Click on the drop down menu Product data, and then we can scroll down until we find the information we want to automatically insert it into the Message field. In this case we will want the product 'Title'. This will insert an example product title into the Message, which will be replaced with the actual products title when this workflow runs.
Adding all the products variants
In addition to the title of the product, it would be nice to let the photographer know if the product has any variants, so they can decide if they also need photographing.
We can do this by adding an additional text block, and then condiguring the Data group of the text block to that of Variants. Lets look at the gif below to see how to do that.
When we select the Data group for the text block, and set it to Variants, we are telling the workflow that this section of the email should be repeated for every variant that the product has. So if the product has 5 variants, then the text block with Variant title and Variant sku will be repeated five times in the email, and each text block will have the individual variants title and sku.
With the final changes complete, our workflow is ready to be used. Hit Save, and our new workflow will send the given email whenever a new product is created that needs photos.
Testing it out
It's always worth testing out a new workflow you've created - so let's give that a go! We've created a demonstration product with 6 variants.
But if you would like to try out the rule you have created, head into the Products area of the Shopify Admin dashboard, and create a new product in "draft" status with the "needs photos" tag.
Then, check the email account that you chose to have the emails sent to - you should have an email with the subject and message you entered.
Congratulations - you've just created your first workflow!