节点 / builtin / integration
Supabase
Read and write rows in your Supabase project via PostgREST — select, insert, update, upsert, delete, and RPC — using the anon key with RLS.
此内容尚不支持你的语言。
Read and write rows in a Supabase database, or call one of its functions, so your workflow’s data lands in a real table you can query and share.
What it does
Section titled “What it does”Pick an Operation:
- Select rows: read rows from a table, with optional filters, chosen columns and a limit.
- Insert row: add one row.
- Update rows: change the rows that match your filters.
- Upsert row: add a row, or update it if a row with the same key already exists.
- Delete rows: remove the rows that match your filters.
- Call function (RPC): run a Postgres function in your database with named arguments.
Update rows and Delete rows refuse to run without at least one filter, so a missing filter can never change or erase a whole table.
The node uses your project’s anon (public) key. What that key may read and write is decided by the Row Level Security (RLS) policies on each table. If you paste the secret service_role key by mistake, the node stops before sending anything, because that key ignores RLS.
Where Data Store keeps small values in your browser, Supabase keeps them in a database outside it.
When to use it
Section titled “When to use it”- Collect scraped prices, job offers or leads into a table, one row per run.
- Check whether a record already exists before acting on it.
- Mark rows as processed after a workflow handled them.
- Trigger logic you wrote in the database, such as a function that computes a report.
Inputs and settings
Section titled “Inputs and settings”| 设置项 | 类型 | 作用 |
|---|---|---|
| Credential (必填) | Credential | Your Supabase project’s anon (public) key, stored as a Bearer Token credential. Do NOT use the service_role key — it bypasses Row Level Security and is rejected. Access is enforced by your RLS policies. |
6 个选项 · 选择“Operation”以查看其设置
Select rows 的设置
| 设置项 | 类型 | 作用 |
|---|---|---|
| Project URL (必填) | URL | Your Supabase project URL (Project Settings → API), e.g. https://abcd.supabase.co. |
| Table (必填) | Text | The table name. |
| Columns | Text | Comma-separated columns to return, or * for all. |
| Filters | Key-value pairs | column → operator.value pairs, e.g. id → eq.42, age → gt.18, name → like.*acme* (PostgREST operators). |
| Limit | Number | Maximum rows to return. |
Insert row 的设置
| 设置项 | 类型 | 作用 |
|---|---|---|
| Project URL (必填) | URL | Your Supabase project URL (Project Settings → API), e.g. https://abcd.supabase.co. |
| Table (必填) | Text | The table name. |
| Row (必填) | Key-value pairs | Column → value pairs for the row. |
Update rows 的设置
| 设置项 | 类型 | 作用 |
|---|---|---|
| Project URL (必填) | URL | Your Supabase project URL (Project Settings → API), e.g. https://abcd.supabase.co. |
| Table (必填) | Text | The table name. |
| Fields (必填) | Key-value pairs | Column → value pairs to change. |
| Filters (必填) | Key-value pairs | column → operator.value pairs, e.g. id → eq.42, age → gt.18, name → like.*acme* (PostgREST operators). |
Upsert row 的设置
| 设置项 | 类型 | 作用 |
|---|---|---|
| Project URL (必填) | URL | Your Supabase project URL (Project Settings → API), e.g. https://abcd.supabase.co. |
| Table (必填) | Text | The table name. |
| Row (必填) | Key-value pairs | Column → value pairs for the row. |
| On conflict | Text | Column(s) that identify a duplicate for upsert (e.g. email). Defaults to the primary key. |
Delete rows 的设置
| 设置项 | 类型 | 作用 |
|---|---|---|
| Project URL (必填) | URL | Your Supabase project URL (Project Settings → API), e.g. https://abcd.supabase.co. |
| Table (必填) | Text | The table name. |
| Filters (必填) | Key-value pairs | column → operator.value pairs, e.g. id → eq.42, age → gt.18, name → like.*acme* (PostgREST operators). |
Call function (RPC) 的设置
| 设置项 | 类型 | 作用 |
|---|---|---|
| Project URL (必填) | URL | Your Supabase project URL (Project Settings → API), e.g. https://abcd.supabase.co. |
| Function (必填) | Text | The Postgres function to call via RPC. |
| Arguments | Key-value pairs | Named arguments for the function. |
正在显示 Select rows 的设置
-
Project URL is the address shown in Supabase under Project Settings → API, like
https://abcd.supabase.co. Do not add/rest/v1. -
Filters take the column name as key and
operator.valueas value. Common operators:Value Means eq.42equals 42 neq.doneis not donegt.18/lt.100greater than 18 / less than 100 like.*acme*contains acme(case-sensitive;ilikeignores case)in.(new,open)is one of the listed values is.nullis empty A value without an operator, like just
42, does not work. -
Columns is a comma-separated list such as
id,title,price. Empty means all columns. -
Row and Fields take column names as keys. Use expressions for values, for example
title→{{ $input.title }}. -
On conflict names the column that identifies the same row, for example
urloremail. That column needs a unique constraint in the table. Empty means the primary key.
Outputs
Section titled “Outputs”-
Output
- Select rows returns the matching rows, one item per row.
- Insert row, Update rows, Upsert row and Delete rows return the rows as they are after the change (for Delete, the rows that were removed). An empty result on Update or Delete means no row matched the filters, or RLS hid them.
- Call function (RPC) returns whatever the function returns.
Dependencies and credentials
Section titled “Dependencies and credentials”- Credential (connection, Bearer Token): required. See Connect Supabase.
Use your project’s anon public key, saved as a Bearer Token credential:
- In Supabase, open Project Settings → API.
- Copy the key labelled
anonpublic. Do not useservice_role(secret). - Create a Bearer Token credential with it. See Create a credential.
Then give the anon role the access the workflow needs with RLS policies on each table, for example a policy that allows insert on prices.
Example workflow
Section titled “Example workflow”- A Context Menu trigger adds “Save to my table” to the right-click menu.
- Get Page Metadata reads the page’s
urlandtitle. - Supabase, Upsert row, Project URL
https://abcd.supabase.co, Tablesaved_pages, Rowurl→{{ $input.url }}andtitle→{{ $input.title }}, On conflicturl. Saving the same page twice updates its row instead of adding a second one.
Common issues
Section titled “Common issues”- “This is a Supabase service_role key, which bypasses Row Level Security…”. You saved the secret key. Replace it with the
anonkey in the credential. - “Supabase Error: 401 … the request was blocked” (or 403). An RLS policy does not allow this operation for the anon role. Add a policy for it on the table in Supabase.
- “Update requires at least one filter…” / “Delete requires at least one filter…”. Add a filter such as
id→eq.{{ $input.id }}. - “Supabase Error: 404 …”. The Table or Function name is wrong, or the table is not in the
publicschema. - Select returns an empty list. The filters match nothing, or RLS hides the rows from the anon role. Check the filter format (
eq.42, not42) and the table’s select policy.
Related nodes
Section titled “Related nodes”- Data Store: keep small values in the browser, no account needed.
- Baserow / NocoDB: a spreadsheet-like database.
- Airtable: rows in an Airtable base.
- Http Request: call other Supabase services, such as Storage.