step

supabase

Execute Supabase operations for database, auth, storage, and realtime.

Overview

Execute Supabase operations for database, auth, storage, and realtime.

Supports operations: - query: Query table data with filters, sorting, pagination - insert: Insert new rows into a table - update: Update existing rows - upsert: Insert or update rows (based on unique constraints) - delete: Delete rows from a table - rpc: Call PostgreSQL stored procedures/functions - storage_upload: Upload files to Supabase Storage - storage_download: Download files from Supabase Storage - storage_list: List files in a storage bucket - storage_delete: Delete files from storage

Setup: 1. Create a Supabase account at https://supabase.com/ 2. Create a new project in the Supabase dashboard 3. Get your project URL and API keys from Settings > API 4. Use the anon key for client-side operations (respects RLS policies) 5. Use the service_role key for admin operations (bypasses RLS - keep secure!) 6. Store credentials securely (e.g., environment variables: SUPABASE_URL, SUPABASE_KEY)

API Keys: - Required. Get from https://supabase.com/dashboard/project/_/settings/api - Anon key: Safe for client-side, respects Row Level Security (RLS) - Service role key: Admin access, bypasses RLS - KEEP SECRET!

Examples

Query users with filters

Select users over 18 years old, ordered by creation date

type: supabase
url: ${env:SUPABASE_URL}
key: ${env:SUPABASE_KEY}
operation: query
table: users
select: id,email,name,age,created_at
filter:
  age:
    gte: 18
order: created_at.desc
limit: 100
output_to: users

Insert a new record

Create a new user in the database

type: supabase
url: ${env:SUPABASE_URL}
key: ${env:SUPABASE_KEY}
operation: insert
table: users
data:
  email: ${user.email}
  name: ${user.name}
  age: 25
  created_at: ${meta.timestamp}
output_to: new_user

Update records

Update user status and timestamp

type: supabase
url: ${env:SUPABASE_URL}
key: ${env:SUPABASE_KEY}
operation: update
table: users
data:
  status: active
  updated_at: ${meta.timestamp}
filter:
  id:
    eq: ${user.id}
output_to: update_result

Upsert with conflict resolution

Insert or update based on unique constraint

type: supabase
url: ${env:SUPABASE_URL}
key: ${env:SUPABASE_KEY}
operation: upsert
table: user_preferences
data:
  user_id: ${user.id}
  theme: dark
  language: en
  notifications: true
match:
  user_id: ${user.id}
output_to: preferences

Call stored procedure

Execute a PostgreSQL function

type: supabase
url: ${env:SUPABASE_URL}
key: ${env:SUPABASE_KEY}
operation: rpc
function_name: get_user_statistics
function_params:
  user_id: ${user.id}
  start_date: "2024-01-01"
  end_date: "2024-12-31"
output_to: user_stats

Upload file to storage

Upload an image to Supabase Storage

type: supabase
url: ${env:SUPABASE_URL}
key: ${env:SUPABASE_KEY}
operation: storage_upload
bucket: avatars
path: user_${user.id}/avatar.jpg
file_data: ${file.base64_data}
file_options:
  contentType: image/jpeg
  cacheControl: "3600"
  upsert: true
output_to: upload_result

Query with nested relations

Select posts with author information

type: supabase
url: ${env:SUPABASE_URL}
key: ${env:SUPABASE_KEY}
operation: query
table: posts
select: id,title,content,author:users(id,name,email)
filter:
  published:
    eq: true
order: created_at.desc
limit: 20
output_to: posts

Configuration

Parameter Type Required Description
url string Yes Supabase project URL (format: https://xxxxx.supabase.co)
key string Yes Supabase API key (anon key for client-side, service_role key for admin operations)
operation string Yes Operation to perform: query (select), insert (add rows), update (modify rows), upsert (insert or update), delete (remove rows), rpc (call function), storage_upload, storage_download, storage_list, storage_delete
Options: query, insert, update, upsert, delete, rpc, storage_upload, storage_download, storage_list, storage_delete
table string No Table name for database operations (required for query, insert, update, upsert, delete)
select string No Columns to select (comma-separated, supports nested relations). Use '*' for all columns
filter string No Query filters using PostgREST syntax (eq, gt, lt, gte, lte, like, ilike, in, is, etc.)
order string No Sort order (column.asc or column.desc)
limit string No Maximum number of rows to return
offset string No Number of rows to skip (for pagination)
data string No Data to insert or update (required for insert, update, upsert)
match string No Columns to match for update/upsert operations
function_name string No Name of the PostgreSQL function to call (for rpc operation)
function_params string No Parameters to pass to the RPC function
bucket string No Storage bucket name (for storage operations)
path string No File path in storage bucket
file_data string No Base64 encoded file data or file content for upload
file_options string No File upload options (content-type, cache-control, upsert, etc.)
timeout integer No Request timeout in seconds
Default: 30
output_to string No Key name where the response will be stored in the event
Default: "supabase"

Base Configuration

These configuration options are available on all steps:

Parameter Type Default Description
name null Optional name for this step (for documentation and debugging)
description null Optional description of what this step does
retries integer 0 Number of retry attempts (0-10)
backoff_seconds number 0 Backoff (seconds) applied between retry attempts
retry_propagate boolean false If True, raise last exception after exhausting retries; otherwise swallow.