What is the best way to debounce a trigger when files are uploaded and multiple emails are sent?

This topic was automatically generated from Slack. You can find the original thread here.

Is there a way to debounce a trigger, every time files are uploaded to a source, a bunch of emails in quick succession are sent. Ideally it would trigger on the first email/once per bunch, but not for each

Which trigger are you referring to?

There are built in deduping strategies available to sources, and it just depends on how events are uniquely identified if they can be deduped accurately.

The “new emails” trigger

It gets like 20 emails daily, notifying the recipient that x or y or z was uploaded. I only care about x being uploaded

X is unique within a day, but not across days. X+email time stamp would be unique across days/emails tho

Thanks, is there a differentiating factor between emails? Like a pattern in the subject line or body?

X / Y / Z are in the email itself

ideally it would be, trigger when you get an email who’s body contains X

Then you might be able to use a Filter action to filter out messages that don’t apply to the rest of the workflow

It will exit the workflow early if the body contains certain keywords

ahhh I was unaware there was a filter, I’m new to pipedream!

Yup no problem. You can also use Node.js or Python to accomplish the same goal.

I’m pretty sure that will do it. In fact, this whole email thing was an attempt to get around multiple triggers that I would have gotten if I used the “trigger on new file to S3” since multiple files are uploaded but I only care about 1 or 2 of those uploaded files. I might try s3 + filter if that’s possible instead.

Thanks for your help Pierce!

Sure thing :+1: