This article is a summary of how bulk operations work. To learn more about creating tasks with bulk operations, see Querying Shopify.
Mechanic comes with several ways to query Shopify for data (see Querying Shopify), and one of these involves Shopify's "bulk operations" feature. This feature allows apps like Mechanic to send Shopify a query that might return a very large amount of data.
In our implementation, a Mechanic task sends Shopify the query, and then waits for Shopify to complete its processing. The task is not running, during this time – it's simply waiting. When the query is complete, the Mechanic task is notified (with a "mechanic/shopify/bulk_operation" event), and the task then processes the query's results.
An event that involves a bulk operation might look like this:
Note the "Children" section, in the "Event" box on the right. When the bulk operation is complete, the a "mechanic/shopify/bulk_operation" event appears. Click on that link to see how the task handles the bulk operation's results.
- Only one bulk operation is permitted to run at a time, per store and per app. This means that you'll need to wait for any running bulk operation to complete, before running another one.