Filter to stop scenario when no data found by Gmail trigger?

Hi folks,

I’m trying to stop this scenario from running the array aggregator and the “run a scenario” step when the time-triggered Gmail “watch emails” step returns no bundles. I’ve tried so many different filters, right after the gmail step and right before the array aggregator step, but nothing has worked so far.

Is what I’m trying to do even possible? Or is it only possible to stop after the array aggregator returns an array with size zero?

Thank you,

Shawn

Hey Shawn,

add a filter after the aggregator and have it check if the Total Number of bundles is not equal to 0. Then the next step will execute only if there are items that have been aggregated.

On the other side → you can switch to a mailhook module to get instant triggers when a new email arrives instead of the polling trigger right now. This way it will only process one email at a time and also save on operations.

3 Likes

Thanks @Stoyan_Vatov I know I can set the array aggregator to stop if the array size is 0 - I’m trying to avoid having it trigger at all.

And the problem with using a mailhook module instead of the gmail module is that this scenario is designed to run once per day and process a whole batch of emails, not just one. Using a mailhook that processes the emails individually would vastly increase the number of credits used.

The aggregator will always run no matter what, its just how the module works. So you can’t avoid that unfortunately.

1 Like

You can still switch to a mailhook module and have it run on a schedule.
When the scenario runs it will proceed to process the items in the queue.

For more information on web/mailhooks, see Webhooks - Apps Documentation

Hope this helps! If you are still having trouble, please provide more details.

@samliew

1 Like

Thanks @samliew - Won’t that treat each item in the queue as a separate trigger operation, though? This scenario and its pair are already heavy on operations/credits, and with the gmail module it’s just one operation with as many bundles as there are emails.

If it is scheduled (instead of “Immediately”), then no. It would function almost exactly the same. For simplicity you could just keep your scenario as it is.

2 Likes

Awesome, I’ll try that today and report back. Thank you!

Another potential option is to have a scheduled trigger and then search for every email in the past day or so but I think the scheduling option should work just fine.

It worked! Thanks again @samliew :raising_hands:

No problem, glad I could help with "Filter to stop scenario when no data found by Gmail trigger?"! :slight_smile:

1. Which was the most helpful post in this thread?

The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep this forum organised. :folded_hands:

This marks the topic as solved, so that others can:

  • save time when browsing the latest activity on the forum, and
  • quickly jump to the solution in this topic

To do this, simply click the checkbox at the bottom of the post that is the most helpful in answering your question.

a screenshot of post menu options at the bottom of each post

:link: Here’s a magic link to a list of your other “unsolved” topics: status:unsolved

2. Have you learnt something new?

Do bookmark this topic so you can easily find and return to this topic in future.

a screenshot of bookmark link at the bottom of the topic

:link: Here’s a magic link to a list of your bookmarks /my/activity/bookmarks

3. Have a different/follow-up question? Start a new topic.

Creating a new topic for each question makes it easier for others with the same problem to search for answers. You are also more likely to receive help sooner as new topics are displayed first on the forum’s “new” page!

Hope this helps! If you are still having trouble, please provide more details.

@samliew