Skip to content

Debugging

TekMonks edited this page Dec 16, 2025 · 1 revision

Some tips to debug ASB flows

Deducing the message flow

  • Look at the logs. The ASB adds statements which allow tracing each message and how it flows using its timestamp. Eg
{"ts":"2025:12:16:15:12:36","level":"info","message":"[IMAP_LISTENER] Injected message with timestamp: 9681713747799296"}
  • This can be grepped to filter the flow. Eg cat asb.log.ndjson | grep 9681713747799296 will allow us to see the path the message took and which nodes it flowed into.
cat asb.log.ndjson | grep 9681713747799296
{"ts":"2025:12:16:15:12:36","level":"info","message":"[IMAP_LISTENER] Injected message with timestamp: 9681713747799296"}
{"ts":"2025:12:16:15:12:37","level":"info","message":"[ESB] Flow Knowledge lake chat using ASB is routing message with timestamp 9681713747799296 to route route.convertemail"}
{"ts":"2025:12:16:15:12:37","level":"info","message":"[ROUTE_JS] route.convertemail: Processing message with timestamp: 9681713747799296"}

Debugging inline Javascript code

Debugging inline Javascript code (inside JS route or other similar nodes) can become difficult. The best strategy is to place a manual break point using the debugger command. Eg. as shown in the following example

route.convertemail:
  type: js
  dependencies: listener.email 
  isAsync: true
  js: |
    message.content.query = message.content.texts.join();
    debugger;

This allows easier debugging as the debugger will wait at this breakpoint allowing us to look at stack, variables or step in etc.

Clone this wiki locally