New to Kestra?
Use blueprints to kickstart your first workflows.
Provision a Databricks cluster, run a Spark Python job, and delete the cluster automatically with Kestra. Pay only for the compute you use, with guaranteed cleanup.
Run ephemeral Spark workloads on Databricks without leaving idle clusters running and burning cloud spend. This blueprint provisions a fresh Databricks cluster on demand, executes a Spark Python job on it, and deletes the cluster afterwards, so you pay only for the compute you actually use. The cleanup is guaranteed even when the job fails, which makes it a reliable pattern for scheduled batch jobs, ad-hoc data processing, and CI-style pipeline runs on Databricks.
create_cluster task (io.kestra.plugin.databricks.cluster.CreateCluster) provisions a new cluster named kestra-demo with the requested nodeTypeId, numWorkers, and sparkVersion, authenticating against your workspace host with a token.run_job task (io.kestra.plugin.databricks.job.CreateJob) submits a Spark Python job to the cluster created above, referencing it through {{ outputs.create_cluster.clusterId }}. It runs the pythonFile stored in the Databricks workspace and waits up to five minutes for completion, as set on waitForCompletion.io.kestra.plugin.core.flow.AllowFailure block, so a failed job does not abort the flow.delete_cluster task (io.kestra.plugin.databricks.cluster.DeleteCluster) always runs and removes the cluster, ensuring no compute is left running regardless of the job outcome.Databricks job scheduling assumes you manage cluster lifecycle yourself, and a job that fails can leave a cluster running. Kestra makes the full lifecycle declarative: provision, run, and delete in one versioned YAML file, with the AllowFailure block guaranteeing cleanup. You can drive runs from event triggers, schedules, or upstream tasks, add retries, and capture lineage across the whole flow, not just inside a single Databricks job.
/Shared/hello.py) available in the workspace.DATABRICKS_HOST: your Databricks workspace URL.DATABRICKS_TOKEN: a personal access token used to authenticate API calls.DATABRICKS_HOST and DATABRICKS_TOKEN secrets to your Kestra instance.pythonFile to match.nodeTypeId, numWorkers, and sparkVersion to fit your workload.Schedule or event trigger to run the job on a cadence or on incoming data.sparkPythonTask with a notebook, JAR, or SQL task in jobTasks.run_job and notifications on failure.