Pass context about job runs into job tasks

You can pass templated variables into a job task as part of the task’s parameters. These variables are replaced with the appropriate values when the job task runs. You can use task parameter values to pass the context about a job run, such as the run ID or the job’s start time.

When a job runs, the task parameter variable surrounded by double curly braces is replaced and appended to an optional string value included as part of the value. For example, to pass a parameter named MyJobId with a value of my-job-6 for any run of job ID 6, add the following task parameter:

  "MyJobID": "my-job-{{job_id}}"

The contents of the double curly braces are not evaluated as expressions, so you cannot do operations or functions within double-curly braces. Because whitespace is not stripped inside the double curly braces, do not add extra spaces inside the braces. For example, the variable {{  job_id  }} is not evaluated.

The following task parameter variables are supported:



Example value


The unique identifier assigned to a job.



The unique identifier assigned to a task run.



The date a task run started. The format is yyyy-MM-dd in UTC timezone.



The timestamp of the run’s start of execution after the cluster is created and ready. The format is milliseconds since UNIX epoch in UTC timezone, as returned by System.currentTimeMillis().



The number of retries that have been attempted to run a task if the first attempt fails. The value is 0 for the first attempt and increments with each retry.



The unique identifier assigned to the run of a job with multiple tasks.



The unique name assigned to a task that’s part of a job with multiple tasks.


You can set these variables with any task when you Create a job, Edit a job, or Run a job with different parameters.

You can also pass parameters between tasks in a job with task values. See Share information between tasks in a Databricks job.