In general, Mechanic will run as many of your events/tasks/actions simultaneously as possible. This means that multiple tasks subscribing to the same event topic are very likely to execute simultaneously, when such an event occurs.

To protect the health of the system and to ensure performance for every store on our platform, Mechanic does have several concurrency limits.

Limits

  • Mechanic will perform at most 20 runs simultaneously per store. This could be 20 events, 20 tasks, 5 events and 10 tasks and 5 actions, or any other combination of runs. Additional runs will be performed as the preceding runs complete.
  • Mechanic will only perform a "shopify" action if the Shopify API limit for your store has at least 10 calls left in the bucket. (For more details on what this means, see Shopify's REST API limit documentation.) When the bucket has emptied further, Mechanic will perform more of any remaining actions.

Tips

  • If you have several tasks that modify the same resource, on the same event, consider ordering their execution using delays. For example, two tasks that auto-tag new customers might subscribe to shopify/customers/create and shopify/customers/create+5.minutes respectively.
  • To ensure that your tasks are working with up-to-date information, consider reloading your resources at the beginning of the task script. For example, a task responding to a customer event might include {% assign customer = customer.reload %} at the very beginning, to ensure that any changes to the customer (since the original event) are reflected in the customer variable.
Did this answer your question?