Database Commands
Execute commands against external databases - PostgreSQL, MS SQL, MySQL, and MongoDB.
The Database Commands node connects directly to external databases, executes a command, and returns the result in two forms: raw text and structured objects ready for downstream expressions.
Supported providers
| Provider | Connection string example |
|---|---|
| PostgreSQL | Host=db.example.com;Database=appdb;Username=app;Password=... |
| MSSQL | Server=tcp:db.example.com,1433;Database=appdb;User Id=app;Password=...;Encrypt=true; |
| MySQL | Server=db.example.com;Port=3306;Database=appdb;Uid=app;Pwd=...; |
| MongoDB | mongodb://user:pass@db.example.com:27017/mydb (must include a database name) |
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
provider | Select | Yes | Which database type you're connecting to (see table above). |
connectionString | String | Yes | Credentials and address of the target database. |
command | String | Yes | The SQL query / Mongo command to execute. Supports {{ ... }} templating. |
Example
Query rows using a value fetched by an earlier node:
SELECT * FROM Users WHERE Id = {{ nodes.node_1.output.userId }}For MongoDB, send a command document in MongoDB command syntax against the database embedded in the connection string.
Credentials live in the config
The connection string is stored with the workflow configuration. Prefer a dedicated, least-privilege database account for integrations rather than reusing admin credentials.
Output
| Field | Type | Description |
|---|---|---|
text | String | Raw text output of the command. |
structuredOutput | Object | Query results parsed into structured objects, when applicable. |
Downstream nodes consume structured rows without string parsing:
{{ nodes.query_users.output.structuredOutput[0].Email }}Prefer structured output
Whenever the engine can parse results into objects, reference
structuredOutput instead of slicing text - it's more reliable and keeps
workflows readable.