A Mechanic task is responsible for interpreting the events that occur, setting off any number of actions as a result.

Mechanic offers a number of built-in tasks, which you can add to your account with a single click (plus some other clicks for filling in options, like what address to send emails to.)

If you're a developer or handy with a script, you can dive under the hood and either modify a built-in task, or create a custom task completely from scratch.

For developers

Each task boils down to two things: a list of event topics to which the task applies, and a Liquid script that renders action definitions based on that event.

For Mechanic's built-in tasks, we hide both of these options under a toggle labeled "Show Advanced".

Event subscriptions

A subscription is simply an event topic name, with an optional delay specifier on the end in hours, days, or weeks.

A task can have zero, one, or many event subscriptions. (If you don't give it any, it'll naturally never run.)

Here are a couple examples:

  • shopify/customers/create – for customer signups
  • shopify/orders/paid+1.week – useful for following up with customers to see how their order went
  • mechanic/scheduler/tuesday – runs every Tuesday at midnight, in the shop's local timezone
  • mechanic/scheduler/daily+17.hours – runs every day at 5pm, in the shop's local timezone

There are a lot of event topics! Here's the master list.

Script

This is the code itself. Again, this is written in Liquid – that venerable templating language from Shopify.

There's a lot to talk about! We've got all the details for you here.

Did this answer your question?