Database: Connect to database

Connect to a database (MySQL, PostgreSQL, SQL Server, Oracle, MongoDB, SQLite, ODBC).

Help Centre › Building Processes

Connect to a database (MySQL, PostgreSQL, SQL Server, Oracle, MongoDB, SQLite, ODBC).

Add it to a process

In the process designer, open the Add step tab. Find Connect to database under Database › Connection, or type its name in the search box, and drag it onto the canvas.

Fields

FieldRequiredWhat it does
Connection nameYesA unique name for this connection, e.g. mydb
TypeYesThe database type - this is the value the bot connects with Choices: MySQL, SQL Server, PostgreSQL, SQLite, ODBC, Oracle, MongoDB.
HostNoThe database server hostname or IP address Default: 127.0.0.1.
PortNoThe database server port
DatabaseNoThe database name to connect to
UsernameNoThe database username
VariableYesVariable to store connection status Default: connected.
Data source name (DSN)NoODBC only. Enter just the name, exactly as it appears in the bot machine's ODBC Data Sources - the bot builds DSN=… for you. Leave blank if you are supplying a full connection string instead.
Where is the password stored?Novault or keychain (default inferred from credentialID: vault if set, else keychain). Choices: Bot local keychain, Vault credential.
Vault credentialNoUUID of the vault credential. Required when credentialMode == "vault".
Connection stringNoOptional full connection string, e.g. DRIVER={ODBC Driver 18 for SQL Server};SERVER=hostname;DATABASE=dbname. Takes precedence over the DSN field when both are set.
Driver-specific options (JSON)NoAdditional connection options as key=value pairs, one per line

What it gives back

  • {connected} – True if connected successfully

See all Database steps.

Errors

ErrorDescription
Connection failedUnable to establish a connection to the database server
Authentication failedThe username or password is incorrect
Database not foundThe specified database does not exist on the server

Tips

  • Use the connection_string parameter for complex connection configurations such as SSL, trusted connections, or non-standard drivers
  • Store database credentials in the Credential Vault for security rather than hardcoding them in the process
  • Give connections meaningful names (e.g. "production_db", "staging_db") to keep multi-database processes clear

Related functions

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.