Databricks

Use cases and templates: Databricks integration for AI agents

Use Databricks to run parameterized SQL against SQL warehouses with Unity Catalog support, list and trigger jobs, monitor runs, inspect clusters, and retrieve notebook outputs, errors, and logs. Connect with a personal access token and workspace host URL.

Genie operations ask a space questions in natural language and return answers, generated SQL, result rows, and charts when available. Reuse a conversation for follow-up questions, or choose Genie agent mode for a research report. For job workflows, check run status before retrieving completed output.

Use the block

Run SQL against Databricks warehouses, trigger and monitor job runs, inspect clusters, and retrieve run output. Ask questions of a Genie space, continue a conversation, or run Genie agent research. Supply a personal access token and workspace host URL.

Actions

Databricks Execute SQL

Execute a SQL statement against a Databricks SQL warehouse and return results inline. Supports parameterized queries and Unity Catalog.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
warehouseIdstringYesThe ID of the SQL warehouse to execute against
statementstringYesThe SQL statement to execute (max 16 MiB)
catalogstringNoUnity Catalog name (equivalent to USE CATALOG)
schemastringNoSchema name (equivalent to USE SCHEMA)
rowLimitnumberNoMaximum number of rows to return
waitTimeoutstringNoHow long to wait for results (e.g., "50s"). Range: "0s" or "5s" to "50s". Default: "50s"

Output

ParameterTypeDescription
statementIdstringUnique identifier for the executed statement
statusstringExecution status (SUCCEEDED, PENDING, RUNNING, FAILED, CANCELED, CLOSED)
columnsarrayColumn schema of the result set
↳ namestringColumn name
↳ positionnumberColumn position (0-based)
↳ typeNamestringColumn type (STRING, INT, LONG, DOUBLE, BOOLEAN, TIMESTAMP, DATE, DECIMAL, etc.)
dataarrayResult rows as a 2D array of strings where each inner array is a row of column values
totalRowsnumberTotal number of rows in the result
truncatedbooleanWhether the result set was truncated due to row_limit or byte_limit

Databricks Get Statement

Poll a SQL statement by its ID to retrieve status and results. Use this after Execute SQL when a query runs longer than the wait timeout.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
statementIdstringYesThe ID of the statement to fetch (returned by Execute SQL)

Output

ParameterTypeDescription
statementIdstringUnique identifier for the statement
statusstringExecution status (SUCCEEDED, PENDING, RUNNING, FAILED, CANCELED, CLOSED)
columnsarrayColumn schema of the result set
↳ namestringColumn name
↳ positionnumberColumn position (0-based)
↳ typeNamestringColumn type (STRING, INT, LONG, DOUBLE, BOOLEAN, TIMESTAMP, DATE, DECIMAL, etc.)
dataarrayResult rows as a 2D array of strings where each inner array is a row of column values
totalRowsnumberTotal number of rows in the result
truncatedbooleanWhether the result set was truncated due to row_limit or byte_limit

Databricks List Warehouses

List all SQL warehouses in a Databricks workspace including their size, state, and type. Use this to discover the warehouse ID needed for Execute SQL.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token

Output

ParameterTypeDescription
warehousesarrayList of SQL warehouses in the workspace
↳ warehouseIdstringUnique warehouse identifier
↳ namestringWarehouse display name
↳ clusterSizestringWarehouse size (e.g., 2X-Small, Small, Medium, Large)
↳ statestringCurrent state (STARTING, RUNNING, STOPPING, STOPPED, DELETING, DELETED)
↳ warehouseTypestringWarehouse type (CLASSIC, PRO)
↳ creatorNamestringEmail of the warehouse creator
↳ autoStopMinutesnumberMinutes of inactivity before auto-stop (0 = disabled)
↳ numClustersnumberCurrent number of running clusters
↳ minNumClustersnumberMinimum cluster count for scaling
↳ maxNumClustersnumberMaximum cluster count for scaling
↳ numActiveSessionsnumberNumber of active sessions
↳ enableServerlessComputebooleanWhether serverless compute is enabled

Databricks List Jobs

List all jobs in a Databricks workspace with optional filtering by name.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
limitnumberNoMaximum number of jobs to return (range 1-100, default 20)
offsetnumberNoOffset for pagination
namestringNoFilter jobs by exact name (case-insensitive)
expandTasksbooleanNoInclude task and cluster details in the response (max 100 elements)

