# Question about tasks collection behavior

**URL:** <https://forum.genieacs.com/t/question-about-tasks-collection-behavior/6766>\
**Category:** Uncategorized\
**Created:** [April 16, 2025, 8:36pm UTC](https://forum.genieacs.com/t/question-about-tasks-collection-behavior/6766 "2025-04-16T20:36:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PipoDelgiudice](https://avatars.discourse-cdn.com/v4/letter/p/4da419/32.png) [@PipoDelgiudice](https://forum.genieacs.com/u/PipoDelgiudice)\
**Post date:** [April 16, 2025, 8:36pm UTC](https://forum.genieacs.com/t/question-about-tasks-collection-behavior/6766/1 "2025-04-16T20:36:39Z")

</div>

Hi, I’m working with GenieACS and I have a question regarding how tasks are handled.

When I create a task using the endpoint:  
`POST /devices/<device_id>/tasks`

An entry is created in the `tasks` collection in MongoDB. My questions are:

- Is this task considered “pending” until the device executes it?
- Once the device executes the task, is the entry automatically removed from the `tasks` collection, or does it remain stored there?

Thanks in advance for your help!

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [April 16, 2025, 8:41pm UTC](https://forum.genieacs.com/t/question-about-tasks-collection-behavior/6766/2 "2025-04-16T20:41:41Z")

</div>

> [@PipoDelgiudice](#):
>
> - Is this task considered “pending” until the device executes it?

Yes

> [@PipoDelgiudice](#):
>
> Once the device executes the task, is the entry automatically removed from the `tasks` collection

Yes

---

<div class="post-metadata">

**Author:** ![PipoDelgiudice](https://avatars.discourse-cdn.com/v4/letter/p/4da419/32.png) [@PipoDelgiudice](https://forum.genieacs.com/u/PipoDelgiudice)\
**Post date:** [April 16, 2025, 8:52pm UTC](https://forum.genieacs.com/t/question-about-tasks-collection-behavior/6766/3 "2025-04-16T20:52:25Z")

</div>

Ok, perfect.  
Thank you very much!
