# Creation of artifact which supports multiple payloads

**URL:** <https://hub.mender.io/t/creation-of-artifact-which-supports-multiple-payloads/1952>\
**Category:** General Discussions\
**Created:** [May 21, 2020, 9:45am UTC](https://hub.mender.io/t/creation-of-artifact-which-supports-multiple-payloads/1952 "2020-05-21T09:45:44Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![prashanthjbabu](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/prashanthjbabu/32/1157_2.png) [@prashanthjbabu](https://hub.mender.io/u/prashanthjbabu)\
**Post date:** [May 21, 2020, 9:45am UTC](https://hub.mender.io/t/creation-of-artifact-which-supports-multiple-payloads/1952/1 "2020-05-21T09:45:44Z")

</div>

I’d like to use the mender-artifact tool ( [https://github.com/mendersoftware/mender-artifact](https://github.com/mendersoftware/mender-artifact) ) to generate an artifact which does both “single-file” and “script” modules . Can someone point me to a documentation which helps me achieve this? I know how to create each of them independently . I’m interested in generating one artifact which does both.  
Thanks!

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [May 21, 2020, 4:52pm UTC](https://hub.mender.io/t/creation-of-artifact-which-supports-multiple-payloads/1952/2 "2020-05-21T16:52:01Z")

</div>

Hi @prashanthjbabu welcome.

The primary links you need to create a custom update module are:

- [https://docs.mender.io/2.3/devices/update-modules](https://docs.mender.io/2.3/devices/update-modules)
- [https://github.com/mendersoftware/mender/blob/2.2.0/Documentation/update-modules-v3-file-api.md](https://github.com/mendersoftware/mender/blob/2.2.0/Documentation/update-modules-v3-file-api.md)

Hope that helps,  
Drew

---

<div class="post-metadata">

**Author:** ![prashanthjbabu](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/prashanthjbabu/32/1157_2.png) [@prashanthjbabu](https://hub.mender.io/u/prashanthjbabu)\
**Post date:** [May 22, 2020, 2:49am UTC](https://hub.mender.io/t/creation-of-artifact-which-supports-multiple-payloads/1952/3 "2020-05-22T02:49:09Z")

</div>

Hi @drewmoseley,  
Thanks for your reply . I’m not looking to build a custom update module . The document [https://github.com/mendersoftware/mender/blob/2.2.0/Documentation/update-modules-v3-file-api.md](https://github.com/mendersoftware/mender/blob/2.2.0/Documentation/update-modules-v3-file-api.md) mentions that one artifact can contain multiple payloads ( each corresponding to an update module ) . I’d like to do that ! Have ONE artifact which has MULTIPLE payloads.

Reference : “One Artifact can contain payloads for several update modules”

---

<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:** [May 22, 2020, 6:15am UTC](https://hub.mender.io/t/creation-of-artifact-which-supports-multiple-payloads/1952/4 "2020-05-22T06:15:58Z")

</div>

Hey @prashanthjbabu, although the multi-payload support is listed in the Update Module specification, it has not been implemented yet. There is a ticket for it [here](https://tracker.mender.io/browse/MEN-2355).

---

<div class="post-metadata">

**Author:** ![prashanthjbabu](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/prashanthjbabu/32/1157_2.png) [@prashanthjbabu](https://hub.mender.io/u/prashanthjbabu)\
**Post date:** [May 22, 2020, 6:23am UTC](https://hub.mender.io/t/creation-of-artifact-which-supports-multiple-payloads/1952/5 "2020-05-22T06:23:43Z")

</div>

Hi @kacf,

Thanks for your reply . Is this implemented on the cloud and mender client? If i create my own mender artifact manually (or my own script) following the guidelines of [https://github.com/mendersoftware/mender-artifact/blob/master/Documentation/artifact-format-v3.md](https://github.com/mendersoftware/mender-artifact/blob/master/Documentation/artifact-format-v3.md) then would it work?

---

<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:** [May 22, 2020, 6:40am UTC](https://hub.mender.io/t/creation-of-artifact-which-supports-multiple-payloads/1952/6 "2020-05-22T06:40:15Z")

</div>

No, sorry, this is not implemented anywhere. As an alternative, you can use one `single-file` payload together with [state scripts](https://docs.mender.io/2.3/artifacts/state-scripts), perhaps?

---

<div class="post-metadata">

**Author:** ![prashanthjbabu](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/prashanthjbabu/32/1157_2.png) [@prashanthjbabu](https://hub.mender.io/u/prashanthjbabu)\
**Post date:** [May 22, 2020, 6:46am UTC](https://hub.mender.io/t/creation-of-artifact-which-supports-multiple-payloads/1952/7 "2020-05-22T06:46:12Z")

</div>

Your codebase seems to reflect support for multiple payloads [https://github.com/mendersoftware/mender/blob/2.1.x/state.go#L862](https://github.com/mendersoftware/mender/blob/2.1.x/state.go#L862) . Is this not the relevant code?

Sure I could use statescripts as an alternative option…Thanks!

---

<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:** [May 22, 2020, 7:27am UTC](https://hub.mender.io/t/creation-of-artifact-which-supports-multiple-payloads/1952/8 "2020-05-22T07:27:53Z")

</div>

Yes, there is plenty of code which is prepared to handle it. We do have plans to implement it at some point, after all. But until all pieces are in place, it’s insecure to try to support something which isn’t handled correctly everywhere, so [this is disabled](https://github.com/mendersoftware/mender/blob/2.2.0/installer/installer.go#L188) for the time being.

---

<div class="post-metadata">

**Author:** ![prashanthjbabu](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/prashanthjbabu/32/1157_2.png) [@prashanthjbabu](https://hub.mender.io/u/prashanthjbabu)\
**Post date:** [May 22, 2020, 8:19am UTC](https://hub.mender.io/t/creation-of-artifact-which-supports-multiple-payloads/1952/9 "2020-05-22T08:19:28Z")

</div>

Got it ! Thanks @kacf

---

<div class="post-metadata">

**Author:** ![andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@andrea](https://hub.mender.io/u/andrea)\
**Post date:** [August 29, 2023, 1:01pm UTC](https://hub.mender.io/t/creation-of-artifact-which-supports-multiple-payloads/1952/10 "2023-08-29T13:01:08Z")

</div>

Hello! Any updates on this feature?

---

<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:** [September 1, 2023, 10:04am UTC](https://hub.mender.io/t/creation-of-artifact-which-supports-multiple-payloads/1952/11 "2023-09-01T10:04:47Z")

</div>

No, I’m afraid. At this point I think it’s quite unlikely that it will be implemented. People have generally been able to work around it by using multiple files inside one payload instead, and then modify Update Modules to cope with that.

In the [new C++ rewrite](https://hub.mender.io/t/mender-to-rewrite-client-using-c-and-retain-go-for-its-backend/5332), the rootfs installer will be an Update Module, so it will be easier to modify it if you need to combine rootfs updates with other files inside one artifact.

---

<div class="post-metadata">

**Author:** ![maffan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/maffan/32/2062_2.png) [@maffan](https://hub.mender.io/u/maffan)\
**Post date:** [April 25, 2025, 8:37am UTC](https://hub.mender.io/t/creation-of-artifact-which-supports-multiple-payloads/1952/12 "2025-04-25T08:37:18Z")

</div>

Bumping this thread, as we’re also interested in this feature. Our current workaround involves creating a custom module with multiple files, but we’d much prefer to handle each file as a separate payload — especially since one of the files is a rootfs. Our workaround currently requires us to duplicate the rootfs payload code.
