[ { "label": "When Product Status Transitions from Draft to Published...", "trigger_type": [ "product_created", "product_updated" ], "object_type": "product", "app_id": "triggers", "settings": { "priority": 50, "condition_groups": { "1": { "conditions": { "2": { "field": "product.database", "settings": { "multiple": "any", "key": "previous_status", "operator": "equals", "value": "draft", "token_object_type": "product", "condition_type": "AND" }, "weight": 999 }, "3": { "field": "product.status", "settings": { "operator": "any", "value": { "active": "active", "archived": 0, "draft": 0 }, "condition_type": "AND" }, "weight": 999 } }, "actions": { "1": { "type": "debug", "settings": { "wait": "0", "custom_wait": "", "action_label": "Add your own action here & remove this log message", "title": "", "body": "condition met", "token_object_type": "product" }, "weight": 999, "target_key": "product" } } }, "2": { "conditions": { "2": { "field": "product.twig_condition", "settings": { "title": "previous status is not equal to current status", "value": "{% if product.status != product.database.previous_status %}\r\ntrue\r\n{% endif %}", "token_object_type": "product", "condition_type": "AND" }, "weight": 999 } }, "actions": { "1": { "type": "database_key_value", "settings": { "wait": "0", "custom_wait": "", "resource_type": "products", "resource_id": "{{ product.id }}", "key": "previous_status", "value": "{{ product.status }}", "token_object_type": "product" }, "weight": 999, "target_key": "product" } } } }, "shared_workflow_id": 41540 }, "description": "This automation will fire an action of your choosing when a product changes from \"draft\" to \"active\" in your store." } ]