How do I use the metadata: {} field that's automatically in many of my automation actions?

I was hoping to use the metadata field to store an input variable for use in the same action but it doesn’t seem to be working. Is this a feasible/reasonable use for it? Happy to hear any simple alternatives too, as my fallback is changing all the lines manually, haha (like hardcoding frigate instead of vmName works).

alias: Shutdown VM
action: rest_command.proxmox_vm_shutdown
metadata:
  vmName: frigate
data:
  vmid: "{{ (vm_list.content.data | select('search', vmName) | first).vmid }}"
  host: "{{ (vm_list.content.data | select('search', vmName) | first).node }}"
enabled: true

Thanks Jack! I checked that page a few times but found no reference to metadata. I tried using a variable section but that didn’t work either.

An excellent question.

It appears that is used to store data for the automation editor and is stripped out in core when execuing a service call (aka an action.)

So, i think you can put whatever you want in there since its just going to get discarded but it could foul up the automation editor.

Thanks Pete! I’ll just hardcode the multiple values inline then.