IMAP Trigger starts workflow only for the last mail

Hey!

Perhaps there is an easy solution, but at the moment I can’t see it :frowning:
I’m getting a huge amount of emails which should be forwarded, let’s say to Telegram for example.

Actually this is working BUT: When emails arrive nearly at the same time the IMAP Trigger gets triggered and also sees the unread mail before the last mail, but the workflow is only forwarding the last mail and not the unread one which arrived nearly at the same time.

IMAP Email trigger does have have both results and both emails, but only the last one gets forwarded to the next steps in the workflow. So in this case the mail before the last mail is not forwarded.

Is there a simple solution for that. I’m a little bit ashamed that I can’t make it work by myself…

Best!

Hey David!

How are you referencing the data in the next node? If the node is returning the emails in a single item, then you would have to create separate items. You can refer to this code snippet that does that.

If the emails are returned as separate items (which should ideally be the case) the next node should fetch all the emails and forward them. Can you share how you’re referencing the email from the IMAP node?

Thank you for your fast answer. I think that’s the problem. The eMails are “collected” as results in the IMAP Read Trigger but they are not forwarded as seperate items. Even when there are 3 results, there is also just a small 1 number next to the triggers.

The code snipped link doesn’t work. Could you please correct the link, so I can have a look into it.

The Telegram references like this:

{{$node["IMAP Email"].json["textPlain"]}}

Hey!

I still can’t make it work. You were right: Direct connecting a eMail Node to an Telegram-Node works: The results are gettings retransmitted.

In my case every “email result” should start a HTTP Extract. I know it’s just two lines of code but I can’t find the solution.

The use-case is:

EMAIL Read receives two or more emails (results)
HTTP Extract is started for every result (so that there are as many green dots with the number of emails ;-))

I can’t split the results in seperate runs :frowning:

Maybe it works if you use the Function Item node between EmailReadImap and the Telegram with only this Function Item code:

return item

The Function Item node splits the input into multiple items and this maybe could call the Telegram node multiple times.