[ { "label": "Tag product with \"restocked\" when restocked and remove the tag after a period", "trigger_type": [ "product_updated", "product_created" ], "object_type": "product", "app_id": "triggers", "settings": { "priority": 0, "condition_groups": { "1": { "conditions": { "1": { "field": "product.inventory_quantity", "settings": { "operator": "gt", "value": "0", "token_browser": "{{ Browse Tokens }}", "token_object_type": "product", "condition_type": "AND" }, "weight": 10 }, "2": { "field": "product.database", "settings": { "multiple": "any", "key": "in_stock", "operator": "equals", "value": "false", "token_browser": "{{ Browse Tokens }}", "token_object_type": "product", "condition_type": "AND" }, "weight": 20 } }, "actions": { "1": { "type": "product_add_tags", "settings": { "wait": "0", "custom_wait": "", "tags": "restocked", "token_object_type": "product" }, "weight": 30, "target_key": "product" }, "3": { "type": "database_key_value", "settings": { "wait": "0", "custom_wait": "", "resource_type": "products", "resource_id": "{{ product.id }}", "key": "in_stock", "value": "true", "token_object_type": "product" }, "weight": 40, "target_key": "product" }, "2": { "type": "product_remove_tags", "settings": { "wait": "1209600", "custom_wait": "", "tags": "restocked", "token_object_type": "product" }, "weight": 50, "target_key": "product" } } }, "2": { "conditions": { "1": { "field": "product.inventory_quantity", "settings": { "operator": "lte", "value": "0", "token_browser": "{{ Browse Tokens }}", "token_object_type": "product", "condition_type": "AND" }, "weight": 60 }, "2": { "field": "product.database", "settings": { "multiple": "any", "key": "in_stock", "operator": "equals", "value": "true", "token_browser": "{{ Browse Tokens }}", "token_object_type": "product", "condition_type": "AND" }, "weight": 70 } }, "actions": { "1": { "type": "database_key_value", "settings": { "wait": "0", "custom_wait": "", "resource_type": "products", "resource_id": "{{ product.id }}", "key": "in_stock", "value": "false", "token_object_type": "product" }, "weight": 80, "target_key": "product" } } } }, "shared_workflow_id": 34473 }, "description": "This automation adds a restocked tag to newly added and restocked item. The tag is then automatically removed after a pre-defined period say 2 weeks." } ]