Output

ParameterTypeDescription
jobsarrayList of jobs in the workspace
↳ jobIdnumberUnique job identifier
↳ namestringJob name
↳ createdTimenumberJob creation timestamp (epoch ms)
↳ creatorUserNamestringEmail of the job creator
↳ maxConcurrentRunsnumberMaximum number of concurrent runs
↳ formatstringJob format (SINGLE_TASK or MULTI_TASK)
hasMorebooleanWhether more jobs are available for pagination
nextPageTokenstringToken for fetching the next page of results

Databricks Get Job

Get the full definition and settings of a single Databricks job by its job ID.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
jobIdnumberYesThe canonical identifier of the job to retrieve

Output

ParameterTypeDescription
jobIdnumberThe job ID
namestringJob name
creatorUserNamestringEmail of the job creator
runAsUserNamestringUser the job runs as
createdTimenumberJob creation timestamp (epoch ms)
formatstringJob format (SINGLE_TASK or MULTI_TASK)
maxConcurrentRunsnumberMaximum number of concurrent runs
timeoutSecondsnumberJob-level timeout in seconds (0 or null means no timeout)
scheduleobjectCron schedule configuration (quartz_cron_expression, timezone_id, pause_status)
tagsobjectKey-value tags applied to the job
tasksarrayTask definitions for the job (empty for single-task jobs)

Databricks Run Job

Trigger an existing Databricks job to run immediately with optional job-level or notebook parameters.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
jobIdnumberYesThe ID of the job to trigger
jobParametersstringNoJob-level parameter overrides as a JSON object (e.g., {"key": "value"})
notebookParamsstringNoNotebook task parameters as a JSON object (e.g., {"param1": "value1"})
idempotencyTokenstringNoIdempotency token to prevent duplicate runs (max 64 characters)

Output

ParameterTypeDescription
runIdnumberThe globally unique ID of the triggered run
numberInJobnumberThe sequence number of this run among all runs of the job

Databricks Get Run

Get the status, timing, and details of a Databricks job run by its run ID.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
runIdnumberYesThe canonical identifier of the run
includeHistorybooleanNoInclude repair history in the response
includeResolvedValuesbooleanNoInclude resolved parameter values in the response

Output

ParameterTypeDescription
runIdnumberThe run ID
jobIdnumberThe job ID this run belongs to
runNamestringName of the run
runTypestringType of run (JOB_RUN, WORKFLOW_RUN, SUBMIT_RUN)
attemptNumbernumberRetry attempt number (0 for initial attempt)
stateobjectRun state information
↳ lifeCycleStatestringLifecycle state (QUEUED, PENDING, RUNNING, TERMINATING, TERMINATED, SKIPPED, INTERNAL_ERROR, BLOCKED, WAITING_FOR_RETRY)
↳ resultStatestringResult state (SUCCESS, FAILED, TIMEDOUT, CANCELED, SUCCESS_WITH_FAILURES, UPSTREAM_FAILED, UPSTREAM_CANCELED, EXCLUDED)
↳ stateMessagestringDescriptive message for the current state
↳ userCancelledOrTimedoutbooleanWhether the run was cancelled by user or timed out
startTimenumberRun start timestamp (epoch ms)
endTimenumberRun end timestamp (epoch ms, 0 if still running)
setupDurationnumberCluster setup duration (ms)
executionDurationnumberExecution duration (ms)
cleanupDurationnumberCleanup duration (ms)
queueDurationnumberTime spent in queue before execution (ms)
runPageUrlstringURL to the run detail page in Databricks UI
creatorUserNamestringEmail of the user who triggered the run

Databricks List Runs

List job runs in a Databricks workspace with optional filtering by job, status, and time range.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
jobIdnumberNoFilter runs by job ID. Omit to list runs across all jobs
activeOnlybooleanNoOnly include active runs (PENDING, RUNNING, or TERMINATING)
completedOnlybooleanNoOnly include completed runs
limitnumberNoMaximum number of runs to return (range 1-24, default 20)
offsetnumberNoOffset for pagination
runTypestringNoFilter by run type (JOB_RUN, WORKFLOW_RUN, SUBMIT_RUN)
startTimeFromnumberNoFilter runs started at or after this timestamp (epoch ms)
startTimeTonumberNoFilter runs started at or before this timestamp (epoch ms)

