[ { "label": "Track how many times a customer has returned items", "trigger_type": [ "refund_created" ], "object_type": "refund", "app_id": "triggers", "settings": { "priority": 0, "condition_groups": [ { "conditions": [], "actions": [ { "type": "trigger_child_workflow", "settings": { "target_path": "refund.order.customer", "child_id": 1985 }, "weight": 999, "target_key": "refund" } ] }, { "conditions": [ { "field": "refund.order.customer.tags_array", "settings": { "multiple": "none", "operator": "equals", "value": "Serial Returner" }, "weight": 2 }, { "field": "refund.order.customer.metafields", "settings": { "multiple": "any", "namespace": "arigato", "key": "refund_count", "operator": "gte", "value": "4" }, "weight": 3 } ], "actions": [ { "type": "customer_add_tags", "settings": { "wait": "0", "custom_wait": "", "tags": "Serial Returner" }, "weight": 999, "target_key": "refund.order.customer" } ] } ], "shared_workflow_id": 335 }, "description": "This automation is fired when a refund is created, it checks through the customer records for the number of times they have done returns, and if it's more than four, the tag \"serial returner\" is added to the customer. " } ]