Workflow Debugging#

Workflows include a Python debugger where you can set breakpoints and run them through the Artificial UI. In your branch, under the .vscode folder, you can see how debug tests are configured in the launch.json file.

In this file, there are three configurations:

Python: Run Adapter

This is for launching your adapter and is configured to launch a specific file. With the current adapter setup, this will not need to be updated.

Debug Unit Test

This is used when debugging one or more unit tests.

Launch Workflow

This creates and starts a new job for the workflow of interest. You can specify the request module parameter values with jobArgs:

"name": "Launch Workflow",
"type": "artificial-workflow",
"request": "launch",
"program": "${file}",
"jobArgs": {
   "param_name": 5,
   "num_plates": 4
}

For debugging Workflows, you will use Launch Workflow. This will create and schedule a job to run ASAP in the lab whose id appears in the @workflow decorator. Any Assistants will need to be manually completed by the user.

After adding breakpoints to your Workflow, you can debug by doing the following:

  1. Open your .py file for your workflow.

  2. Click Run and Debug and select the green button Python: Launch Workflow.

    If Python: Launch Workflow is already selected, you can hit F5 to run with debug or Ctrl+F5 without debugging.

  3. When stopped at a breakpoint, you can click Step Over or F10 to skip to the next line, or Run or F5 to run to the next breakpoint if you have multiple breakpoints.

If the lab has other jobs scheduled and is not configured to run jobs concurrently, the job launched by the debugger will not start executing right away.