Output

ParameterTypeDescription
runsarrayList of job runs
↳ runIdnumberUnique run identifier
↳ jobIdnumberJob this run belongs to
↳ runNamestringRun name
↳ runTypestringRun type (JOB_RUN, WORKFLOW_RUN, SUBMIT_RUN)
↳ stateobjectRun state information
↳ lifeCycleStatestringLifecycle state (QUEUED, PENDING, RUNNING, TERMINATING, TERMINATED, SKIPPED, INTERNAL_ERROR, BLOCKED, WAITING_FOR_RETRY)
↳ resultStatestringResult state (SUCCESS, FAILED, TIMEDOUT, CANCELED, SUCCESS_WITH_FAILURES, UPSTREAM_FAILED, UPSTREAM_CANCELED, EXCLUDED)
↳ stateMessagestringDescriptive state message
↳ userCancelledOrTimedoutbooleanWhether the run was cancelled by user or timed out
↳ startTimenumberRun start timestamp (epoch ms)
↳ endTimenumberRun end timestamp (epoch ms)
hasMorebooleanWhether more runs are available for pagination
nextPageTokenstringToken for fetching the next page of results

Databricks Cancel Run

Cancel a running or pending Databricks job run. Cancellation is asynchronous; poll the run status to confirm termination.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
runIdnumberYesThe canonical identifier of the run to cancel

Output

ParameterTypeDescription
successbooleanWhether the cancel request was accepted

Databricks Get Run Output

Get the output of a completed Databricks job run, including notebook results, error messages, and logs. For multi-task jobs, use the task run ID (not the parent run ID).

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
runIdnumberYesThe run ID to get output for. For multi-task jobs, use the task run ID

Output

ParameterTypeDescription
notebookOutputobjectNotebook task output (from dbutils.notebook.exit())
↳ resultstringValue passed to dbutils.notebook.exit() (max 5 MB)
↳ truncatedbooleanWhether the result was truncated
errorstringError message if the run failed or output is unavailable
errorTracestringError stack trace if available
logsstringLog output (last 5 MB) from spark_jar, spark_python, or python_wheel tasks
logsTruncatedbooleanWhether the log output was truncated

Databricks List Clusters

List all clusters in a Databricks workspace including their state, configuration, and resource details.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token

Output

ParameterTypeDescription
clustersarrayList of clusters in the workspace
↳ clusterIdstringUnique cluster identifier
↳ clusterNamestringCluster display name
↳ statestringCurrent state (PENDING, RUNNING, RESTARTING, RESIZING, TERMINATING, TERMINATED, ERROR, UNKNOWN)
↳ stateMessagestringHuman-readable state description
↳ creatorUserNamestringEmail of the cluster creator
↳ sparkVersionstringSpark runtime version (e.g., 13.3.x-scala2.12)
↳ nodeTypeIdstringWorker node type identifier
↳ driverNodeTypeIdstringDriver node type identifier
↳ numWorkersnumberNumber of worker nodes (for fixed-size clusters)
↳ autoscaleobjectAutoscaling configuration (null for fixed-size clusters)
↳ minWorkersnumberMinimum number of workers
↳ maxWorkersnumberMaximum number of workers
↳ clusterSourcestringOrigin (API, UI, JOB, MODELS, PIPELINE, PIPELINE_MAINTENANCE, SQL)
↳ autoterminationMinutesnumberMinutes of inactivity before auto-termination (0 = disabled)
↳ startTimenumberCluster start timestamp (epoch ms)

Databricks Get Cluster

Get the state, configuration, and resource details of a single Databricks cluster by its cluster ID.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
clusterIdstringYesThe ID of the cluster to retrieve

Output

