How to get execution ID in workflow

1.2k Views Asked by At

When executing a workflow there is a unique Execution ID. Is it possible to access this value from within the workflow. For example, if I was to use the Execution ID as the filename in a step:

        url: https://storage.googleapis.com/upload/storage/v1/b/bucketname/o
        headers:
            Content-Type: application/json
        query:
            uploadType: media
            name: ${string(EXECUTION_ID) + ".json"}
    ```
1

There are 1 best solutions below

1
On

It is now available as environment variable GOOGLE_CLOUD_WORKFLOW_EXECUTION_ID which can be accessed like this in your yaml configuration file:

${sys.get_env("GOOGLE_CLOUD_WORKFLOW_EXECUTION_ID")}