[ { "label": "Stop selling a variant if out of stock after a specific date", "trigger_type": [ "product_updated" ], "object_type": "product", "app_id": "triggers", "settings": { "priority": 0, "condition_groups": { "1": { "conditions": { "1": { "field": "product.variants.inventory_quantity", "settings": { "multiple": "any", "operator": "lte", "value": "0", "token_object_type": "product", "condition_type": "AND" }, "weight": 999 }, "2": { "field": "product.twig_condition", "settings": { "title": "", "value": "{% set date_now = \"now\"|date('Y-m-d') %}\r\n{% if date_now > '2021-04-01' %}\r\ntrue\r\n{% endif %}", "token_object_type": "product", "condition_type": "AND" }, "weight": 999 } }, "actions": { "1": { "type": "trigger_child_workflow", "settings": { "target_path": "product.variants", "exported_workflow": { "label": "Variant subworkflow", "trigger_type": [ "manual" ], "object_type": "product_variant", "app_id": "triggers", "settings": { "priority": 0, "condition_groups": { "1": { "conditions": { "1": { "field": "product_variant.inventory_quantity", "settings": { "operator": "gte", "value": "0", "token_object_type": "product_variant", "condition_type": "AND" }, "weight": 999 } }, "actions": { "1": { "type": "product_variant_set_fields", "settings": { "wait": "0", "custom_wait": "", "fields": { "inventory_policy": { "value": "deny" } }, "token_object_type": "product_variant" }, "weight": 999, "target_key": "product_variant" } } } } } } }, "weight": 999, "target_key": "product" } } } }, "shared_workflow_id": 39119 }, "description": "This automation will set the inventory policy to deny when the item runs out of stock after a certain date. " } ]