ParameterTypeDescription
clusterobjectCluster detail
↳ clusterIdstringUnique cluster identifier
↳ clusterNamestringCluster display name
↳ statestringCurrent state (PENDING, RUNNING, RESTARTING, RESIZING, TERMINATING, TERMINATED, ERROR, UNKNOWN)
↳ stateMessagestringHuman-readable state description
↳ creatorUserNamestringEmail of the cluster creator
↳ sparkVersionstringSpark runtime version (e.g., 13.3.x-scala2.12)
↳ nodeTypeIdstringWorker node type identifier
↳ driverNodeTypeIdstringDriver node type identifier
↳ numWorkersnumberNumber of worker nodes (for fixed-size clusters)
↳ autoscaleobjectAutoscaling configuration (null for fixed-size clusters)
↳ minWorkersnumberMinimum number of workers
↳ maxWorkersnumberMaximum number of workers
↳ clusterSourcestringOrigin (API, UI, JOB, MODELS, PIPELINE, PIPELINE_MAINTENANCE, SQL)
↳ autoterminationMinutesnumberMinutes of inactivity before auto-termination (0 = disabled)
↳ startTimenumberCluster start timestamp (epoch ms)

Databricks Genie Ask

Ask a Databricks Genie space a question in natural language and wait for the answer. Starts a new conversation, or continues an existing one when a conversation ID is given. Returns the text answer, the SQL Genie generated, and the query result rows.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
spaceIdstringYesThe ID of the Genie space
contentstringYesThe question to ask Genie
conversationIdstringNoContinue this conversation so Genie uses its earlier messages as context. Omit to start a new conversation.
enableVisualizationbooleanNoAsk Genie to also generate a chart when one fits the answer

Output

ParameterTypeDescription
conversationIdstringGenie conversation ID
messageIdstringGenie message ID
statusstringMessage status (SUBMITTED, FETCHING_METADATA, FILTERING_CONTEXT, ASKING_AI, PENDING_WAREHOUSE, EXECUTING_QUERY, COMPLETED, FAILED, CANCELLED, QUERY_RESULT_EXPIRED)
contentstringThe question that was asked
answerstringGenie's text answer or summary
followUpQuestionstringClarifying question Genie asked instead of, or alongside, an answer
queryTitlestringTitle of the generated query
sqlstringSQL query Genie generated
queryDescriptionstringPlain-language description of the generated SQL
queryAttachmentIdstringAttachment ID of the generated query, used to fetch or re-run its result
statementIdstringSQL statement ID of the generated query
rowCountnumberNumber of rows the generated query returned
thoughtsarrayHow Genie interpreted the question and built the SQL (Public Preview)
↳ typestringThought category (THOUGHT_TYPE_DESCRIPTION, THOUGHT_TYPE_UNDERSTANDING, THOUGHT_TYPE_DATA_SOURCING, THOUGHT_TYPE_INSTRUCTIONS, THOUGHT_TYPE_STEPS)
↳ contentstringMarkdown-formatted thought
suggestedQuestionsarrayFollow-up questions suggested by Genie
visualizationsarrayCharts Genie generated (only when visualization was requested)
↳ attachmentIdstringVisualization attachment ID, used to download the chart
↳ titlestringChart title
↳ queryAttachmentIdstringQuery attachment the chart was built from
errorstringWhy Genie failed to answer
errorTypestringGenie error type
createdTimestampnumberWhen the message was created
columnsarrayColumn schema of the query result
↳ namestringColumn name
↳ positionnumberColumn position (0-based)
↳ typeNamestringColumn type (STRING, INT, LONG, DOUBLE, BOOLEAN, TIMESTAMP, DATE, DECIMAL, etc.)
dataarrayResult rows as a 2D array; each non-null value is a string and null values stay null
totalRowsnumberTotal number of rows in the result
truncatedbooleanWhether the result set was truncated

Databricks Genie Get Message

Get a Genie message's status and answer, including the generated SQL, visualizations, and suggested follow-up questions.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
spaceIdstringYesThe ID of the Genie space
conversationIdstringYesThe ID of the Genie conversation
messageIdstringYesThe ID of the Genie message

Output

