cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Pass variable values from one task to another

swzzzsw
New Contributor III

I created a Databricks job with multiple tasks. Is there a way to pass variable values from one task to another. For example, if I have tasks A and B as Databricks notebooks. Can I create a variable (e.g. x) in notebook A and later use that value in notebook B?

1 ACCEPTED SOLUTION

Accepted Solutions

-werners-
Esteemed Contributor III
5 REPLIES 5

-werners-
Esteemed Contributor III

Hi,

check this: notebook workflows

swzzzsw
New Contributor III

Thank you, Werner! From my understanding, if I put a notebook in %run command, I won't have it as a separate task in the job. However, I'd also like to keep the ability to see it in the task view for transparency. Is there a way to achieve that?

-werners-
Esteemed Contributor III

hm I don´t think so as actually the notebooks will run within the same task.

-werners-
Esteemed Contributor III

you could also consider using an orchestration tool like Data Factory (Azure) or Glue (AWS). there you can inject and use parameters from notebooks.

The job scheduling of databricks also has the possibility to add parameters, but I do not know if you can dynamically determine the input (based on another task).

swzzzsw
New Contributor III

Thank you! We're on Azure. Will explore Data Factory!

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!