# Databricks
URL: /reference/blocks/databricks
Type: reference
Description: Run SQL statements, manage SQL warehouses, and trigger Databricks Jobs
Keywords: databricks, integrations, block, workflow builder
`databricks` — Run SQL statements, manage SQL warehouses, and trigger Databricks Jobs.

Where it appears [#where-it-appears]

The **Databricks** block lives in the **Integrations** group of the Workflow Builder. Connect the Databricks integration before adding it.

Fields [#fields]

| Field                | Type                       | Required | Default | Description                                                                                                    |
| -------------------- | -------------------------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------- |
| `resource`           | select                     | Yes      | `sql`   | Which Databricks resource to work with. Options: `sql`, `jobs`.                                                |
| `operation`          | select                     | Yes      | —       | Which action to perform on the selected resource.                                                              |
| `statement`          | code                       | Yes      | —       | Read-only SQL only. SELECT, WITH, SHOW, DESCRIBE, DESC, and EXPLAIN are allowed; write operations are blocked. |
| `warehouseId`        | text (supports references) | No       | —       | Override the warehouse configured in the integration credentials.                                              |
| `catalog`            | text (supports references) | No       | —       | Optional Databricks catalog for statement execution.                                                           |
| `schema`             | text (supports references) | No       | —       | Optional Databricks schema for statement execution.                                                            |
| `parameters`         | code                       | No       | —       | Optional statement parameters as an array of \{name, value, type}.                                             |
| `rowLimit`           | text (supports references) | No       | —       | Optional maximum number of rows returned.                                                                      |
| `byteLimit`          | text (supports references) | No       | —       | Optional maximum result size in bytes.                                                                         |
| `waitTimeoutSeconds` | text (supports references) | No       | —       | Optional server-side wait timeout before the client begins polling.                                            |
| `jobId`              | text (supports references) | Yes      | —       | The numeric ID of an existing Databricks Job to trigger via run-now.                                           |
| `jobParameters`      | code                       | No       | —       | Optional job-level parameters as a \{key: value} map (sent as job\_parameters).                                |
| `notebookParams`     | code                       | No       | —       | Optional notebook widget values as a \{key: value} map (sent as notebook\_params).                             |
| `idempotencyToken`   | text (supports references) | No       | —       | Optional token so a retried trigger does not launch the job twice.                                             |
| `runId`              | text (supports references) | Yes      | —       | The run ID returned by Run Job.                                                                                |
| `includeOutput`      | toggle                     | No       | —       | Also fetch run output (notebook result / error) when the run is terminal.                                      |
| `limit`              | text (supports references) | No       | —       | Maximum number of jobs to return (default 25).                                                                 |

Inputs and outputs [#inputs-and-outputs]

Inputs are the configurable fields above. The block produces these outputs:

**Outputs**

Reference an output downstream with `<Databricks.field>`.

| Name             | Type    | Description                                               |
| ---------------- | ------- | --------------------------------------------------------- |
| `success`        | boolean | Whether the request succeeded                             |
| `warehouses`     | array   | Available Databricks SQL warehouses                       |
| `error`          | string  | Error message if failed                                   |
| `statementId`    | string  | Databricks statement ID                                   |
| `status`         | json    | Statement execution status                                |
| `result`         | json    | Databricks statement result payload                       |
| `warehouseCount` | number  | Number of visible SQL warehouses                          |
| `runId`          | number  | The ID of the triggered run                               |
| `numberInJob`    | number  | Sequence number of this run within the job                |
| `lifeCycleState` | string  | Run life-cycle state (e.g. RUNNING, TERMINATED)           |
| `resultState`    | string  | Run result state (e.g. SUCCESS, FAILED) once terminal     |
| `isTerminal`     | boolean | True when the run has reached a terminal life-cycle state |
| `stateMessage`   | string  | Human-readable state detail                               |
| `runPageUrl`     | string  | URL to the run in the Databricks UI                       |
| `output`         | json    | Run output payload when requested                         |
| `jobs`           | array   | Available Databricks Jobs                                 |

Example [#example]

A minimal configuration for this block:

```json
{
  "type": "databricks",
  "config": {
    "resource": "sql",
    "operation": "...",
    "statement": "...",
    "jobId": "<PreviousStep.field>",
    "runId": "<PreviousStep.field>"
  }
}
```

Limits and failure modes [#limits-and-failure-modes]

* Requires a connected Databricks integration. Calls fail if that integration is disconnected or its authorization has expired.
* Required fields (`resource`, `operation`, `statement`, `jobId`, `runId`) must be set, or the block fails validation before it runs.
* On failure the `error` output is populated; downstream blocks that reference other outputs may not receive values.

Related [#related]

* [All workflow blocks](/reference/blocks)
* [Workflow Builder overview](/workflow-builder-overview)
* [Integrations](/integrations)