How to tag master job name to pods created by nextflow config

Hello,
I have a k8yaml which deploys a Kubernetes job say nextflowjob-1 which would run a container with nextflow.config file. There will be sub pods created for each process as defined in nextflow.config. The sub pods are named like nf-12656576. It’s difficult to figure out which pods are created as part of master job. How to tag k8 master job names with pods create by nextflow. I tried below solution but it was giving nextflow.conifg syntax error

  1. Add below env variable in k8yaml of master job
    - name: POD_NAME
    valueFrom:
    fieldRef:
    fieldPath: metadata.name
  2. Add annotation in nextflow.config
    withLabel: ‘serverlesspod’ {
    pod =[
    annotations: [
    ‘parentJobName’: ‘$(POD_NAME)’
    ]
    ]
    }