Reference · Tools

Metabase

Query questions, manage alerts, databases, and metrics in a Metabase BI instance.

Action (binary) Analytics v1 Binary data

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

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires Metabase API credentials. See the Credentials Guide for setup instructions.

Resources

ResourceValue
Alertalerts
Databasedatabases
Metricmetrics
Questionquestions

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.

ResourceOperationValueDescription
QuestionGetgetGet a specific question
QuestionGet ManygetAllGet many questions
QuestionResult DataresultDataExport question results as CSV, XLSX, or JSON
AlertGetgetGet a specific alert
AlertGet ManygetAllGet many alerts
DatabaseAddaddAdd a new database datasource
DatabaseGet ManygetAllGet many databases
DatabaseGet FieldsgetFieldsGet fields from a database
MetricGetgetGet a specific metric
MetricGet ManygetAllGet 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

ParameterTypeRequiredDefaultDescription
Question IDstringYesThe ID of the question (card) in Metabase. Accepts expressions such as {{ $json.questionId }}.

Question: Get Many

ParameterTypeRequiredDefaultDescription
Return AllbooleanNofalseWhether to return all results. Metabase getAll endpoints return all results in a single request, so this controls whether to apply a limit.
LimitnumberNo50Maximum number of results to return. (shown when Return All is false)

Question: Result Data

ParameterTypeRequiredDefaultDescription
Question IDstringYesThe ID of the question (card) in Metabase. Accepts expressions such as {{ $json.questionId }}.
FormatoptionsYescsvThe export format for question results. CSV and XLSX produce binary output; JSON produces parsed row items.
Options: csv, json, xlsx
Binary PropertystringNodataName 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

ParameterTypeRequiredDefaultDescription
Alert IDstringYesThe ID of the alert. Accepts expressions such as {{ $json.alertId }}.

Alert: Get Many

ParameterTypeRequiredDefaultDescription
Return AllbooleanNofalseWhether to return all results. Metabase getAll endpoints return all results in a single request, so this controls whether to apply a limit.
LimitnumberNo50Maximum number of results to return. (shown when Return All is false)

Database: Add

ParameterTypeRequiredDefaultDescription
EngineoptionsYespostgresThe database engine type.
Options: h2, mongo, mysql, postgres, redshift, sqlite
NamestringYesDisplay name for the database in Metabase. Accepts expressions.
HoststringYesDatabase host address. (shown when Engine is postgres, redshift, mysql, mongo)
PortnumberYes5432Database port number. (shown when Engine is postgres, redshift, mysql, mongo)
UserstringYesDatabase username. (shown when Engine is postgres, redshift, mysql, mongo)
PasswordstringYesDatabase password. (shown when Engine is postgres, redshift, mysql, mongo)
Database NamestringNoName of the database to connect to. (shown when Engine is postgres, redshift, mysql, mongo)
File PathstringYesFile path to the H2 or SQLite database file. (shown when Engine is h2, sqlite)
Full SyncbooleanYestrueWhether to enable full sync for the database.

Database: Get Many

ParameterTypeRequiredDefaultDescription
SimplifybooleanNotrueWhether to return a simplified version of the response instead of the raw data.
Return AllbooleanNofalseWhether to return all results. Metabase getAll endpoints return all results in a single request, so this controls whether to apply a limit.
LimitnumberNo50Maximum number of results to return. (shown when Return All is false)

Database: Get Fields

ParameterTypeRequiredDefaultDescription
Database IDstringYesThe ID of the database. Accepts expressions such as {{ $json.databaseId }}.

Metric: Get

ParameterTypeRequiredDefaultDescription
Metric IDstringYesThe ID of the metric. Accepts expressions such as {{ $json.metricId }}.

Metric: Get Many

ParameterTypeRequiredDefaultDescription
Return AllbooleanNofalseWhether to return all results. Metabase getAll endpoints return all results in a single request, so this controls whether to apply a limit.
LimitnumberNo50Maximum number of results to return. (shown when Return All is false)

All Operations

ParameterTypeRequiredDefaultDescription
Max ConcurrencynumberNo10Maximum 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.

OperationsOutput
Question Get, Alert Get, Metric Get, Database AddThe 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 FieldsOne 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 jsonOne 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 / xlsxOne 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
}
  • fileName is always question_{Question ID}.{csv|xlsx}, and fileSize is the byte length of the downloaded file.
  • The attached file carries the matching MIME type — text/csv for 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

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes 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 BusyBot

Last updated . Spotted something wrong? Tell us.