# Sharing metadata with multiple pipelines

**URL:** <https://forum.buildkite.community/t/sharing-metadata-with-multiple-pipelines/2411>\
**Category:** General\
**Created:** [November 24, 2022, 3:18am UTC](https://forum.buildkite.community/t/sharing-metadata-with-multiple-pipelines/2411 "2022-11-24T03:18:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lewis](https://avatars.discourse-cdn.com/v4/letter/l/e9bcb4/32.png) [@lewis](https://forum.buildkite.community/u/lewis)\
**Post date:** [November 24, 2022, 3:18am UTC](https://forum.buildkite.community/t/sharing-metadata-with-multiple-pipelines/2411/1 "2022-11-24T03:18:47Z")

</div>

We have two pipelines

1. pipeline for pull request
2. pipeline for merge

we would like to set some metadata on the pull request pipeline and access it in the merge pipeline

is it possible??

---

<div class="post-metadata">

**Author:** ![benmc](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/benmc/32/1159_2.png) [@benmc](https://forum.buildkite.community/u/benmc)\
**Post date:** [November 24, 2022, 4:46am UTC](https://forum.buildkite.community/t/sharing-metadata-with-multiple-pipelines/2411/2 "2022-11-24T04:46:18Z")

</div>

Hey @lewis!

Thanks for your question!

A simialr question was asked previously and Jarryd provided the answer here: [How to make buildkite-agent meta-data get "key" optional - #3 by jarryd](https://forum.buildkite.community/t/how-to-make-buildkite-agent-meta-data-get-key-optional/2089/3)

TL;DR: it is possible by passing in the job UUID using the --job flag.

Hope that helps with your use case.

Cheers,  
Ben

---

<div class="post-metadata">

**Author:** ![lewis](https://avatars.discourse-cdn.com/v4/letter/l/e9bcb4/32.png) [@lewis](https://forum.buildkite.community/u/lewis)\
**Post date:** [November 24, 2022, 5:14am UTC](https://forum.buildkite.community/t/sharing-metadata-with-multiple-pipelines/2411/3 "2022-11-24T05:14:42Z")

</div>

thanks @benmc I dont know what the job id is from the other pipeline does that mean I need to query the buildkite api to get it?

---

<div class="post-metadata">

**Author:** ![paula](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/paula/32/954_2.png) [@paula](https://forum.buildkite.community/u/paula)\
**Post date:** [November 24, 2022, 6:33am UTC](https://forum.buildkite.community/t/sharing-metadata-with-multiple-pipelines/2411/4 "2022-11-24T06:33:06Z")

</div>

Hey @lewis, using the API is the way to go here. You can [query builds from a pipeline](https://buildkite.com/docs/apis/rest-api/builds#list-builds-for-a-pipeline) and then use any of the job IDs returned in that set.  
The `buildkite-agent meta-data get` command requires a job ID to make the API request, but on the server side, we search for meta-data attached to the build that job is attributed to, so it doesn’t matter so much which jobs ID you use.

---

<div class="post-metadata">

**Author:** ![paula](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/paula/32/954_2.png) [@paula](https://forum.buildkite.community/u/paula)\
**Post date:** [August 29, 2023, 5:39am UTC](https://forum.buildkite.community/t/sharing-metadata-with-multiple-pipelines/2411/5 "2023-08-29T05:39:29Z")

</div>


