How to processing undetermined amount of attachment (from Outlook trigger)

Describe the problem/error/question

I’m writing a workflow to fetch pdf attachment from emails on my outlook account, and upload to my Paperless-NGX. Those emails might contains multiple files, and only a few of them might be pdf.

Now the binary output from the outlook trigger is essentially an object with multiple attachment_ prefix. I can use the these field name in the HTTP request node.

The question is, how can I specify the Input Data Field Name to reflects the binary file I want to upload via HTTP request? Given that I only want one with pdf types which can be in any where inside the list of binary output.

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.100.1
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu Server 24.04

Hey @wutipong hope all is well, welcome to the community.

You can put a code node in front of the http request node, which would process all binaries, filter out anything that isn’t mime type application/pdf and send only what you need down the flow path.

Thank you, @jabbson. You gave me an idea. Now I add a code node which return keys using Object.keys($binary).

So the current flow is like

I’m going to move the filtering inside the code node as per your suggestion later, but for now this seems to work to me.

Thanks a lot!