Dynamic EmailReadImap Mailbox Credential

New to n8n— pretty neat but I’ve been banging my head against a wall for an hour.

I’m trying to check a series of mailboxes based on some JSON I’m getting from an HTTP query. Seem like it’s right in n8n’s wheelhouse at the outset.

I couldn’t seem to route a function node’s output into a EmailReadImap node directly— I imagine because it’s a trigger and it polls/waits rather than returning if there’s no mail. Doesn’t seem to be a non-trigger imap polling node or a pop3 node. I saw people mention that ExecuteWorkflow passes its flow context into the new workflows through the start node– the GUI doesn’t have any hints about the right way to do it and I can’t find anything in the docs about it.

Do you have more in-depth technical documentation? Is what I’m doing impossible? Maybe I’m holding a shovel and trying to use it like a spoon? Should really just be using a regular scripting language and system tools?

Thanks in advance, and much appreciated— Definitely a neat tool.

Hi @drew, welcome to the community :tada:

You’re quite right, this will be because the EmailReadImap node is a trigger. This means it’ll always be the first node to run and won’t be able to read any data from other nodes like the Start node or for example a webhook node.

So unfortunately I can’t think of any way of dynamically fetching data from different mailboxes in the way you have described.

Are you using Gmail by any chance? If so, you could consider using a Gmail node for each mailbox you want to query and put a Switch node in front of them verifying the data coming from your HTTP request. The Gmail node is a regular node instead of a trigger node.

As for a regular POP3 node (or IMAP polling node), you might want to raise a separate feature request here on the forum so you (and other community members, of course) can vote for it.