ParameterTypeDescription
conversationIdstringGenie conversation ID
messageIdstringGenie message ID
statusstringMessage status (SUBMITTED, FETCHING_METADATA, FILTERING_CONTEXT, ASKING_AI, PENDING_WAREHOUSE, EXECUTING_QUERY, COMPLETED, FAILED, CANCELLED, QUERY_RESULT_EXPIRED)
contentstringThe question that was asked
answerstringGenie's text answer or summary
followUpQuestionstringClarifying question Genie asked instead of, or alongside, an answer
queryTitlestringTitle of the generated query
sqlstringSQL query Genie generated
queryDescriptionstringPlain-language description of the generated SQL
queryAttachmentIdstringAttachment ID of the generated query, used to fetch or re-run its result
statementIdstringSQL statement ID of the generated query
rowCountnumberNumber of rows the generated query returned
thoughtsarrayHow Genie interpreted the question and built the SQL (Public Preview)
↳ typestringThought category (THOUGHT_TYPE_DESCRIPTION, THOUGHT_TYPE_UNDERSTANDING, THOUGHT_TYPE_DATA_SOURCING, THOUGHT_TYPE_INSTRUCTIONS, THOUGHT_TYPE_STEPS)
↳ contentstringMarkdown-formatted thought
suggestedQuestionsarrayFollow-up questions suggested by Genie
visualizationsarrayCharts Genie generated (only when visualization was requested)
↳ attachmentIdstringVisualization attachment ID, used to download the chart
↳ titlestringChart title
↳ queryAttachmentIdstringQuery attachment the chart was built from
errorstringWhy Genie failed to answer
errorTypestringGenie error type
createdTimestampnumberWhen the message was created

Databricks Genie List Messages

List the messages in a Genie conversation with their answers and generated SQL, for example to replay a conversation history.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
spaceIdstringYesThe ID of the Genie space
conversationIdstringYesThe ID of the Genie conversation
pageSizenumberNoMaximum number of messages to return per page (default 20, max 100)
pageTokenstringNoPagination token from a previous response

Output

ParameterTypeDescription
messagesarrayMessages in the conversation
↳ conversationIdstringGenie conversation ID
↳ messageIdstringGenie message ID
↳ statusstringMessage status (SUBMITTED, FETCHING_METADATA, FILTERING_CONTEXT, ASKING_AI, PENDING_WAREHOUSE, EXECUTING_QUERY, COMPLETED, FAILED, CANCELLED, QUERY_RESULT_EXPIRED)
↳ contentstringThe question that was asked
↳ answerstringGenie's text answer or summary
↳ followUpQuestionstringClarifying question Genie asked instead of, or alongside, an answer
↳ queryTitlestringTitle of the generated query
↳ sqlstringSQL query Genie generated
↳ queryDescriptionstringPlain-language description of the generated SQL
↳ queryAttachmentIdstringAttachment ID of the generated query, used to fetch or re-run its result
↳ statementIdstringSQL statement ID of the generated query
↳ rowCountnumberNumber of rows the generated query returned
↳ thoughtsarrayHow Genie interpreted the question and built the SQL (Public Preview)
↳ typestringThought category (THOUGHT_TYPE_DESCRIPTION, THOUGHT_TYPE_UNDERSTANDING, THOUGHT_TYPE_DATA_SOURCING, THOUGHT_TYPE_INSTRUCTIONS, THOUGHT_TYPE_STEPS)
↳ contentstringMarkdown-formatted thought
↳ suggestedQuestionsarrayFollow-up questions suggested by Genie
↳ visualizationsarrayCharts Genie generated (only when visualization was requested)
↳ attachmentIdstringVisualization attachment ID, used to download the chart
↳ titlestringChart title
↳ queryAttachmentIdstringQuery attachment the chart was built from
↳ errorstringWhy Genie failed to answer
↳ errorTypestringGenie error type
↳ createdTimestampnumberWhen the message was created
nextPageTokenstringToken for the next page of results

Databricks Genie Get Query Result

Get the rows returned by the SQL query Genie generated for a message. Available once the message is EXECUTING_QUERY or COMPLETED.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
spaceIdstringYesThe ID of the Genie space
conversationIdstringYesThe ID of the Genie conversation
messageIdstringYesThe ID of the Genie message
attachmentIdstringYesThe query attachment ID (queryAttachmentId from Ask Genie or Get Genie Message)

Output

ParameterTypeDescription
columnsarrayColumn schema of the query result
↳ namestringColumn name
↳ positionnumberColumn position (0-based)
↳ typeNamestringColumn type (STRING, INT, LONG, DOUBLE, BOOLEAN, TIMESTAMP, DATE, DECIMAL, etc.)
dataarrayResult rows as a 2D array; each non-null value is a string and null values stay null
totalRowsnumberTotal number of rows in the result
truncatedbooleanWhether the result set was truncated
statementIdstringSQL statement ID of the query
statusstringStatement status (PENDING, RUNNING, SUCCEEDED, FAILED, CANCELED, CLOSED)

