Describe the problem/error/question
i have built a knowledge base for outlook emails. The workflow adds selected mail field and processed attachments into pgvector. I also have a query workflow. Now, when i ask something, the ai agent answers and add source also. (filename, mail link)
But I want to store the file data, so that it is clickable and user can view or download it.
For now, I am using same database, but a different table for storing the binary attachment file.
In the table, I have mail id, file name, file data.
Now, via postgres node, I can insert into the table. But the problem is, {{ $binary.attachment }} only gives the file reference. It seems n8n uses file storage v2, So, with this setup, I can’t insert actual file, rather a reference!!
How to store the actual binary file?
and while inserting, do I need to maintain relationship or meta data, so that while querying, with each file name, file data is also attached.. Currently in vectorstore node, i am adding file name and mail id as meta data

