# Setting a condition that skip a step if the trigger returns 0

**URL:** <https://community.dynatrace.com/t/setting-a-condition-that-skip-a-step-if-the-trigger-returns-0/56382>\
**Category:** Automations\
**Tags:** workflows, automations\
**Created:** [July 8, 2026, 5:09am UTC](https://community.dynatrace.com/t/setting-a-condition-that-skip-a-step-if-the-trigger-returns-0/56382 "2026-07-08T05:09:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [July 8, 2026, 5:09am UTC](https://community.dynatrace.com/t/setting-a-condition-that-skip-a-step-if-the-trigger-returns-0/56382/1 "2026-07-08T05:09:42Z")

</div>

Hi,

I would like creating a workflow to be triggered when the events that have been marked as ‘closed’ and have a specific tag.&nbsp;And in the first step following the trigger, set a condition so that the step is skipped if the trigger’s result is 0

For that, I’ve defined this event trigger:

 ![erh_inetum_0-1783487040794.png](https://global.discourse-cdn.com/dynatrace/original/3X/0/a/0a0e8d1bc6e6ec27f0b37cd63517e495b2056a18.png)

And in the first step after event trigger, this:

 ![erh_inetum_1-1783487135397.png](https://global.discourse-cdn.com/dynatrace/original/3X/7/6/76a10fcde21b77816f2dee20760213909cc7d73c.png)

I know this condition “{{ result(“Event trigger”) | length \> 0}}” is not correct because&nbsp;the previous tasks is a trigger.

Does any know what would be the right condition?

Thanks in advance.

Regards,

Elena.

---

<div class="post-metadata">

**Author:** ![dylan\_taelemans](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dylan_taelemans/32/21501_2.png) [@dylan\_taelemans](https://community.dynatrace.com/u/dylan_taelemans)\
**Post date:** [July 8, 2026, 7:13am UTC](https://community.dynatrace.com/t/setting-a-condition-that-skip-a-step-if-the-trigger-returns-0/56382/2 "2026-07-08T07:13:55Z")

</div>

I’m a bit confused. The event trigger should always produce a result; otherwise, the workflow wouldn’t be triggered in the first place.

---

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [July 8, 2026, 7:21am UTC](https://community.dynatrace.com/t/setting-a-condition-that-skip-a-step-if-the-trigger-returns-0/56382/3 "2026-07-08T07:21:13Z")

</div>

Hi Dylan,

As you can see, now, at the time I execute the querry, it returns 0.

 ![erh_inetum_0-1783495087876.png](https://global.discourse-cdn.com/dynatrace/original/2X/8/88d5d7fb8aabfafcb9c63fe65b039a575ee5b374.png)

I would like the event triggers when the result of the condition is \> 0 or in the next steps, the steps was skipped if the result of the condition is 0.

Is it possible to do this?

Thanks,

Elena.

---

<div class="post-metadata">

**Author:** ![dylan\_taelemans](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dylan_taelemans/32/21501_2.png) [@dylan\_taelemans](https://community.dynatrace.com/u/dylan_taelemans)\
**Post date:** [July 8, 2026, 7:27am UTC](https://community.dynatrace.com/t/setting-a-condition-that-skip-a-step-if-the-trigger-returns-0/56382/4 "2026-07-08T07:27:02Z")

</div>

Okay, I think there’s a misunderstanding here.

**Query past events** does not run or trigger your workflow. It’s only used to verify that your event filter is working as expected.

In your case, there wasn’t a single event in the past 7 days that matched your filter conditions.  
So, let’s say you created this workflow a week ago. It would never have started because no event matching your filter conditions would have occurred to trigger it. No need for&nbsp;{{ result(“Event trigger”) | length \> 0}} as you would never even start your workflow.

---

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [July 8, 2026, 8:15am UTC](https://community.dynatrace.com/t/setting-a-condition-that-skip-a-step-if-the-trigger-returns-0/56382/5 "2026-07-08T08:15:28Z")

</div>

Hi Dylan,

You are right. Putting the condition for which I want the workflow triggers it’s enough. Now it’s working as it’s expected.

Thanks a lots for your help and also for your answer in this other [post](https://community.dynatrace.com/topic/290443) because it’s helped me to complete the condition.

Regards,

Elena.

---

<div class="post-metadata">

**Author:** ![sonja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sonja/32/10349_2.png) [@sonja](https://community.dynatrace.com/u/sonja)\
**Post date:** [July 17, 2026, 7:33am UTC](https://community.dynatrace.com/t/setting-a-condition-that-skip-a-step-if-the-trigger-returns-0/56382/6 "2026-07-17T07:33:01Z")

</div>

Hi&nbsp;[erh\_inetum!](https://community.dynatrace.com/user/40722)

What kind of events do you want your workflow to trigger on? For problem records, we have a dedicated problem trigger where you can configure it to only fire for the “closed” state, which might be a cleaner fit for your use case.

Curious to hear more about what you’re trying to achieve!

You can find more on alerting and notifications in the documentation here: [Alerting and notifications — Dynatrace Docs](https://docs.dynatrace.com/docs/analyze-explore-automate/alerting-and-notifications).

Sonja

 ![Screenshot 2026-07-17 at 09.24.09.png](https://global.discourse-cdn.com/dynatrace/original/3X/f/0/f0717e5e0510856b4358ecb57d4d6789324874c9.png)

---

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [July 28, 2026, 9:05am UTC](https://community.dynatrace.com/t/setting-a-condition-that-skip-a-step-if-the-trigger-returns-0/56382/7 "2026-07-28T09:05:22Z")

</div>

Hi Sonja,

We want to trigger an event when a problem is transitioning to closed. With the solution proposed for Dylan (&nbsp;[@dylan\_taelemans](https://community.dynatrace.com/user/19639)&nbsp;) we got it.

Let me know if it’s clear or you need any additional explanation.

Thanks a lot for your interest.

Regards,

Elena.

---

<div class="post-metadata">

**Author:** ![sonja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sonja/32/10349_2.png) [@sonja](https://community.dynatrace.com/u/sonja)\
**Post date:** [July 29, 2026, 11:32am UTC](https://community.dynatrace.com/t/setting-a-condition-that-skip-a-step-if-the-trigger-returns-0/56382/8 "2026-07-29T11:32:31Z")

</div>

Good to hear it’s working now! If you ever want to simplify the logic, you can use the new “trigger only on close” option we just added to the problem trigger.

Sonja
