Dynamic tagging of processes

I started to add tags to the processes so I can easily have some data about which sample a particular process is processing.
I started putting the tag keyword in the process itself, and while I feel like this is the right thing to do, this is also a nightmare if I want to change it.
Then I tried putting it in the config file. Now everything is located in a single file and easier to maintain, but I have the feeling that the data is being processed in the wrong place.

Which is the preferred/standard way of setting the tags? In the process definitions or in the config file?

Also, when putting the tags in the config file, I’m repeating the same structure for each process:

process {
    withName: 'PROCESS1' {
        cpus   = 6
        memory = { 2.GB * task.attempt }
        time   = { 1.hour * (3 ** (task.attempt - 1)) }
        queue  = { params.partition }
        tag = { meta.id }
    }
    ...

Could it be possible to define the closure once somewhere and assign it to the tags multiple times? I tried adding tag_closure = { meta.id } at the top level and it worked, but I get a warning in the editor. Where should I put that definition?