[ { "label": "Bulk delete metafields from a product ", "trigger_type": [ "product_custom" ], "object_type": "product", "app_id": "triggers", "settings": { "priority": 0, "condition_groups": [ { "conditions": [], "actions": { "2": { "type": "custom", "settings": { "token_object_type": "product", "label": "Delete all metarecords", "twig": "{% set items = product.metafields %}\r\n{% for item in items %}\r\n{% do QUEUE_ACTION('shopify_api_request', {\r\n method: 'DELETE',\r\n path: 'products\/' ~ product.id ~ '\/metafields\/' ~ item.id,\r\n}) %}\r\n{% endfor %}\r\n", "wait": "0", "cw_timezone": "America\/New_York", "custom_wait": "" }, "weight": 1019, "target_key": "product" } } } ], "shared_workflow_id": 248861 }, "description": "The workflow is fired on demand. It fetches and loops through all metarecords attached to a specific product deleting the record from the Shopify database." } ]