StyloDocs
Workflow blocks

Databricks

Run SQL statements, manage SQL warehouses, and trigger Databricks Jobs

View as Markdown

databricks — Run SQL statements, manage SQL warehouses, and trigger Databricks Jobs.

Where it appears

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

Fields

FieldTypeRequiredDefaultDescription
resourceselectYessqlWhich Databricks resource to work with. Options: sql, jobs.
operationselectYes—Which action to perform on the selected resource.
statementcodeYes—Read-only SQL only. SELECT, WITH, SHOW, DESCRIBE, DESC, and EXPLAIN are allowed; write operations are blocked.
warehouseIdtext (supports references)No—Override the warehouse configured in the integration credentials.
catalogtext (supports references)No—Optional Databricks catalog for statement execution.
schematext (supports references)No—Optional Databricks schema for statement execution.
parameterscodeNo—Optional statement parameters as an array of {name, value, type}.
rowLimittext (supports references)No—Optional maximum number of rows returned.
byteLimittext (supports references)No—Optional maximum result size in bytes.
waitTimeoutSecondstext (supports references)No—Optional server-side wait timeout before the client begins polling.
jobIdtext (supports references)Yes—The numeric ID of an existing Databricks Job to trigger via run-now.
jobParameterscodeNo—Optional job-level parameters as a {key: value} map (sent as job_parameters).
notebookParamscodeNo—Optional notebook widget values as a {key: value} map (sent as notebook_params).
idempotencyTokentext (supports references)No—Optional token so a retried trigger does not launch the job twice.
runIdtext (supports references)Yes—The run ID returned by Run Job.
includeOutputtoggleNo—Also fetch run output (notebook result / error) when the run is terminal.
waitForCompletiontoggleNo—Poll the run until it reaches a terminal state before continuing. Fails with a clear error if the run outlives the wait timeout.
pollIntervalSecondstext (supports references)No—How often to check the run while waiting (1–60 seconds, default 10). Only used when Wait for Completion is on.
runWaitTimeoutSecondstext (supports references)No—Maximum time to wait for the run to finish (10–1800 seconds, default 300). Only used when Wait for Completion is on.
limittext (supports references)No—Maximum number of jobs to return (default 25).

Inputs and outputs

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

Outputs

Reference an output downstream with <Databricks.field>.

NameTypeDescription
successbooleanWhether the request succeeded
warehousesarrayAvailable Databricks SQL warehouses
errorstringError message if failed
statementIdstringDatabricks statement ID
statusjsonStatement execution status
resultjsonDatabricks statement result payload
warehouseCountnumberNumber of visible SQL warehouses
runIdnumberThe ID of the triggered run
numberInJobnumberSequence number of this run within the job
lifeCycleStatestringRun life-cycle state (e.g. RUNNING, TERMINATED)
resultStatestringRun result state (e.g. SUCCESS, FAILED) once terminal
isTerminalbooleanTrue when the run has reached a terminal life-cycle state
stateMessagestringHuman-readable state detail
runPageUrlstringURL to the run in the Databricks UI
outputjsonRun output payload when requested. Single-task runs return the task output directly; multi-task runs return { tasks: [{ task_key, run_id, output }] }.
jobsarrayAvailable Databricks Jobs

Example

A minimal configuration for this block:

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

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.

On this page