Databricks Genie Execute Query

Re-run the SQL query Genie generated for a message. Use this when the message's query result has expired (status QUERY_RESULT_EXPIRED). If the returned status is PENDING or RUNNING, fetch the rows afterwards with Get Genie Query Result.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
spaceIdstringYesThe ID of the Genie space
conversationIdstringYesThe ID of the Genie conversation
messageIdstringYesThe ID of the Genie message
attachmentIdstringYesThe query attachment ID (queryAttachmentId from Ask Genie or Get Genie Message)

Output

ParameterTypeDescription
columnsarrayColumn schema of the query result
↳ namestringColumn name
↳ positionnumberColumn position (0-based)
↳ typeNamestringColumn type (STRING, INT, LONG, DOUBLE, BOOLEAN, TIMESTAMP, DATE, DECIMAL, etc.)
dataarrayResult rows as a 2D array; each non-null value is a string and null values stay null
totalRowsnumberTotal number of rows in the result
truncatedbooleanWhether the result set was truncated
statementIdstringSQL statement ID of the query
statusstringStatement status (PENDING, RUNNING, SUCCEEDED, FAILED, CANCELED, CLOSED)

Databricks Genie Download Visualization

Download a chart Genie generated as a PNG image, for example to post it to Slack. The message must be COMPLETED and asked with visualization enabled. Not supported on Private Link workspaces.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
spaceIdstringYesThe ID of the Genie space
conversationIdstringYesThe ID of the Genie conversation
messageIdstringYesThe ID of the Genie message
attachmentIdstringYesThe visualization attachment ID (visualizations[].attachmentId)

Output

ParameterTypeDescription
filefileRendered chart image (PNG) stored in execution files

Databricks Genie Send Feedback

Rate a Genie answer as positive or negative, with an optional comment. Space authors use this feedback to improve the space's instructions.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
spaceIdstringYesThe ID of the Genie space
conversationIdstringYesThe ID of the Genie conversation
messageIdstringYesThe ID of the Genie message
ratingstringYesFeedback rating: POSITIVE, NEGATIVE, or NONE (clears a previous rating)
commentstringNoOptional feedback comment (max 5000 characters)

Output

ParameterTypeDescription
successbooleanWhether the feedback was recorded

Databricks Genie Delete Message

Delete a message from a Genie conversation.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
spaceIdstringYesThe ID of the Genie space
conversationIdstringYesThe ID of the Genie conversation
messageIdstringYesThe ID of the Genie message

Output

ParameterTypeDescription
successbooleanWhether the message was deleted

Databricks Genie List Conversations

List conversations in a Genie space, including whether each is a chat-mode or agent-mode conversation. By default only your own conversations are returned.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
spaceIdstringYesThe ID of the Genie space
includeAllbooleanNoInclude every user's conversations in the space (requires CAN MANAGE on the space)
pageSizenumberNoMaximum number of conversations to return per page (default 20, max 100)
pageTokenstringNoPagination token from a previous response

Output

ParameterTypeDescription
conversationsarrayConversations in the Genie space
↳ conversationIdstringConversation ID
↳ titlestringConversation title
↳ createdTimestampnumberWhen the conversation was created
↳ agentTypestringConversation mode (GENIE_CONVERSATION_TYPE_CHAT or GENIE_CONVERSATION_TYPE_AGENT)
nextPageTokenstringToken for the next page of results

Databricks Genie Delete Conversation

Delete a Genie conversation you no longer need.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
spaceIdstringYesThe ID of the Genie space
conversationIdstringYesThe ID of the Genie conversation to delete

Output

ParameterTypeDescription
successbooleanWhether the conversation was deleted

Databricks Genie List Spaces

List the Genie spaces (Genie agents) you can access. Use this to find the space ID needed to ask Genie a question.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
pageSizenumberNoMaximum number of spaces to return per page (default 20, max 100)
pageTokenstringNoPagination token from a previous response

Output

