# \_execute API not working when watch is inactive

**URL:** <https://discuss.elastic.co/t/execute-api-not-working-when-watch-is-inactive/122338>\
**Category:** Elasticsearch\
**Created:** [March 2, 2018, 10:58pm UTC](https://discuss.elastic.co/t/execute-api-not-working-when-watch-is-inactive/122338 "2018-03-02T22:58:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karthik\_Ramachandran](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/32.png) [@Karthik\_Ramachandran](https://discuss.elastic.co/u/Karthik_Ramachandran)\
**Post date:** [March 2, 2018, 10:58pm UTC](https://discuss.elastic.co/t/execute-api-not-working-when-watch-is-inactive/122338/1 "2018-03-02T22:58:47Z")

</div>

Created watch in inactive state, and tried using \_execute API to execute manually. But, it is not executing and have to make watch active

Not sure of the cause - any fixes released for this or am I missing anything. Thanks for guidance.

Executing the watch when inctive results with

{  
"\_id": "mywatch\_0e35eedd-346b-4a06-acf7-8452aaabc324-2018-03-02T22:54:50.994Z",  
"watch\_record": {  
"watch\_id": "mywatch",  
"node": "I7NfChT4RzCk2axGnErXYg",  
"state": "execution\_not\_needed",  
"trigger\_event": {  
"type": "manual",  
"triggered\_time": "2018-03-02T22:54:50.994Z",  
"manual": {  
"schedule": {  
"scheduled\_time": "2018-03-02T22:54:50.994Z"  
}  
}  
},  
"messages": [  
"Watch is not active"  
]  
}  
}

Once made active, and executed - it send me the alert

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [March 4, 2018, 12:53am UTC](https://discuss.elastic.co/t/execute-api-not-working-when-watch-is-inactive/122338/2 "2018-03-04T00:53:33Z")

</div>

Hi Karthik,

By default, when you add a watch it is immediately set to the active state, registered with the appropriate trigger engine, and executed according to its configured trigger.

You can also set a watch to the inactive state- which is what you did in ur case I guess. Inactive watches are not registered with a trigger engine and can never be triggered.

Hope this explains.

Thanks  
Rashmi

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 4, 2018, 1:30am UTC](https://discuss.elastic.co/t/execute-api-not-working-when-watch-is-inactive/122338/3 "2018-03-04T01:30:56Z")

</div>

I think we should allow executing inactive watches, as this is a request manually triggered. I will take a closer look, what is the complexity behind this - but should not be too hard.

--Alex

---

<div class="post-metadata">

**Author:** ![Karthik\_Ramachandran](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/32.png) [@Karthik\_Ramachandran](https://discuss.elastic.co/u/Karthik_Ramachandran)\
**Post date:** [March 7, 2018, 12:59am UTC](https://discuss.elastic.co/t/execute-api-not-working-when-watch-is-inactive/122338/4 "2018-03-07T00:59:35Z")

</div>

Thanks rashmi and alex.

Yes. I would also agree with Alex as executing a inactive watch explicitly should not require active status. Having active status to a watch would trigger it by schedule, and there could be reasons why a watch is made inactive temporarily and triggered explicitly.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 19, 2018, 2:38pm UTC](https://discuss.elastic.co/t/execute-api-not-working-when-watch-is-inactive/122338/5 "2018-03-19T14:38:37Z")

</div>

FYI: This will work from 6.3.0 onwards.

---

<div class="post-metadata">

**Author:** ![Karthik\_Ramachandran](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/32.png) [@Karthik\_Ramachandran](https://discuss.elastic.co/u/Karthik_Ramachandran)\
**Post date:** [March 20, 2018, 6:12am UTC](https://discuss.elastic.co/t/execute-api-not-working-when-watch-is-inactive/122338/6 "2018-03-20T06:12:51Z")

</div>

Great. Thanks Alex.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 17, 2018, 6:12am UTC](https://discuss.elastic.co/t/execute-api-not-working-when-watch-is-inactive/122338/7 "2018-04-17T06:12:52Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
