# Grouping commands into an atomic submit in triggers

**URL:** <https://forum.canton.network/t/grouping-commands-into-an-atomic-submit-in-triggers/4812>\
**Category:** App Development\
**Tags:** trigger\
**Created:** [June 30, 2022, 4:05am UTC](https://forum.canton.network/t/grouping-commands-into-an-atomic-submit-in-triggers/4812 "2022-06-30T04:05:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leonid\_Rozenberg](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/leonid_rozenberg/32/48_2.png) [@Leonid\_Rozenberg](https://forum.canton.network/u/Leonid_Rozenberg)\
**Post date:** [June 30, 2022, 4:05am UTC](https://forum.canton.network/t/grouping-commands-into-an-atomic-submit-in-triggers/4812/1 "2022-06-30T04:05:29Z")

</div>

A [submission request](https://docs.daml.com/app-dev/grpc/proto-docs.html#submitrequest) to the Ledger API allows us to group two commands (for example a create and an archive) to be executed together atomically. AFAIU, commands that we submit in a trigger are not grouped that. But is there a mechanism to achieve that?

I know that I can write more Daml to gain that behavior via a custom template and a CreateAndExercise, but that does not seem ideal as I’m adding ledger state to achieve automation.

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [June 30, 2022, 6:02am UTC](https://forum.canton.network/t/grouping-commands-into-an-atomic-submit-in-triggers/4812/2 "2022-06-30T06:02:11Z")

</div>

`emitCommands` does group all commands you pass it into a single submission and therefore they’re treated atomically.

---

<div class="post-metadata">

**Author:** ![Leonid\_Rozenberg](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/leonid_rozenberg/32/48_2.png) [@Leonid\_Rozenberg](https://forum.canton.network/u/Leonid_Rozenberg)\
**Post date:** [June 30, 2022, 1:43pm UTC](https://forum.canton.network/t/grouping-commands-into-an-atomic-submit-in-triggers/4812/3 "2022-06-30T13:43:07Z")

</div>

Oh!!! Then i am more confused by something else. Thank you.
