# Running DQL in Workflow - How to make task fail if no results come back

**URL:** <https://community.dynatrace.com/t/running-dql-in-workflow-how-to-make-task-fail-if-no-results-come-back/42957>\
**Category:** DQL\
**Tags:** dql, workflows\
**Created:** [November 30, 2023, 1:31pm UTC](https://community.dynatrace.com/t/running-dql-in-workflow-how-to-make-task-fail-if-no-results-come-back/42957 "2023-11-30T13:31:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreas\_grabner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/andreas_grabner/32/27879_2.png) [@andreas\_grabner](https://community.dynatrace.com/u/andreas_grabner)\
**Post date:** [November 30, 2023, 1:31pm UTC](https://community.dynatrace.com/t/running-dql-in-workflow-how-to-make-task-fail-if-no-results-come-back/42957/1 "2023-11-30T13:31:17Z")

</div>

Hi

I have a use case where my workflow must wait until a certain DQL query returns data. My thought was to use a DQL Task and let it “retry on error”. The problem is that I cant specify my “success condition” of the DQL query as the DQL task always returns successful as long as the query itself is not invalid.

Any thoughts on this? I know I can solve this by using a JavaScript task that exeuctes the DQL but wondering if there is an option of just using the DQL Task

---

<div class="post-metadata">

**Author:** ![ksimovski23](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@ksimovski23](https://community.dynatrace.com/u/ksimovski23)\
**Post date:** [March 21, 2024, 2:59pm UTC](https://community.dynatrace.com/t/running-dql-in-workflow-how-to-make-task-fail-if-no-results-come-back/42957/2 "2024-03-21T14:59:29Z")

</div>

Any updates by chance?

---

<div class="post-metadata">

**Author:** ![andreas\_grabner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/andreas_grabner/32/27879_2.png) [@andreas\_grabner](https://community.dynatrace.com/u/andreas_grabner)\
**Post date:** [March 22, 2024, 10:17am UTC](https://community.dynatrace.com/t/running-dql-in-workflow-how-to-make-task-fail-if-no-results-come-back/42957/3 "2024-03-22T10:17:15Z")

</div>

Hi. I just internally reached out to our product manager&nbsp;[@ChristopherHejl](https://community.dynatrace.com/user/44096)&nbsp;- he told me that they are planning to add the option to have a task fail in case no results come back.
