StyloDocs
Recipes

Run Databricks Job & Wait

Trigger a Databricks Job by ID, poll the run to completion, then branch on whether it succeeded — the pre-wired pairing of Run Job and Get Job Run.

View as Markdown

Trigger a Databricks Job by ID, poll the run to completion, then branch on whether it succeeded — the pre-wired pairing of Run Job and Get Job Run.

Prerequisites: Connect Databricks before adding this recipe. See Integrations.

How it works

Each box is a block; arrows show the order Stylo runs them, and branch labels show the path taken on each outcome.

Parameters

Set these when you add the recipe to your workspace:

ParameterTypeDefault
job_idstring
poll_interval_msnumber10000

Blocks used

Every block in this recipe, linked to its reference page where one exists:

BlockTypeWhat it does
Scheduletrigger/scheduleTrigger workflow on a cron schedule
Run Jobdatabricks/run-jobTrigger an existing Databricks Job by ID (run-now). Returns immediately with the run ID — pair with Get Job Run to poll for completion.
Loopsystem/loopIterate over items, a fixed count, or while a condition is true
Get Job Rundatabricks/get-job-runFetch the status (and optional output) of a Databricks job run. Poll this until isTerminal is true.
Delaysystem/delayPause the workflow before continuing. Top-level delays use durable execution and may run for minutes; delays inside a loop are short (≤30s).
Conditionsystem/conditionBranch the workflow based on a boolean expression

When to use it

Use this when a workflow needs a Databricks Job to finish before it continues — not just fire it off. It triggers the job, polls the run until it reaches a terminal state, then branches on whether the run succeeded, so downstream steps only act on a completed result.

Adapt it

This recipe is a starting point. To fit it to your workspace:

  • Set the job_id parameter to the numeric ID of the Databricks Job you want to run.
  • Tune the poll_interval_ms parameter to control how long the loop waits between status checks (in-loop delays are capped at 30 seconds).
  • Raise or lower the Poll Until Complete loop's max-iterations cap to match how long the job can reasonably run before you give up.
  • Fill in the Succeeded? branches with what should happen on success (e.g. read Get Final Result.output) versus failure (e.g. alert on resultState).

On this page