# Merge artifact result

**URL:** <https://discuss.circleci.com/t/merge-artifact-result/38598>\
**Category:** Running Tests\
**Tags:** circle-yml\
**Created:** [December 22, 2020, 10:15pm UTC](https://discuss.circleci.com/t/merge-artifact-result/38598 "2020-12-22T22:15:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![geekorlife](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/geekorlife/32/26294_2.png) [@geekorlife](https://discuss.circleci.com/u/geekorlife)\
**Post date:** [December 22, 2020, 10:15pm UTC](https://discuss.circleci.com/t/merge-artifact-result/38598/1 "2020-12-22T22:15:34Z")

</div>

Hi,  
I’m new with Circleci and I’m trying to find a way to merge my artifacts created during in job with several parallels.  
For now, I’m seeing all artifacts created with each parallel but at the end of the job (and not in another job), I would like to merge the result from each artifacts.  
I found a way by downloading each artifact content but it can be crazy to handle (especially if the created artifacts has nested folders and files…).  
I tried to use persist\_to\_workspace but the only way to get access to it would be on another job.  
Any idea?  
Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Henna](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/henna/32/29402_2.png) [@Henna](https://discuss.circleci.com/u/Henna)\
**Post date:** [December 30, 2020, 7:09pm UTC](https://discuss.circleci.com/t/merge-artifact-result/38598/2 "2020-12-30T19:09:18Z")

</div>

Hi @geekorlife,

Can you please clarify what you mean by merge artifact results. Are you trying to store additional artifacts to the same file multiple times in a singular job? If so, you can add multiple `store_artifacts` steps within the same job. If you are trying to add artifacts to the file across jobs you can do this using workspaces. You can find more information in our docs [here](https://circleci.com/docs/2.0/artifacts/). Please feel free to share a `config.yml` file if you’d like.

---

<div class="post-metadata">

**Author:** ![smedmen](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@smedmen](https://discuss.circleci.com/u/smedmen)\
**Post date:** [January 4, 2021, 12:59pm UTC](https://discuss.circleci.com/t/merge-artifact-result/38598/3 "2021-01-04T12:59:41Z")

</div>

I’m not sure if I’m having the same issue, but I think I do. My situation is that I have a workflow that runs three jobs. Each job creates an artifact and uses `store_artifacts`. This works in the sense that I see the artifacts on the job results pages. However the API to request artifacts works on **builds** , not **jobs**. And when I request the list of artifacts for the **build** , I get only the one from the first **job**.

By the way, with “the API to request artifacts” I mean this one (described [here](https://circleci.com/docs/2.0/artifacts/#downloading-all-artifacts-for-a-build-on-circleci)):

```auto
https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/latest/artifacts

```

---

<div class="post-metadata">

**Author:** ![Henna](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/henna/32/29402_2.png) [@Henna](https://discuss.circleci.com/u/Henna)\
**Post date:** [January 4, 2021, 11:27pm UTC](https://discuss.circleci.com/t/merge-artifact-result/38598/4 "2021-01-04T23:27:31Z")

</div>

Hi @smedmen,

When you use `latest` with the artifacts endpoint ( [https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/latest/artifacts](https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/latest/artifacts)) CircleCI will return the lasts artifact. Your first job is likely the latest job to be built. It sounds like you want to retrieve all artifacts for the entire workflow.

You can persist data throughout a workflow using [workspaces](https://circleci.com/docs/2.0/persist-data/#using-workspaces) and run your [`store_artifacts` step](https://circleci.com/docs/2.0/configuration-reference/#store_artifacts) in your final/last job. You can use to [requires key](https://circleci.com/docs/2.0/workflows/#fan-outfan-in-workflow-example) to make sure the job that is running your store artifacts step is last. If you do this, all of your artifacts will be stored in the same build. Therefore, you can use this endpoint ([https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/latest/artifacts](https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/latest/artifacts)) to retrieve all of your latest builds artifacts.

---

<div class="post-metadata">

**Author:** ![smedmen](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@smedmen](https://discuss.circleci.com/u/smedmen)\
**Post date:** [January 5, 2021, 5:58am UTC](https://discuss.circleci.com/t/merge-artifact-result/38598/5 "2021-01-05T05:58:58Z")

</div>

Right, that’s pretty much what I ended up doing except that I have a separate job for storing the artifacts, that depends on a number of other (potentially parallel) jobs that generate the artifacts. Thanks for confirming that’s the right way to do it, I thought I was missing something. 👍

---

<div class="post-metadata">

**Author:** ![Henna](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/henna/32/29402_2.png) [@Henna](https://discuss.circleci.com/u/Henna)\
**Post date:** [January 14, 2021, 10:19pm UTC](https://discuss.circleci.com/t/merge-artifact-result/38598/6 "2021-01-14T22:19:47Z")

</div>

@smedmen Absolutely!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [January 24, 2021, 10:19pm UTC](https://discuss.circleci.com/t/merge-artifact-result/38598/7 "2021-01-24T22:19:51Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
