The Debug Node allows inspection of the current payload at any point during a workflow. It is extremely useful when initially constructing a workflow, to make sure that all the various components are acting on the payload as expected.
The Debug Node takes an optional message (a string template) to include in the debug messages that get displayed. In the above example, the message is “Before Mutate”.
The node also allows for only printing a single property from the payload, as defined by a payload path. If the property is defined in the configuration, and that property does not exist on the payload, the debug output will print
Whenever a workflow runs, and in the process that run passes through one or more Debug Nodes, the workflow run will be visualized two different ways.
Every time a Debug Node is hit, the timestamp, and payload value will be written as a new message in the Debug tab. New messages appear at the top of the list. If multiple Debug Nodes are hit as part of a single workflow run, each Debug Node will get an entry in the panel; this can be helpful in determining how your payload changes over the course of a run.
To view that payload’s path through the workflow run, hover your mouse over the debug message. You will see the nodes that were part of the run highlight, and the Debug Node that generated the message will be called out.
Optionally, you may also enable the Live Debug Stream by clicking the button in the top right corner of the workflow stage. When live streaming is enabled, you will see workflow runs highlight in real time as they fire.
Note that, should multiple workflow runs occur per second, some of the runs may not be visualized on the stage. Also, if you have unsaved changes in your workflow, live streams will automatically be disabled until the changes are saved.
If the workflow is an application workflow or experience workflow, debug node output is generated for any runs of the workflow whenever you are looking at the workflow. For edge workflows, however, by default no debug output is generated. When you want debug output for an edge workflow, you must first select an Edge Compute device that the workflow is deployed and running on. At that point, Losant will tell the Edge Agent on that device to start debugging that workflow, and the Edge Agent will start reporting debugging information.
Of course, for an edge device to report workflow debug information, it must be connected to the internet and Losant. If an edge device is not online or connected, no debug information will appear even if the device is selected. In addition, debug messages from an edge device are also batched and throttled - a batch of debug messages will be sent up to Losant no more than once per second, with no more than five debug messages. So if a workflow is running quite frequently on an edge device, you might not see all the debug messages in the debug log.