ParameterTypeDescription
spacesarrayGenie spaces
↳ spaceIdstringGenie space ID
↳ titlestringSpace title
↳ descriptionstringSpace description
↳ warehouseIdstringSQL warehouse the space runs queries on
↳ parentPathstringWorkspace folder containing the space
↳ createTimestringWhen the space was created (ISO 8601)
↳ updateTimestringWhen the space was last modified (ISO 8601)
nextPageTokenstringToken for the next page of results

Databricks Genie Get Space

Get a Genie space's title, description, and SQL warehouse, optionally with its full configuration export (tables, instructions, sample questions).

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
spaceIdstringYesThe ID of the Genie space
includeSerializedSpacebooleanNoInclude the space's serialized configuration export (requires CAN EDIT on the space)

Output

ParameterTypeDescription
spaceIdstringGenie space ID
titlestringSpace title
descriptionstringSpace description
warehouseIdstringSQL warehouse the space runs queries on
parentPathstringWorkspace folder containing the space
createTimestringWhen the space was created (ISO 8601)
updateTimestringWhen the space was last modified (ISO 8601)
serializedSpacestringSerialized space configuration as a JSON string (data sources, instructions, sample questions)

Databricks Genie Agent Ask

Ask a Genie agent a question in agent mode, where Genie plans multi-step research, runs several SQL queries, and writes a report with citations. Waits for the final report. Starts a new agent-mode conversation, or continues one when a conversation ID is given. Agent mode is in preview and must be enabled on the workspace.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
spaceIdstringYesThe ID of the Genie space (the Genie agent ID)
contentstringYesThe question to ask the Genie agent
conversationIdstringNoContinue this agent-mode conversation. Omit to start a new conversation.
enableVisualizationbooleanNoAsk the agent to also generate charts where they fit

Output

ParameterTypeDescription
responseIdstringAgent response ID
conversationIdstringAgent-mode conversation ID; pass it back to ask a follow-up
statusstringResponse status (completed)
reportstringThe agent's final report, with citation links
queriesarraySQL queries the agent ran
↳ callIdstringFunction call ID
↳ titlestringQuery title
↳ sqlstringSQL the agent ran
itemsarrayEvery output item: reasoning, SQL calls, query results, and messages
↳ typestringItem type (message, reasoning, function_call, function_call_output)
↳ idstringItem ID
↳ statusstringItem status
↳ rolestringMessage role (user, assistant, or system) for message items
↳ textstringText of a message or reasoning item
↳ callIdstringPairs a function_call with its function_call_output
↳ namestringFunction name (execute_sql)
↳ argumentsstringFunction call arguments as a JSON string (title and sql)
↳ outputstringQuery result: the query title followed by a Markdown table
createdAtnumberWhen the response was created (Unix epoch seconds)
errorstringSystem error message the agent reported alongside its report

Databricks Genie Agent List Items

List an agent-mode conversation's full history in order: questions, reasoning, SQL calls, query results, and reports. Agent mode is in preview and must be enabled on the workspace.

Input

ParameterTypeRequiredDescription
hoststringYesDatabricks workspace host (e.g., dbc-abc123.cloud.databricks.com)
apiKeystringYesDatabricks Personal Access Token
spaceIdstringYesThe ID of the Genie space (the Genie agent ID)
conversationIdstringYesThe ID of the agent-mode conversation
limitnumberNoMaximum number of items to return (1-100, default 100)
afterstringNoPagination cursor: the lastId from a previous response
orderstringNoSort order: asc (oldest first, default) or desc (newest first)

Output

ParameterTypeDescription
itemsarrayConversation items in order; user questions are message items whose ID ends in _input
↳ typestringItem type (message, reasoning, function_call, function_call_output)
↳ idstringItem ID
↳ statusstringItem status
↳ rolestringMessage role (user, assistant, or system) for message items
↳ textstringText of a message or reasoning item
↳ callIdstringPairs a function_call with its function_call_output
↳ namestringFunction name (execute_sql)
↳ argumentsstringFunction call arguments as a JSON string (title and sql)
↳ outputstringQuery result: the query title followed by a Markdown table
firstIdstringID of the first item in the page
lastIdstringID of the last item in the page; pass it as After for the next page
hasMorebooleanWhether more items follow this page
statusstringStatus of the latest response in the conversation