Metabase Cards Run
Certified
Run a saved Metabase question
Metabase Cards Run
Run a saved Metabase question
Executes a saved Metabase question and returns or stores the resulting rows.
FETCH, FETCH_ONE and NONE call POST /api/card/{id}/query, which Metabase caps at 2,000 rows.
STORE calls the export endpoint POST /api/card/{id}/query/json and streams every row to internal storage.
The exported row keys are the ones Metabase writes in its JSON export, which can differ from the column names returned by the other fetch types.
type: io.kestra.plugin.metabase.cards.RunExamples
Run a saved question and store results in Kestra storage
id: metabase_card_run
namespace: company.team
tasks:
- id: run
type: io.kestra.plugin.metabase.cards.Run
url: "{{ secret('METABASE_URL') }}"
apiKey: "{{ secret('METABASE_API_KEY') }}"
cardId: 42
fetchType: STORE
Fetch rows of a saved question inline
id: metabase_card_fetch
namespace: company.team
tasks:
- id: run
type: io.kestra.plugin.metabase.cards.Run
url: "{{ secret('METABASE_URL') }}"
apiKey: "{{ secret('METABASE_API_KEY') }}"
cardId: 10
fetchType: FETCH
Installation
Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:
kestractl plugins get io.kestra.plugin:plugin-metabase --compatible-for $KESTRA_VERSION For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.
Properties
cardId *integerstring
Card (question) ID
The ID of the saved question to run.
url *string
Metabase server URL
Base URL of the Metabase instance, for example https://metabase.example.com or http://localhost: 3000.
apiKey string
Metabase API key
API key sent in the x-api-key header. Requires Metabase v0.47 or later.
Set exactly one authentication mode: apiKey, sessionToken, or both username and password.
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150fetchType string
FETCHSTOREFETCHFETCH_ONENONEFetch type
How results are handled: FETCH_ONE (first row), FETCH (all rows inline), STORE (stream into internal storage as an Ion file) or NONE (only the row count).
FETCH_ONE, FETCH and NONE are limited to the 2,000 rows Metabase returns from /api/card/{id}/query. Use STORE for larger results.
parameters array
Query parameters
Optional parameter values passed to the question, in the Metabase parameters format.
password string
Metabase password
Password used to open a session through POST /api/session. Must be set together with username.
requestTimeout string
PT1MHTTP request timeout
Connect and read timeout for each HTTP request made to Metabase. Defaults to 60 seconds. Does not limit the task duration.
sessionToken string
Metabase session token
Session token sent in the X-Metabase-Session header.
Set exactly one authentication mode: apiKey, sessionToken, or both username and password.
username string
Metabase username
Username or email used to open a session through POST /api/session. Must be set together with password.
The session is closed with DELETE /api/session when the task ends.
Outputs
row object
A single row
Returned when fetchType is set to FETCH_ONE.
rows array
List of rows
Returned when fetchType is set to FETCH.
size integer
Number of returned rows
Total number of rows returned or stored by the query.
uri string
uriInternal storage URI
Returned when fetchType is set to STORE. Contains an Amazon Ion-serialized file of the rows.