Automation: start listening for Whatsapp event after every restart

I am trying to get the group ID of a WA group which is only used in emergencies. I cannot send a test message and only every few months a message is send. I would like to start listening to the WA events with every restart of HA and save them to a file. Is that possible?

Thanks to a guy from the MacroDroid forum, I got this code which should send a message to my telegram protocol channel every time I receive a WA message.

alias: whatsapptesting
description: ""
mode: single
trigger:
- platform: event
  event_type: new_whatsapp_message
action:
- service: notify.telegram_protocol
  metadata: {}
  data:
    message: {{ trigger.event.data }}

I thought this will give me the group ID. But after saving the automation and opening it again, it looks like this:

alias: whatsapptesting
description: ""
trigger:
  - platform: event
    event_type: new_whatsapp_message
action:
  - service: notify.telegram_protocol
    metadata: {}
    data:
      message:
        "[object Object]": null
mode: single

In the traces I find this error message:

Stopped because an error was encountered
template value should be a string for dictionary value @ data[‘message’]

I don’t have a clue what that means, can anybody please give me an idea what is wrong with the code?