Build your first workflow

This guide builds a small workflow from a blank canvas: when a product gets the tag clearance, post a message to Slack. It uses a product trigger on purpose, so it works on every store without an extra approval. The same steps apply to any other workflow.

1. Create the workflow

  1. Open Workflows in the app menu.
  2. Select Create blank workflow. The editor opens with an empty canvas.
  3. Type a name into Workflow name, for example Clearance tag to Slack.

2. Choose the trigger

  1. Select the trigger at the top of the canvas, then Change trigger.
  2. In Choose what starts this workflow, search for product tags added and pick Product tags added.
  3. If a banner says This trigger needs a permission, select Open Permissions and grant read access to products. See Permissions and store data access.

3. Add a condition

  1. Press + under the trigger. The Add a step window opens.
  2. Pick Condition.
  3. In the side panel, choose the Field with the variable picker: event.payload.added_tags. Set Comparison to contains and Value to clearance.

When the rules match, the run continues on the Then branch, otherwise on the Otherwise branch. An empty branch ends the run.

4. Add the action

  1. Press + on the Then branch.
  2. Search for slack and pick Send Slack message.
  3. In Webhook URL, write {{ secrets.SLACK_WEBHOOK_URL }}. Create that secret on the Secrets page with your Slack incoming webhook URL. See Secrets.
  4. Write the Message. Use the variable button on the right of the field to insert values of the event:
{{ event.payload.title }} is now on clearance.

5. Test it

  1. Select Test in the toolbar above the canvas.
  2. The sample event of the trigger is used; you can edit it under Event (JSON). Keep Preview (nothing is changed) and select Run preview.
  3. The canvas marks the path the run took. Select a step to see what it returned.

In a preview the Slack message is not sent: the step reports what it would have sent. Choose Run for real when you want to see the message arrive. See Test, preview and debug.

6. Save and turn it on

  1. The button next to the undo and redo arrows reads No problems when every step is filled in. If it shows a number of problems, select it: each problem opens the step it belongs to.
  2. Select Save in the bar at the top of the admin.
  3. Select Turn on. The badge next to the name changes from Off to On.

From now on the workflow runs whenever a tag is added to a product. Open Run history to see each run.

Next steps