Get Variables

Fetch variables from an n8n DataTable and merge into workflow data, or create a new Variables table

Create Variables Table

AI-generated

Summary

Creates a new n8n DataTable with two string columns (key and value) via the n8n public API, for use as a variables store. Optionally returns the existing table if one with the same name already exists.

Inputs

  • tableName (required) — Name of the DataTable to create. Defaults to 'n8n Variables'.
  • keyColumnName (required) — Name of the string column holding variable names. Defaults to 'variable_key'.
  • valueColumnName (required) — Name of the string column holding variable values. Defaults to 'variable_value'.
  • continueIfExists — Defaults to true. If table creation fails and this is on, the node lists tables and returns the one matching tableName with alreadyExisted: true. If off, or no matching table is found, the original error is thrown.

Output shape

A single item containing the API response for the created DataTable (e.g. id and name). If an existing table was returned instead, the item is that table's record plus alreadyExisted: true.

Requires the n8nApi credential (base URL and API key). Input items are ignored and only one output item is produced. The fallback is triggered by any POST error (not just a duplicate name), and it only returns a table if one matches the name exactly. Otherwise it rethrows the original error. The existing table's columns are not verified against the requested column names.

Examples

Example 1: One-time setup of a variables table before using Get Variables

Table Name 'n8n Variables', Key Column Name 'variable_key', Value Column Name 'variable_value', Continue if Table Already Exists on.

Example 2: Strictly fail if a table with this name already exists

Table Name 'App Config', default column names, Continue if Table Already Exists off.

Links

Discussion