Add a Mechanic bulk mutation event
complete
Brad (Tekhaus)
Create a custom event in Mechanic for bulk operation mutations, similar to
mechanic/shopify/bulk_operation
for bulk operation queries, and provide the JSONL output in that event.Without access to the
bulk_operations/finish
webhook, the only way to know when bulk operation mutations are complete is to poll them, and then the JSONL URL has to be extracted manually.Matt Sodomsky
marked this post as
complete
https://learn.mechanic.dev/resources/tutorials/bulk-operation-mutations
Matt Sodomsky
Brad (Tekhaus) Let me know if this meets your needs:
This is how I’m thinking about it: we probably don’t need a separate Mechanic event just for
bulkOperationRunMutation
. Shopify represents both bulkOperationRunQuery
and bulkOperationRunMutation
as the same underlying BulkOperation object, so Mechanic can reuse the existing mechanic/shopify/bulk_operation
flow for both.Mechanic would detect the returned bulk operation ID from either API, poll it until it finishes, then emit the existing bulk operation event with the completed
bulkOperation
data. That would include the JSONL result URL, and task authors could keep using the existing bulkOperation.objects
interface to read the output.To tell query vs mutation apart, we’d expose Shopify’s
bulkOperation.type
field:{% if bulkOperation.type == "MUTATION" %}
...
{% elsif bulkOperation.type == "QUERY" %}
...
{% endif %}
Brad (Tekhaus)
Matt Sodomsky That's perfect if it has no impact on all the existing bulk op query tasks :)