IMAP Trigger than unpack pdf

Describe the problem/error/question

Hello everybody… I try to make quite easy workflow, but I’m banging my head against the wall…

The concept is simple - when mail arrives to specified folder, get the pdf attachment and do something with it.
So - first step is to trigger (when mail arrives).
If I use Email Trigger (IMAP) - it works perfectly…but I can’t get attachment… I just cant see it in input
If I use n8n-nodes-imap- there’s no triggers. for new email - only Schedule or webhook…
if I use n8n-nodes-imap-agent - there’s a trigger (On new message) but Problem in node ‘IMAP Trigger‘

IMAP connection failed: Failed to receive greeting from server in required time. Maybe should use TLS?
I’m about to go crazy after 2 days from fruitless fighting

n8n version:

  • Database (default: SQLite): postgresql
  • n8n EXECUTIONS_PROCESS setting (default: own, main): I don’t know. Own server?
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Debian Trixie

Hi @Tomasz_Brzezina, stick with the native Email Trigger (IMAP), the one that triggers fine, and drop the two community nodes. Two things are hiding the attachment:

  1. Set the trigger’s Format field to “Resolved”. That’s what saves attachments as binary; Simple doesn’t pull them in.
  2. The attachment never shows in the JSON/Table view, it lands in the Binary tab of the node output. That’s almost certainly why it looked missing.

Once it comes through as binary, add an Extract from File node (operation: Extract from PDF) right after the trigger to unpack the PDF. Want me to post the two-node setup?

But how to move email to other folder…

@Tomasz_Brzezina the native Email Trigger (IMAP) can’t move emails, its only post-read options are Mark as Read or Nothing, and a trigger can’t be called from downstream, so there’s no native move-to-folder.

Since you’re self-hosted, the clean way is the community node n8n-nodes-imap (Settings > Community Nodes, search n8n-nodes-imap). It adds a regular IMAP node with a Move Message operation. Wire it after your PDF step and move the message (it moves by the message UID) into your target folder, e.g. a “Processed” mailbox.

So the flow becomes: IMAP trigger → extract PDF → IMAP Move to the other folder, which also keeps your inbox clean for the next run.

The native Email Trigger (IMAP) can actually pull the attachment. It’s off by default, which is why it’s not showing up. Set Format to Simple and turn on “Download Attachments”. The PDF then arrives as binary data called attachment_0, which lives in the node’s Binary tab rather than the JSON panel (that’s the part that catches most people). Extract from File with operation PDF, pointed at attachment_0, gives you the text.

Import-ready:

Put your IMAP creds on the trigger and set the mailbox to your folder. The last node is a placeholder, swap in whatever you need to do with the text.