Skip to main content
The Database node executes SQL queries or stored procedures against a configured database connection and stores the results for use in the flow.

Behavior

  • Connects to a pre-configured database using the connection ID
  • Executes parameterized queries to prevent SQL injection
  • Stores results in the configured variable name
  • Routes to Success, Error, or No Results based on the outcome

Configuration

Connection & operation

ParameterTypeDefaultOptionsDescription
connectionIdstring""Database connection ID (configured in workspace settings)
operationenum"query"query, insert, update, delete, call_procedureDatabase operation type
querystring""SQL query or stored procedure name
timeoutnumber100001,000–60,000Query timeout in milliseconds

Parameters

Each entry in the parameters array:
FieldTypeDescription
namestringParameter name (maps to a placeholder in the query)
valuestringParameter value. Supports {{variable}} interpolation.
typeenumData type: string, number, boolean, date

Results

ParameterTypeDefaultDescription
resultVariablestring"db_result"Variable name to store query results
singleRowbooleanfalseReturn only the first row instead of all rows

Output handles

HandleDescription
SuccessQuery executed successfully with results
ErrorQuery failed (connection error, syntax error, timeout)
No ResultsQuery executed but returned no rows

Output variables

VariableTypeDescription
rowsarrayArray of result rows
row_countnumberNumber of rows returned or affected

Example

Look up a customer by account number:
SELECT name, email, tier FROM customers WHERE account_id = @account_id
Parameters:
NameValueType
account_id{{digits}}string

Use cases

After Collect Digits, query the database for the account. On DB.NO_RESULTS, play “Account not found” and retry. On success, greet the customer by name.
Use the insert operation to log call details (caller ID, timestamp, department) into a calls table at the end of the flow.
Set operation to call_procedure to execute complex business logic like credit checks or eligibility verification.