Integrations / Databricks
Databricks
Databricks on your own workspace: run SQL on a SQL warehouse, start and check jobs and runs, inspect and start or terminate clusters, browse Unity Catalog catalogs, schemas and tables, and list workspace folders. You give your workspace address and a personal access token.
15 actions
API key
11 read2 write2 destructive
Calls www.databricks.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "databricks" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
This toolkit uses a single credential and requests no scopes.
Actions
Execute SQL statementdestructivedatabricks.execute_sqlRun a SQL statement on a Databricks SQL warehouse and return up to the first rows inline. The statement can be anything the token's user may run, including INSERT, UPDATE, DELETE, DROP and TRUNCATE, so it is treated as destructive and needs confirmation: prefer plain SELECT statements and use row_limit. If it does not finish within wait_timeout it keeps running and you poll get_statement with the returned statement_id.
| Input | Type | Description | |
|---|---|---|---|
statement | string | Required | The SQL to run (up to 16 MiB) |
warehouse_id | string | Required | ID of the SQL warehouse that runs it, from list_warehouses |
catalog | string | Optional | Default catalog for unqualified names (like USE CATALOG) |
schema | string | Optional | Default schema for unqualified names (like USE SCHEMA) |
wait_timeout | string | Optional | How long to wait for the result: 0s (return immediately) or 5s to 50s. Default 10s |
row_limit | integer | Optional | Cap the number of rows returned (sets truncated when hit) |
parameters | array of object | Optional | Named parameter markers (:name) used in the statement |
await setu.execute({
userId: "user_1",
action: "databricks.execute_sql",
input: {
"statement": "<statement>",
"warehouse_id": "<warehouse_id>"
},
confirm: true,
});Get clusterreaddatabricks.get_clusterGet one cluster's state, Spark version, node type, size, auto-termination and creator.
| Input | Type | Description | |
|---|---|---|---|
cluster_id | string | Required | Cluster ID, from list_clusters |
await setu.execute({
userId: "user_1",
action: "databricks.get_cluster",
input: {
"cluster_id": "<cluster_id>"
},
});Get jobreaddatabricks.get_jobGet one job's definition: name, schedule, concurrency limit and its tasks.
| Input | Type | Description | |
|---|---|---|---|
job_id | integer | Required | Job ID, from list_jobs |
await setu.execute({
userId: "user_1",
action: "databricks.get_job",
input: {
"job_id": 1
},
});Get job runreaddatabricks.get_runGet the status of a job run: lifecycle state (PENDING, RUNNING, TERMINATED...), result state (SUCCESS, FAILED...), timings and a link to the run page.
| Input | Type | Description | |
|---|---|---|---|
run_id | integer | Required | Run ID, from run_job |
await setu.execute({
userId: "user_1",
action: "databricks.get_run",
input: {
"run_id": 1
},
});Get SQL statement resultreaddatabricks.get_statementCheck the status of a SQL statement started with execute_sql and, once SUCCEEDED, get the first chunk of its rows. Statements are removed about 12 hours after they finish.
| Input | Type | Description | |
|---|---|---|---|
statement_id | string | Required | Statement ID returned by execute_sql |
await setu.execute({
userId: "user_1",
action: "databricks.get_statement",
input: {
"statement_id": "<statement_id>"
},
});List Unity Catalog catalogsreaddatabricks.list_catalogsList the Unity Catalog catalogs the token's user can see, with owner, comment and type.
| Input | Type | Description | |
|---|---|---|---|
max_results | integer | Optional | Maximum catalogs to return |
page_token | string | Optional | Token from a previous call's next_page_token, for the next page |
await setu.execute({
userId: "user_1",
action: "databricks.list_catalogs",
input: {},
});List clustersreaddatabricks.list_clustersList the all-purpose and job clusters in the workspace with ID, name, state (RUNNING, TERMINATED, PENDING...), Spark version, node type and worker count.
| Input | Type | Description | |
|---|---|---|---|
page_size | integer | Optional | Clusters per page (max 100) |
page_token | string | Optional | Token from a previous call's next_page_token, for the next page |
await setu.execute({
userId: "user_1",
action: "databricks.list_clusters",
input: {},
});List jobsreaddatabricks.list_jobsList Databricks jobs (Lakeflow Jobs / workflows) in the workspace with their ID, name, creator and schedule. Optionally filter by exact name.
| Input | Type | Description | |
|---|---|---|---|
name | string | Optional | Only jobs with exactly this name (case-insensitive) |
limit | integer | Optional | Jobs per page (1-100, default 20) |
page_token | string | Optional | Token from a previous call's next_page_token, for the next page |
await setu.execute({
userId: "user_1",
action: "databricks.list_jobs",
input: {},
});List Unity Catalog schemasreaddatabricks.list_schemasList the schemas (databases) inside one Unity Catalog catalog.
| Input | Type | Description | |
|---|---|---|---|
catalog_name | string | Required | Catalog name, from list_catalogs |
max_results | integer | Optional | Maximum schemas to return |
page_token | string | Optional | Token from a previous call's next_page_token, for the next page |
await setu.execute({
userId: "user_1",
action: "databricks.list_schemas",
input: {
"catalog_name": "<catalog_name>"
},
});List Unity Catalog tablesreaddatabricks.list_tablesList the tables and views in one Unity Catalog schema. Set omit_columns to true for a short answer; leave it off to also get each table's column names and types.
| Input | Type | Description | |
|---|---|---|---|
catalog_name | string | Required | Catalog name |
schema_name | string | Required | Schema name, from list_schemas |
omit_columns | boolean | Optional | Leave out the column lists (shorter output) |
max_results | integer | Optional | Maximum tables to return |
page_token | string | Optional | Token from a previous call's next_page_token, for the next page |
await setu.execute({
userId: "user_1",
action: "databricks.list_tables",
input: {
"catalog_name": "<catalog_name>",
"schema_name": "<schema_name>"
},
});List SQL warehousesreaddatabricks.list_warehousesList the SQL warehouses the token's user can use, with ID, name, size, state (STARTING, RUNNING, STOPPED...) and type. The warehouse ID is needed by execute_sql.
| Input | Type | Description | |
|---|---|---|---|
page_size | integer | Optional | Maximum warehouses to return |
page_token | string | Optional | Token from a previous call's next_page_token, for the next page |
await setu.execute({
userId: "user_1",
action: "databricks.list_warehouses",
input: {},
});List workspace objectsreaddatabricks.list_workspace_objectsList the notebooks, folders, files and libraries directly inside a workspace folder path such as /Users/[email protected] or /Workspace/Shared.
| Input | Type | Description | |
|---|---|---|---|
path | string | Required | Absolute workspace path of the folder, e.g. /Users/[email protected] |
await setu.execute({
userId: "user_1",
action: "databricks.list_workspace_objects",
input: {
"path": "<path>"
},
});Run job nowwritedatabricks.run_jobStart a run of an existing job right now, optionally with job parameters. Starts compute and executes the job's tasks, which can change data. Use an idempotency_token to avoid starting the same run twice on retries. Poll get_run with the returned run_id.
| Input | Type | Description | |
|---|---|---|---|
job_id | integer | Required | Job ID, from list_jobs |
job_parameters | object | Optional | Job-level parameters as name to text value pairs |
idempotency_token | string | Optional | Optional unique token (max 64 characters); a retry with the same token returns the same run |
await setu.execute({
userId: "user_1",
action: "databricks.run_job",
input: {
"job_id": 1
},
});Start clusterwritedatabricks.start_clusterStart a terminated cluster. It begins using compute that is billed. The call returns at once; poll get_cluster until its state is RUNNING.
| Input | Type | Description | |
|---|---|---|---|
cluster_id | string | Required | ID of the terminated cluster to start |
await setu.execute({
userId: "user_1",
action: "databricks.start_cluster",
input: {
"cluster_id": "<cluster_id>"
},
});Terminate clusterdestructivedatabricks.terminate_clusterTerminate a cluster: it stops, running jobs and notebooks on it are interrupted, and its configuration is kept so it can be started again (this is not a permanent delete).
| Input | Type | Description | |
|---|---|---|---|
cluster_id | string | Required | ID of the cluster to terminate |
await setu.execute({
userId: "user_1",
action: "databricks.terminate_cluster",
input: {
"cluster_id": "<cluster_id>"
},
confirm: true,
});