# Run a trigger once instead of forever

**URL:** <https://forum.canton.network/t/run-a-trigger-once-instead-of-forever/390>\
**Category:** App Development\
**Tags:** daml\
**Created:** [May 7, 2020, 2:27pm UTC](https://forum.canton.network/t/run-a-trigger-once-instead-of-forever/390 "2020-05-07T14:27:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![meet](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/meet/32/198_2.png) [@meet](https://forum.canton.network/u/meet)\
**Post date:** [May 7, 2020, 2:27pm UTC](https://forum.canton.network/t/run-a-trigger-once-instead-of-forever/390/1 "2020-05-07T14:27:46Z")

</div>

Instead of having a rule in a trigger run forever, is there a way to run it once, i.e., as a one-time query? Eg, gather all contracts of type X and pass them in to a choice and then stop?

---

<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:** [May 7, 2020, 4:26pm UTC](https://forum.canton.network/t/run-a-trigger-once-instead-of-forever/390/2 "2020-05-07T16:26:46Z")

</div>

Triggers are always long-running processes. If you want to run something once, DAML Script is probably what you are looking for. You can find documentation and examples for DAML Script at [https://docs.daml.com/daml-script/index.html](https://docs.daml.com/daml-script/index.html).
