Turso icon

Turso

Execute operations on Turso database

Overview

This node enables interaction with a Turso database, specifically allowing users to insert rows into a specified table. It supports inserting data either from incoming input items or by manually entering values directly in the node configuration.

Common scenarios where this node is beneficial include:

  • Automating data ingestion workflows where new records need to be added to a Turso database table.
  • Integrating external data sources or APIs with Turso by passing data through n8n and inserting it into the database.
  • Quickly adding test or static data manually during workflow development or testing.

For example, you could use this node to insert user registration data collected from a form (passed as input items) into a "users" table, or manually add predefined configuration rows into a settings table.

Properties

Name Meaning
Table Name The name of the target table where rows will be inserted. This must be selected from available tables in the connected Turso database.
Columns The columns in the selected table that will receive data. Multiple columns can be selected.
Data Source Specifies the source of the data to insert: either "Input Items" (use incoming workflow items) or "Manual Input" (enter values directly in the node).
Values to Insert When using manual input as the data source, these are the actual values to insert into the specified columns. Multiple rows can be defined by providing multiple sets of values.
Item Property When using input items as the data source, this defines the property name within each item that contains the data object or array of objects to insert. Leave blank if the entire item JSON represents the row data.

Output

The node outputs an array of JSON objects representing the result of each insert operation. Each output item includes:

  • rowsAffected: Number of rows affected by the insert (typically 1 per successful insert).
  • lastInsertRowid: The ID of the last inserted row if the table has an auto-increment primary key.

The output structure allows downstream nodes to access metadata about the insert operations, such as confirming success or retrieving newly generated IDs.

No binary data output is produced by this node.

Dependencies

  • Requires a valid connection to a Turso database, including:
    • A database URL.
    • An authentication token or API key credential for secure access.
  • The node uses the Turso client library to execute SQL commands.
  • Proper credentials must be configured in n8n for the Turso database connection.

Troubleshooting

  • Missing or invalid credentials: If the database URL or auth token is missing or incorrect, the node will throw a connection error. Verify your credentials and database URL in the n8n credentials manager.
  • Empty table name or columns: The node requires a non-empty table name and at least one column selected. Ensure these are properly set.
  • Data mismatch errors: When manually entering values, the total number of values must be a multiple of the number of columns selected. Otherwise, an error will occur.
  • Item path not found: If using input items as data source and specifying an item property path, ensure that the path exists in all input items; otherwise, an error will be thrown.
  • SQL execution errors: Any database errors during insertion (e.g., constraint violations) will be reported with details including the error code and message.
  • No data found to insert: If no data is extracted from input items or manual input, the node will raise an error indicating no data was found.

Links and References

Discussion