Reference · Tools
Metabase
Query questions, manage alerts, databases, and metrics in a Metabase BI instance.
The Metabase node queries saved questions and exports their results as CSV, XLSX or JSON, and manages alerts, databases and metrics. A typical build is running a saved question every morning and emailing the exported spreadsheet to a distribution list.
- Node type
- Action (binary)
- Parameters
- 24
- Outputs
- Output, Error
- Credentials
- Metabase API
Metabase
Query and export Metabase question results as CSV, XLSX, or JSON
Overview
The Metabase tool interacts with the Metabase REST API to manage questions (cards), alerts, databases, and metrics. It supports exporting question results as CSV, XLSX (binary download), or JSON. Authentication uses session tokens obtained via POST /api/session with username and password credentials. Binary output is produced when exporting question results in CSV or XLSX format.
Category: Analytics
Tool Name: metabase
Version: 1
Appearance: Icon: lucide-BarChart | Color: #509EE3
Node Type
Action (Binary) — handles file/binary data operations
Input / Output
| Direction | Port(s) |
|---|---|
| Input | Input |
| Output | Output, Error |
Credentials
This tool requires Metabase API credentials. See the Credentials Guide for setup instructions.
Resources
| Resource | Value |
|---|---|
| Alert | alerts |
| Database | databases |
| Metric | metrics |
| Question | questions |
Operations
Each resource has its own Operation list, and several resources reuse the same operation values (get, getAll). Pick the resource first, then the operation.
| Resource | Operation | Value | Description |
|---|---|---|---|
| Question | Get | get | Get a specific question |
| Question | Get Many | getAll | Get many questions |
| Question | Result Data | resultData | Export question results as CSV, XLSX, or JSON |
| Alert | Get | get | Get a specific alert |
| Alert | Get Many | getAll | Get many alerts |
| Database | Add | add | Add a new database datasource |
| Database | Get Many | getAll | Get many databases |
| Database | Get Fields | getFields | Get fields from a database |
| Metric | Get | get | Get a specific metric |
| Metric | Get Many | getAll | Get many metrics |
Parameters
Metabase IDs are the numbers in the object’s URL — a question at /question/42 has Question ID 42. The identifier and database-connection fields accept expressions, so you can feed them from an upstream item.
Question: Get
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Question ID | string | Yes | — | The ID of the question (card) in Metabase. Accepts expressions such as {{ $json.questionId }}. |
Question: Get Many
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Return All | boolean | No | false | Whether to return all results. Metabase getAll endpoints return all results in a single request, so this controls whether to apply a limit. |
| Limit | number | No | 50 | Maximum number of results to return. (shown when Return All is false) |
Question: Result Data
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Question ID | string | Yes | — | The ID of the question (card) in Metabase. Accepts expressions such as {{ $json.questionId }}. |
| Format | options | Yes | csv | The export format for question results. CSV and XLSX produce binary output; JSON produces parsed row items. |
Options: csv, json, xlsx | ||||
| Binary Property | string | No | data | Name of the binary property to store the exported file under. Names are case-sensitive — see the upstream node’s Binary Data panel for the exact names to use. (shown when Format is csv, xlsx) |
Alert: Get
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Alert ID | string | Yes | — | The ID of the alert. Accepts expressions such as {{ $json.alertId }}. |
Alert: Get Many
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Return All | boolean | No | false | Whether to return all results. Metabase getAll endpoints return all results in a single request, so this controls whether to apply a limit. |
| Limit | number | No | 50 | Maximum number of results to return. (shown when Return All is false) |
Database: Add
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Engine | options | Yes | postgres | The database engine type. |
Options: h2, mongo, mysql, postgres, redshift, sqlite | ||||
| Name | string | Yes | — | Display name for the database in Metabase. Accepts expressions. |
| Host | string | Yes | — | Database host address. (shown when Engine is postgres, redshift, mysql, mongo) |
| Port | number | Yes | 5432 | Database port number. (shown when Engine is postgres, redshift, mysql, mongo) |
| User | string | Yes | — | Database username. (shown when Engine is postgres, redshift, mysql, mongo) |
| Password | string | Yes | — | Database password. (shown when Engine is postgres, redshift, mysql, mongo) |
| Database Name | string | No | — | Name of the database to connect to. (shown when Engine is postgres, redshift, mysql, mongo) |
| File Path | string | Yes | — | File path to the H2 or SQLite database file. (shown when Engine is h2, sqlite) |
| Full Sync | boolean | Yes | true | Whether to enable full sync for the database. |
Database: Get Many
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Simplify | boolean | No | true | Whether to return a simplified version of the response instead of the raw data. |
| Return All | boolean | No | false | Whether to return all results. Metabase getAll endpoints return all results in a single request, so this controls whether to apply a limit. |
| Limit | number | No | 50 | Maximum number of results to return. (shown when Return All is false) |
Database: Get Fields
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Database ID | string | Yes | — | The ID of the database. Accepts expressions such as {{ $json.databaseId }}. |
Metric: Get
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Metric ID | string | Yes | — | The ID of the metric. Accepts expressions such as {{ $json.metricId }}. |
Metric: Get Many
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Return All | boolean | No | false | Whether to return all results. Metabase getAll endpoints return all results in a single request, so this controls whether to apply a limit. |
| Limit | number | No | 50 | Maximum number of results to return. (shown when Return All is false) |
All Operations
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Max Concurrency | number | No | 10 | Maximum number of items to process concurrently. |
Output Data
What lands on the output item depends on the operation — some operations merge the Metabase response onto the input item’s JSON, while the list operations replace it with one record per output item. Binary data on the input item is always forwarded.
| Operations | Output |
|---|---|
| Question Get, Alert Get, Metric Get, Database Add | The Metabase object is merged onto the input item JSON at the top level, so the item keeps its upstream fields and gains the returned ones ({{ $json.id }}, {{ $json.name }}). A response field with the same name as an existing item field overwrites it. One output item per input item. |
| Question Get Many, Alert Get Many, Database Get Many, Metric Get Many, Database Get Fields | One output item per record, and each item’s JSON is replaced by that record — upstream fields are not carried over. A response with no records produces a single output item carrying the input JSON unchanged. |
Question Result Data, Format json | One output item per result row, each item’s JSON replaced by the row. A question that returns no rows produces one item carrying the input JSON plus _empty: true. |
Question Result Data, Format csv / xlsx | One output item whose JSON is replaced by the download summary below, with the file attached as binary under the Binary Property name. Any binary already on the input item is kept alongside it. |
A CSV or XLSX export produces this JSON:
{
"questionId": "42",
"format": "xlsx",
"fileName": "question_42.xlsx",
"fileSize": 20481
}
fileNameis alwaysquestion_{Question ID}.{csv|xlsx}, andfileSizeis the byte length of the downloaded file.- The attached file carries the matching MIME type —
text/csvfor CSV, the Excel spreadsheet type for XLSX — so a downstream upload or email node can send it as-is.
With Simplify on, Database: Get Many flattens each database’s connection details into top-level fields instead of leaving them nested. Turn it off to get the raw Metabase object.
Database: Get Fields does not show the Return All and Limit fields, so it uses their defaults and returns at most 50 fields per database.
Usage Examples
- Export Metabase question results as XLSX file
- Get all questions from Metabase
- Download question data as CSV
- Add a PostgreSQL database to Metabase
- Get all alerts from Metabase
Example Configuration
Fetch a single question’s definition:
{
"type": "metabase",
"parameters": {
"resource": "questions",
"operation": "get",
"questionId": "123"
}
}
Run a question and get its rows as workflow items:
{
"type": "metabase",
"parameters": {
"resource": "questions",
"operation": "resultData",
"questionId": "{{ $json.questionId }}",
"format": "json"
}
}
Download a question’s results as an Excel file for a downstream email or upload node:
{
"type": "metabase",
"parameters": {
"resource": "questions",
"operation": "resultData",
"questionId": "123",
"format": "xlsx",
"binaryPropertyName": "excelReport"
}
}
List the first 50 questions on the instance:
{
"type": "metabase",
"parameters": {
"resource": "questions",
"operation": "getAll",
"returnAll": false,
"limit": 50
}
}
Fetch every alert without a cap:
{
"type": "metabase",
"parameters": {
"resource": "alerts",
"operation": "getAll",
"returnAll": true
}
}
Look up one alert by ID:
{
"type": "metabase",
"parameters": {
"resource": "alerts",
"operation": "get",
"alertId": "456"
}
}
Register a PostgreSQL datasource and let Metabase sync its schema:
{
"type": "metabase",
"parameters": {
"resource": "databases",
"operation": "add",
"engine": "postgres",
"name": "Production DB",
"host": "db.example.com",
"port": 5432,
"dbUser": "metabase_user",
"dbPassword": "secure_password",
"dbName": "analytics",
"fullSync": true
}
}
Register a file-backed SQLite datasource instead:
{
"type": "metabase",
"parameters": {
"resource": "databases",
"operation": "add",
"engine": "sqlite",
"name": "Local Analytics",
"filePath": "file:/data/analytics.db",
"fullSync": false
}
}
List databases with their connection details flattened:
{
"type": "metabase",
"parameters": {
"resource": "databases",
"operation": "getAll",
"simple": true,
"returnAll": true
}
}
Explore a database’s schema, one item per field:
{
"type": "metabase",
"parameters": {
"resource": "databases",
"operation": "getFields",
"databaseId": "789"
}
}
Fetch a single metric definition:
{
"type": "metabase",
"parameters": {
"resource": "metrics",
"operation": "get",
"metricId": "101"
}
}
Error Handling
| Mode | Behavior |
|---|---|
| stop | Halts workflow on first error |
| continue | Skips failed items, passes successful ones through |
| errorPort | Routes failed items to Error output port |
Tips
Query Metabase questions, export results as CSV/XLSX/JSON, and manage alerts, databases, and metrics.
Frequently asked questions
What export formats are available?
CSV, XLSX and JSON, so results can go straight into a spreadsheet attachment or be parsed as structured data by the next node.
What can it manage besides questions?
Alerts, databases and metrics, so a workflow can inspect or adjust the instance rather than only reading query output.
How do results arrive?
Exported files come through as binary data ready to attach or store; JSON comes back as structured data for downstream processing.
Which credential does it need?
A Metabase API credential with access to the questions and resources you are targeting.
Build with the Metabase node
Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Metabase API credentials first.
Open BusyBotLast updated . Spotted something wrong? Tell us.