# How to pass artifact to a trigger

**URL:** https://forum.buildkite.community/t/how-to-pass-artifact-to-a-trigger/904
**Category:** General
**Created:** [February 6, 2020, 2:08am UTC](https://forum.buildkite.community/t/how-to-pass-artifact-to-a-trigger/904 "2020-02-06T02:08:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![terence](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@terence](https://forum.buildkite.community/u/terence)
#### Post date: [February 6, 2020, 2:08am UTC](https://forum.buildkite.community/t/how-to-pass-artifact-to-a-trigger/904/1 "2020-02-06T02:08:05Z")

</div>

Hi all,

I have a script like the following:

## Script for build 1

steps:

- wait
- label: “create artifact”  
command: echo “something” \> textfile  
artifact\_paths: [“textfile”]
- trigger: another\_build

## Script for another\_build

steps:

- wait
- label: “display artifact”  
command: cat textfile

My question is how to pass the artifact “textfile” from one job to another job?

Thank you

---

<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: [March 13, 2020, 3:27am UTC](https://forum.buildkite.community/t/how-to-pass-artifact-to-a-trigger/904/2 "2020-03-13T03:27:57Z")

</div>

Hey @terence thanks for raising this, you can do this by uploading and downloading the artifacts.

Pipeline A  
steps:

- commands: |  
echo ‘bar’ \> foo  
buildkite-agent artifact upload foo
- wait
- trigger: pipeline-b

Pipeline B  
steps:

- commands: |  
buildkite-agent artifact download --build “$$BUILDKITE\_TRIGGERED\_FROM\_BUILD\_ID” foo .  
cat foo
