N8n agent that get drive file and sent them through attachments to gmail?

Hello,

I’m trying hard to push an agent to get files from a drive folder, and then attaching those files to an email.

I was able to download the file, but it seems that in a n8n agent, there is no binary file, and I guess the only way to send file in attachment on gmail email is through binary file.

Do you have any clues ?

Thank you for your help.

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

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

Hi there can you share your workflow? does this gdrive and gmail is a tool connected to the AI Agent or a node?

When you download the file, you must convert it to binary first, and then send the data to AI Agent again.

To do this, you need to use mcp client tool or execute another workflow tool, it can’t be executed in a same workflow since it’ll cause some ‘little chance’ trouble.

The logic is:
When AI executed the tool, it’ll be downloading the file, extracting it, and send it again through the tool. (Or maybe directly send to the gmail tool)
Although I’m not trying that, it’ll maybe help.

Hi,
Yes the tool is connected to the Ai agent.
I found a solution that works.
When the chat with AI is over it return data like name firstname and email and use outside the agent node tool the drive to get the binary file and the gmail account to send email.