{{ var_name }} = (
    {% if imported %}
    {% if offline %}
    MessageHandler(asset_id = "{{ asset_id }}")
    {% else %}
    sdk.get_message_handler(id = "{{ asset_id }}")
    {% endif %}
    {% else %}
    MessageHandler(name="{{ message_handler_name }}")
    {% if description %}
    .set_description({{ description }})
    {% endif %}
    {% for message in messages %}
    .add_message(Message(id = "{{ message["id"] }}", action = {{ message["action"] }}, description = {{ message["description"] }}))
    {% endfor %}
    {% endif %}
)
flow.use_message_handler({{ var_name }})
