Upsert Rows
supabase.upsert
ActionDatabases & warehousesconnection required
Calls the Supabase API with the connection's credentials.
Insert rows, merging into the existing row when a unique constraint collides (PostgREST's Prefer: resolution=merge-duplicates).
Connection
- Required
- Yes — the node will not save without one
- Auth type
- API key
- Providers
- Supabase
- Secret shape
- the project API key, or {"api_key": "…"} / {"service_role_key": "…"}
- Config it needs
- base_url, schema
- Resolved by
- config.connection_id, else node.connection_id
Configuration
5 fields, 2 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
table The table or view to act on, in the connection's schema. | string | Yes | — | — | orders |
rows The row to upsert as an object, or a list of objects. Every row must carry the conflict column(s) or Postgres cannot detect the duplicate. An empty list is refused — there would be nothing to write. | array | Yes | — | ≥ 1 characters; array of object | [{"email":"ada@example.com","plan":"pro"}] |
on_conflict Comma-separated column(s) carrying the UNIQUE constraint to resolve on. Leave blank to use the table's primary key. | string | No | — | — | |
resolution What to do with a duplicate: merge-duplicates updates the existing row, ignore-duplicates leaves it untouched. | string | No | merge-duplicates | one of "merge-duplicates", "ignore-duplicates" | — |
schema Postgres schema for this call (sent as Accept-Profile / Content-Profile). Overrides the connection's schema; leave blank for the connection default. | string | No | — | — | — |
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"on_conflict": "email",
"resolution": "merge-duplicates",
"rows": [
{
"email": "ada@example.com",
"plan": "pro"
}
],
"table": "orders"
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
table The table the call was made against. | string | — |
items The rows PostgREST returned (Prefer: return=representation). | array | — |
count How many rows were returned. | number | — |
{
"count": 0,
"items": [],
"table": ""
}Notes
- A service_role (or sb_secret_…) key has BYPASSRLS and skips every Row Level Security policy on the project; an anon/publishable key is filtered by them.
See Upsert Rows run in a workflow.
In a technical demo we add the Supabase connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.