Save Memory
AI-generatedOverview
The Supabase Memory node's 'Save Memory' operation allows users to insert or upsert data into a specified Supabase table. It supports multiple data mapping modes including manual field mapping, automatic mapping of input JSON fields to table columns, and providing raw JSON data. Users can optionally use upsert functionality to insert or update records based on a unique constraint, and choose whether to return the affected rows after the operation. This operation is useful for saving structured data such as session information, agent memory, or any custom data into a Supabase database for later retrieval or processing.
Use Case Examples
- Saving session data with explicit field mappings to a Supabase table.
- Automatically mapping all input JSON fields to corresponding table columns for quick data insertion.
- Using raw JSON data to insert or update records in a Supabase table.
- Performing an upsert operation to avoid duplicate entries based on a unique key.
Properties
| Name | Meaning |
|---|---|
| Table Name | The Supabase table to operate on, selected either from a list or specified by name. |
| Data Mapping Mode | Determines how input data is mapped to table columns: manual mapping, automatic mapping, or raw JSON body. |
| Field Mappings | When using manual mapping, defines the column names and corresponding values to store, including the data type for each value. |
| JSON Data | Raw JSON object representing the record to insert or update, used when data mapping mode is JSON body. |
| Upsert | Whether to use upsert (insert or update if conflict). Requires a unique or primary key constraint. |
| Conflict Column | The column with a unique constraint to detect conflicts for upsert operations. |
| Return Updated Data | Whether to return the affected rows after the save operation. |
| Data Transform Template (optional) | A JSON template to transform input data before saving, where keys are target column names and values are n8n expressions or static values. |
Output
JSON
json- The inserted or upserted record(s) returned from Supabase, or a success confirmation object if no data is returned.
Dependencies
- Supabase API credentials including Supabase URL and service role key for authentication.
Troubleshooting
- Ensure the Supabase credentials are correctly configured and have the necessary permissions for insert or upsert operations.
- When using upsert, verify that the conflict column has a unique or primary key constraint in the Supabase table.
- If the node throws errors related to data types, check that the value types in field mappings are correctly set or use auto-detect.
- If no data is returned despite 'Return Updated Data' being enabled, confirm that the Supabase table and query support returning data after insert/upsert.