databricksazure-databricks

Debugging a workflow


How do you guys debug a workflow in databricks? Notebooks now have integrated debugging tooling, but how do you debug the Notebook the workflow is calling with parameters etc? Can I make a test notebook that call the notebook with parameters like the workflow, and somehow debug into my notebook, or how are you in general getting a debugging experience with breakpoints in a notebook that is called from a workflow?


Solution

  • Currently, the debugging the workflows is not supported. To debug the workflow, you can make use of the notebook debugger as a workaround, but you need to do this process manually.

    After the workflow run, take the failed code block and use another notebook cell and use the notebook debugger here.

    If you are using any workflow parameters in that code, you can make use of the notebook widgets in place of those workflow parameters and pass the required values to the widgets as shown in below sample.

    print("hi")
    # Define widget
    dbutils.widgets.text("param1","")
    # use it as workflow parameter
    print(dbutils.widgets.get("param1"))
    print("bye")
    

    enter image description here

    You can set the default value as well like below.

    enter image description here