# Any way to pass metadata directly to a triggered build?

**URL:** https://forum.buildkite.community/t/any-way-to-pass-metadata-directly-to-a-triggered-build/1128
**Category:** Features Requests
**Created:** [June 29, 2020, 11:31am UTC](https://forum.buildkite.community/t/any-way-to-pass-metadata-directly-to-a-triggered-build/1128 "2020-06-29T11:31:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![SeanR](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/seanr/32/340_2.png) [@SeanR](https://forum.buildkite.community/u/SeanR)
#### Post date: [June 29, 2020, 11:31am UTC](https://forum.buildkite.community/t/any-way-to-pass-metadata-directly-to-a-triggered-build/1128/1 "2020-06-29T11:31:48Z")

</div>

Hi all,

We have some use cases where we would really really love to pass metadata set in a build into builds that are triggered by the initial build.

AFAICT, right now you can either:

- Pass through the current value of an environment variable, eg:

> ```
> - trigger: "app-deploy"
> build:
> message: "${BUILDKITE_MESSAGE}"
> 
> ```

- Or you can trigger with statically-defined metadata, eg:

> ```
> - trigger: "app-deploy"
> build:
> meta_data:
> release-version: "1.1"
> 
> ```

But you cannot just pass through the current value of metadata, eg:

> ```
> - trigger: "app-deploy"
> build:
> meta_data:
> release-version
> 
> ```

Right now, we hack this via a convoluted dynamic step insertion where we read the current value of the metadata and upload a dynamic trigger step that creates a trigger with a static metadata value, but we would really love to not have to do this.

As for specific use cases, we have a large set of pipelines that roll updates out to clusters that are all triggered in parallel from a single `build-and-push-containers` pipeline. We need to pass through the tag of the build that was just performed by the top-level pipeline, and for various reasons, metadata is generally a better fit for this information than env vars.

This has come up a few times in the past as well:

- [Pass metadata to triggered pipelines with pure YAML](https://forum.buildkite.community/t/pass-metadata-to-triggered-pipelines-with-pure-yaml/875)
- [Forward meta-data to triggered build](https://forum.buildkite.community/t/forward-meta-data-to-triggered-build/778)

And I was wondering if there were any plans to enable this sort of functionality in the future?

Thanks!  
-Sean

---

<div class="post-metadata">

### Author: ![Jason](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/jason/32/742_2.png) [@Jason](https://forum.buildkite.community/u/Jason)
#### Post date: [June 29, 2020, 10:37pm UTC](https://forum.buildkite.community/t/any-way-to-pass-metadata-directly-to-a-triggered-build/1128/2 "2020-06-29T22:37:41Z")

</div>

Thanks for raising this @SeanR!

This is excellent feedback, and as you mentioned, there have been others asking for this feature.

We are actively discussing this functionality at the moment, and I will take your suggestion back and share it with the team.
