Breakpoints & Step through
While developing a flow, it can be useful to examine how each line of your flow script is executed. Engine supports two editor features that allow this.
Since both breakpoints and step through are meant for debugging and developing, they are only available in the development mode. To start debugging with breakpoints and step through, hover over "..." then click on "Debug".
The button to debug a flow.
Because debugging performs extra steps every line of code (breakpoint handling), it runs slower than productive mode. This gets more noticeable the more lines the script executes i.e. the difference in performance is negligible for 100 lines but very noticeable for 10,000 lines.
Note that in this context a script that executes 100 distinct lines is the same, as a script that loops over 10 distinct lines 10 times.
Debug mode with fixed breakpoints
Fixing the breakpoints of an execution reduces the performance penalty incurred by debug mode. However, this also means, that you cannot add or remove breakpoints while the execution is running.
Breakpoints
A breakpoint signals Engine that, when running a flow in development mode, the script should be executed up to the line where the breakpoint is set. Then the execution pauses and you can examine its current state.
You can see at which line the execution paused.
Setting/un-setting breakpoints
You can set and delete a breakpoint in a familiar way by simply clicking to the left of the line number. To remove it, simply click on the red dot and it will be gone.
You can only edit breakpoints of a flow if your role has the needed permissions to update the flow and the flow is not read-only. See role based access control and read only for more on this.
After clicking to the left of line 6, the red dot marks the breakpoint.
Breakpoints set in empty lines will have no effect and your script will not be paused.
Accessing the current state of the execution
Depending on what information you want to extract from the execution, you have multiple ways to go about it. Here are some examples:
- Checking the output value at the time of the breakpoint This is fairly straightforward, simply head to the 'Output' tab of the execution.
- Reading the value of a variable at the time of the breakpoint First, you need to log the value with user logs (just before the line with the breakpoint). After that, you can see it on the 'Logs' tab of the execution.
- Getting general information of the execution at the time of the breakpoint
You can use
this.set_output(general_info=this.get_dict())
(just before the line with the breakpoint) to write execution information into the output value. Then head over to the 'Output' tab of the execution to see it.
Step through
After the execution has been paused at a breakpoint, you can start it again. In this case it will run until it's finished or until it hits another breakpoint. Alternatively, you can use step through to execute the script line by line.
Here are the buttons to resume or execute line-by-line.
When an execution start another execution while being stepped through, the child execution inherits the debug mode and can also be stepped through, line-by-line.