Appearance
Save Row
The Save Row node inserts new rows into a WP-Nexus database table, custom post type, or taxonomy. It is the primary node for creating new records from form submissions or pipeline-generated data.
Configuration
| Property | Type | Default | Description |
|---|---|---|---|
tableId | number | -- | Required. The ID of the WP-Nexus table to insert into. |
Input
Accepts a single object or an array of rows. Each object's keys should match the table's column names.
Output
Returns the same rows with the newly generated ID added:
- Custom tables:
idfield is added (auto-increment value). - Custom post types:
IDfield is added (WordPress post ID). - Taxonomies:
term_idfield is added.
On error, an _error field is added to the row.
How It Works
The behavior depends on the table's storage type:
Custom Table
- Removes the
idfield from the input (auto-increment handles it). - Inserts the row via
$wpdb->insert(). - Adds the
insert_idasidon the returned row.
Custom Post Type
- Extracts core fields:
post_title,post_content,post_status. - Calls
wp_insert_post()with sanitized values. - Saves custom fields as post meta (prefixed with
nxs_). - Adds the
IDto the returned row.
Taxonomy
- Extracts
name(required),slug, anddescription. - Calls
wp_insert_term(). - Saves custom fields as term meta (prefixed with
nxs_). - Adds the
term_idto the returned row.
Example Use Cases
Save a contact form submission
Context --> Validate --> Sanitize --> Save Row (tableId: 3) --> Send Email --> OutputInsert with computed fields
Context --> Set Field (created_at = now()) --> Set Field (status = 'pending') --> Save Row --> OutputBatch insert
Connect an array of rows to save multiple records:
Static Data --> Save Row (tableId: 5) --> OutputWARNING
Save Row is a write node -- it modifies the database on every execution. Always protect it with Validate and Sanitize in user-facing pipelines. Add Require Auth if only logged-in users should be able to create records.
TIP
The id field in the input is automatically removed before insertion, so you can safely pass form data that includes an id field without causing conflicts.