How to download pdf from supabase?

Hi there,

I am new to n8n and want to download a pdf stored at us-abase.
I found no node for this. Is there a workaround?
Tanks in advance, happy coding…

Information on your n8n setup

Version 1.33.0

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

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Usually (with other services) when you make a query to the API you get a download link to the file.

Then you can download the file using the HTTP-Request node.

1 Like

Hi @atwork1,

thanks for your answer…

recording to the supabase API

I tried the following

…and get a 404 error - but I know the file “/analyses_bucket/pdf/1715072904040000.pdf” exists. What I am doing wrong?

Do you need the header information you’re sending? You’re already authenticated, by the settings above.

Hi @atwork1

thank you very much again for your response…

I switched off the header informationen, but still get the 404 error:

Any other ideas?

This file I can directly access via browser:
https://xxxxxxxxxx.supabase.co/storage/v1/object/public/analyses_bucket/pdf/1715134253889000.pdf

Any ideas how to debug?

can you set the URL to “Expression” and the expression to
{{ $json.pdf_name }}

SOLVED

The Swagger API documentation (Swagger UI) is incorrect / outdated! The correct one is here: Serving assets from Storage | Supabase Docs

So correct endpoint in my case is https://xxxxxxxxx.supabase.co/storage/v1/object/authenticated/analyses_bucket/pdf/1715221982654000.pdf

Further learning: I looked into the RLS a bit because at first I thought it had something to do with it. However, with the service role we bypass the RLS.

2 Likes

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