# Deployment with multiple artifacts

**URL:** <https://hub.mender.io/t/deployment-with-multiple-artifacts/4466>\
**Category:** General Discussions\
**Created:** [January 11, 2022, 4:24pm UTC](https://hub.mender.io/t/deployment-with-multiple-artifacts/4466 "2022-01-11T16:24:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@Simon](https://hub.mender.io/u/Simon)\
**Post date:** [January 11, 2022, 4:24pm UTC](https://hub.mender.io/t/deployment-with-multiple-artifacts/4466/1 "2022-01-11T16:24:21Z")

</div>

Hi,  
When using a server side API to create a deployment, by using a shell coding for instance like this example:

> curl -vX POST [https://hosted.mender.io/api/management/v1/deployments/deployments](https://hosted.mender.io/api/management/v1/deployments/deployments)   
> -H “Content-Type: application/json”   
> -H “Accept: application/json”   
> -H “Authorization: Bearer ${TOKEN}”   
> -d ‘{  
> “name”: “update files v3.35”,  
> “artifact\_name”: “update-files-3.35”  
> }’

is it possible to include more than one artifacts in the code above and in what order are they executed?

Or if I write a second curl deployment bloc like the example above and specify the same deployment name but a different artifact name, will this add a second artifact (in order of execution) to the existing deployment?

Thank you

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [January 12, 2022, 6:53am UTC](https://hub.mender.io/t/deployment-with-multiple-artifacts/4466/2 "2022-01-12T06:53:28Z")

</div>

No, it’s not possible, but you can schedule three separate deployments, and they are guaranteed to be installed in the order that you created them.

If the first deployment fails, the next ones will still be executed though. If you want to avoid that, you can create a dependency on the previous Artifact when you create it with mender-artifact, using `-d artifact_name:<NAME_OF_PREVIOUS_ARTIFACT>`. Chain them together by making each Artifact depend on the previous one (except for the first one). With this you are guaranteed that the Artifacts will be installed in order, and won’t continue if one fails to install.

If an Artifact fails, it will roll back to the previous successful Artifact though, not all the way back to the initial one.

---

<div class="post-metadata">

**Author:** ![Simon](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@Simon](https://hub.mender.io/u/Simon)\
**Post date:** [January 12, 2022, 1:10pm UTC](https://hub.mender.io/t/deployment-with-multiple-artifacts/4466/3 "2022-01-12T13:10:10Z")

</div>

Thank you kacf. This tip about making them dependent on previous successfully installed artifact is going to be helpful.
