{
        "description": "Notify stakeholders when quotation status changes",
        "trigger": {
            "event": "quotation:status:changed",
            "table": "quotations"
        },
        "steps": [
            {
                "order": 1,
                "type": "conditional",
                "condition": "{new_status} != {old_status}",
                "ifTrue": [
                    {
                        "type": "notification",
                        "recipients": ["created_by", "sales_team"],
                        "template": "quotation_status_changed",
                        "data": {
                            "quotation_number": "{quotation_number}",
                            "old_status": "{old_status}",
                            "new_status": "{new_status}",
                            "customer_name": "{customer.name}",
                            "amount": "{total_amount}"
                        },
                        "channels": ["email", "push"]
                    },
                    {
                        "type": "emit",
                        "event": "quotation:status:{new_status}",
                        "data": {
                            "quotation_id": "{quotation_id}",
                            "status": "{new_status}",
                            "previous_status": "{old_status}"
                        }
                    }
                ]
            }
        ]
    }