How do I create a workflow that retrieves images from the database when I ask the agent to display them?

Hey everyone,I’m trying to build a workflow in n8n where an AI Agent can respond with an image whenever I ask something like:
“Show me the image of product X” or “Display the stored picture for Y”.

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

Thanks in advance :folded_hands: Any example workflows or best practices for this would be very helpful.

Information on your n8n setup

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

Hey @astrumax hope all is well. Welcome to the community.

A few things that I want to mention here - storing images in the database is not always the best way to go about it. What you want most of the time is to store them in some sort of storage and have a way to link them with URLs. This way you would have to store the references in the database, instead of images themselves.

A solid example of doing it this way could be found here, they are using Supabase for storing files alongside their embeddings:

2 Likes

Thank you so much, @jabbson, for your quick and clear response. Your explanation really helped me move forward with my workflow. I truly appreciate the time you took to guide me.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.