Skip to content

Supabase

Supabase connects your flow to the database of your Supabase project. With it you can add records to a table, look them up with filters, change them, delete them, and run the functions you have created in your database.

It is useful when your application keeps its data in Supabase and you want a flow to read or update it: save the details of a form, check the status of an order, or start a calculation you already have as a function.

When to use it

  • You want to save in a table every contact that comes in through your website form.
  • An AI agent helps customers and needs to look up their details in your database.
  • You want to mark as handled the requests a flow has processed.
  • You want to delete temporary records that are no longer needed every night.
  • You have a function in Supabase that builds a report and you want to run it from a flow.

Configuration

You need a Supabase API credential with your project’s address (Supabase URL) and its secret service role key. Both are in your Supabase project settings, in the API section. See Credentials.

FieldWhat it does
Credential (required)The Supabase API credential of your project.
Operation (required)What the component does. See Operations. Default: Insert.
Table Name (required)Only in Insert, Get, Update and Delete. The table to work with. The list loads when you choose the credential.
Function (required)Only in Custom API Call. The database function you want to run. The list loads when you choose the credential.
LimitOnly in Get. The maximum number of records to return, up to 1000. Default: 100.
Select Filter TypeOnly in Get, Update and Delete. How you write the filter that picks the records: String (in one line of text) or Build Manually (one condition at a time). Default: String.
Filter StringWith String. The filter in one line, for example status = active, age > 44 or email = like.%@company.com. It accepts the signs =, >, <, >=, <= and !=. Required in Update and Delete; in Get, leaving it empty returns records without filtering.
FiltersWith Build Manually. How many conditions you want to create. In Update and Delete it is shown as Select Condition. For each condition you get Field Name (the column), Condition (eq equal, neq not equal, gt greater, lt less, gte greater or equal, lte less or equal, like and ilike contains the text, or follows your pattern when the value has % (for example %@company.com; ilike ignores case), is, and in one of several values) and Field Value (the value).
Field to Send (required)Only in Update. How many columns you want to change. For each one you get Column Name (the column) and Field Value (the new value).

When you choose a table in Insert, a field appears for each column, with its name and data type, for example email (text). Fill in the ones you want to save; empty ones are not sent, and columns that number themselves are filled in automatically.

When you choose a function in Custom API Call, a field appears for each value the function needs, with its name and type.

Operations

OperationWhat it does
InsertAdds a record to the table with the values of the column fields.
GetReturns the table records that match the filter. If there are none, the run gives an error.
UpdateChanges the chosen columns in the records that match the filter.
DeleteDeletes the records that match the filter. If none is deleted, the run gives an error.
Custom API CallRuns a function of your database with the values you set and returns its result.

Output

The Data output returns the records you worked with, with their columns: the ones added in Insert, found in Get, changed in Update and deleted in Delete. In Custom API Call it returns whatever the function answers.

You can connect the result to an agent, a spreadsheet or an email. The component can also be connected to an Agent as a tool, so the agent looks up or saves data when it needs to. See Tool Mode.

Example

A training school keeps the information requests from its website in Supabase.

  1. The website form reaches the flow with the name, email and course of interest.
  2. Add Supabase with the Insert operation and the school’s Supabase API credential.
  3. In Table Name choose the requests table.
  4. Connect the name, email and course to their column fields, for example name (text), email (text) and course (text).
  5. Later, another flow with the Get operation and the filter status = pending returns the requests still waiting to be handled.

Good practices

  • Test the Update and Delete filter first with the Get operation: that way you see which records will be changed or deleted.
  • The service key gives full access to your database. Keep it only in the credential and do not share it.