Update Database
Update Database node for Builder — write new records, update existing rows, or upsert data into connected database tables directly from an AI agent workflow.
🎯 Purpose
Section titled “🎯 Purpose”Writes input data into a database table. Supports insert, unique insert, and update operations without writing SQL.
⚙️ Configuration
Section titled “⚙️ Configuration”Database Connection
Section titled “Database Connection”- Database — Select a connected database system.
- Table — Choose the target table within the selected database.
Operation Mode
Section titled “Operation Mode”-
Database Operation
- Insert — Add a new record.
- Insert only if not exists — Add only if no matching record exists.
- Update with value — Modify existing records based on a key column.
-
Exclude Properties — Fields ignored during duplicate checks (only for Insert only if not exists).
-
Clear Table Before Insert — Optional toggle to truncate (clear) the table before inserting (use cautiously).
-
Key Column Name — Column used to identify which record to update (only for Update with value).
Data Mapping
Section titled “Data Mapping”- Properties — Map workflow fields to database columns using name-to-column pairs.
- Name - Name of the property in the workflow input.
- Save Into - Name of database table column to save that value into.
📤 Output
Section titled “📤 Output”- No output. Updates are written directly to the selected database.
📘 Best Practices
Section titled “📘 Best Practices”- Mapping Accuracy: Verify field names match column names exactly.
- Operation Choice:
- Use Insert for logging or appending data.
- Use Insert only if not exists for master data.
- Use Update with value for maintaining current states.
- Performance: Avoid truncating large tables during active hours.
- Testing: Always test with sample data before running production updates.
🧪 Test Cases
Section titled “🧪 Test Cases”- Given: Insert mode with valid mapping → Expected: New records created.
- Given: Insert only if not exists with duplicates → Expected: No duplicate records.
- Given: Update with key column → Expected: Target records updated correctly.
🗂️ Common Use Cases
Section titled “🗂️ Common Use Cases”| Scenario | Operation | Outcome |
|---|---|---|
| Order Processing | Insert | Automatically logs new orders into the database. |
| Daily Reports | Insert + Clear Table Before Insert | Replaces prior report data with latest results. |
| Customer Updates | Update with value | Refreshes existing customer information using a unique ID. |
| Product Catalog Sync | Insert only if not exists | Adds only new products from supplier data, prevents duplicates in catalog. |
✅ Quick Start
Section titled “✅ Quick Start”- Add UpdateDatabase to your workflow.
- Select your connected database and table.
- Choose an operation type.
- Map workflow fields to table columns.
- Test the workflow and confirm database entries.