New to Kestra?
Use blueprints to kickstart your first workflows.
Schedule and orchestrate Spark jobs on Google Cloud Dataproc Serverless with Kestra. No cluster to manage, automatic retries, and Slack alerts on every run.
Run Apache Spark on Google Cloud Dataproc Serverless without provisioning, sizing, or tearing down a single cluster. This blueprint submits a Spark batch from a Kestra schedule: Dataproc Serverless provisions its own ephemeral compute per job, runs your Spark application, and releases the compute automatically, so cost tracks actual work rather than cluster uptime. Kestra wraps the batch with the scheduling, retries, lineage, and alerting that a raw API submission or the Dataproc console cannot give you, and Slack reports the final state of every run.
submit_spark task (io.kestra.plugin.gcp.dataproc.batches.SparkSubmit) submits a Spark batch to Dataproc Serverless in the configured region. The sample runs the bundled org.apache.spark.examples.SparkPi class from spark-examples.jar with an argument of 1000, and names the batch after the execution id.notify task (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) posts the batch state from outputs.submit_spark.state to Slack so the result is visible without opening the cloud console.pluginDefaults apply projectId and serviceAccount to every GCP task, keeping credentials in one place.nightly Schedule trigger (io.kestra.plugin.core.trigger.Schedule, cron 0 1 * * *, disabled by default) submits the batch on a cadence once you enable it.alert_on_failure error handler posts a Slack message if the batch fails, so failures are never silent.Dataproc's own scheduling is thin: submitting a batch by hand or via the API gives you no built-in cadence, no retry policy, no cross-task lineage, and no alerting. Kestra adds event or cron triggers, automatic retries, full execution history and lineage, and Slack alerts, all expressed as declarative YAML you can version and review. The serverless batch handles the compute; Kestra handles when it runs, what happens on failure, and what runs next.
GCP_PROJECT_ID: GCP project hosting Dataproc.GCP_SERVICE_ACCOUNT: service account key JSON with Dataproc batch access.GCP_REGION: region for the serverless batch (for example, us-central1).SLACK_WEBHOOK_URL: Slack incoming webhook URL.mainClass, jarFileUris, and args with your own Spark application.nightly Schedule trigger (or swap it for an event trigger) once configured.PySparkSubmit with mainPythonFileUri instead of mainClass.submit_spark to absorb transient cloud errors.