Table of Contents

How to debug your agent's flow without code

Desirée M Updated by Desirée M

To debug your agent's flow without code, check the values of its Fields where the flow goes wrong: show a Field in a message, look at what a Webhook block received, send the value to yourself by email, or compare it in a Conditions block. Most flow problems come from a Field that holds a different value than you expect, or no value at all.

How to find where and why the flow goes wrong

To find where your agent's flow goes wrong, test it and note the last block that works; to find why, check the values of the Fields that block uses. Debugging a flow comes down to those two questions.

Run a few tests of your agent (see How to Test Your Bot) and note the last block that does what you expect. That's where the flow goes wrong, and the block to look at.

Then check the values of the Fields that block uses to find why.

To pick the method, start from what you see:

● A message shows the wrong value, or nothing where a Field should be: show the Field in a message right after the block that saves it.

● A value from an API is missing: check what the Webhook block received, in its full response or its logs.

● The agent is already published: send the Field's value to yourself by email, so visitors see nothing.

● The value looks right, but the flow takes the wrong path: check the Conditions block that decides the path.

How to show a Field's value in the chat

To show a Field's value in the chat, add a Send a message block with the Field right after the block you want to check, then test the agent. It's the quickest way to see what a Field holds at that point of the flow.

1️⃣ Drag from the output of the block you want to check onto an empty part of the canvas, and select Messages > Send a message.

2️⃣ Type a short label, then click Use field and select the Field.

3️⃣ Connect the new message's output to the block that came next, so the rest of the flow still runs.

Adding a Send a message block after a Webhook block and inserting the order_status Field with Use field

In this example, a pizza place's agent, Slice Society, asks for an order number and gets the order from an API with a Webhook block. The Webhook block saves the order's status in @order_status, and a Conditions block uses it to tell the visitor whether their pizza is on its way. Visitors whose pizza had already left were told it was still in the kitchen, so a debug message now shows @order_status right after the Webhook block.

Webhook block connected to a debug message showing the order_status Field, then to a Conditions block

4️⃣ Test the agent. The debug message shows the Field's value at that point of the flow.

Chat where the debug message shows the order status out for delivery, followed by a still-in-the-kitchen reply

In the Slice Society test, the debug message shows out for delivery, so the Webhook block did its job: the problem is further along the flow, in the Conditions block.

If the value is the one you expect, the block before the debug message is fine: move the debug message to the next step you suspect and test again. If the value is wrong or missing, you've found the problem: it's in the block that saves the Field.

Remove debug messages before you publish, or your visitors will see them too. To debug an agent that's already live, send the value to yourself by email instead.

How to check what a Webhook block received

To check what a Webhook block received, look at its full response or at its logs. The full response shows everything the API sent back in one test, and the logs show every request your Webhook blocks made, with what they sent and received.

How to see a Webhook block's full response

To see everything an API sends back to a Webhook block, save the whole response in a Field and show it in a message. This helps when you need a value the Webhook block doesn't save yet, or when a key isn't where you expected it.

1️⃣ In the Webhook block, click Test the request. The panel shows the Test Status Code and the Test Response Body, and often that's all you need to see what the API returns.

2️⃣ In Save Responses as Fields, click Add. The new row is set to Entire Response Body.

3️⃣ Type a name for the Field, such as full_order, click CREATE, choose the format and click CREATE again. Then click APPLY.

Webhook block panel saving the Entire Response Body in a new Field called full_order after Test the request

4️⃣ Show the Field in a Send a message block right after the Webhook block.

Webhook block connected to a message that shows the full_order Field

5️⃣ Test the agent. The message shows the whole response, so you can see which key holds each value.

Chat message showing the full Webhook response for order SL-2048, with the rider Mateo Tanaka and the status out for delivery

In the Slice Society test, the full response shows the order exactly as the API sends it, with the status written in lowercase: out for delivery.

The chat shows the response as plain text with single quotes, not as formatted JSON.
How to check Webhook requests in the logs

To check your Webhook requests in the logs, click See Logs at the top of any Webhook block panel. Every request your Webhook blocks make is logged there, with what it sent and what it got back, so you can check them without touching the flow.

You'll also find the logs in the Webhook Block Dashboard, on the LOGS tab.

Each row shows the agent, the date, whether the request succeeded, the method, the data sent and the response data. To find one request, filter by agent ID, SUCCESS or date and click APPLY.

Webhooks dashboard LOGS tab filtered by agent ID, showing successful GET requests with the order number sent and the order data received
Test the request runs without the visitor's answers, so its rows in the logs show empty values, such as {"order":""}, unless you turn on Manually set values for test fields and enter test values.

How to debug a published agent without showing values to visitors

To debug a published agent without showing values to visitors, send the Field's value to yourself with a Send an email block instead of a debug message. Your visitors won't notice anything: the chat moves straight on to the next block.

1️⃣ Add a Send an email block right after the block you want to check.

2️⃣ In Send to, type your own address and press Enter.

3️⃣ Insert the Field with Use field in Email subject or Email message.

4️⃣ Connect the Send an email block's output to the block that came next, so the flow carries on.

Send an email block with the order_number and order_status Fields, placed between the Webhook block and the Conditions block

In the Slice Society agent, the Send an email block takes the debug message's place between the Webhook block and the Conditions block. Its subject names the order with @order_number and its message gives the status with @order_status, so each email tells you which order it belongs to.

The Send an email block needs a sender in From. The Default Landbot email is for testing only; the Send an email article explains how to set up your own sender.

A Slack Notification block works the same way if your team lives in Slack.

How to find out why a Conditions block takes the wrong path

To find out why a Conditions block takes the wrong path, compare the value the Field holds with the value in the condition. EQUAL TO compares text exactly, capitals included, so a value that looks right can still send the flow down the red output.

1️⃣ Show the Field in a debug message right before the Conditions block, and test the agent.

2️⃣ Open the Conditions block and compare the value in Set the condition(s) with the one the debug message showed, character by character.

3️⃣ Type the value exactly as the Field holds it, and test the agent again.

In this example, the Slice Society agent told every visitor their pizza was still in the kitchen, even when it was out for delivery. For this check, the Slice Society test agent has a debug message right before its Conditions block, and the two showed values that looked the same:

● Value in the Field, shown by the debug message in the test chat: out for delivery

● Value in the condition: Out for delivery, with a capital O

Conditions block checking if order_status is equal to Out for delivery with a capital O, right after a debug message that shows order_status

The two values don't match exactly, so the red output ran for every order. With the value typed as out for delivery, the Slice Society Conditions block sends each visitor the right reply:

● Green output (true), the pizza has left: "🛵 Good news! Your pizza is on its way. Your rider: Mateo Tanaka", with the rider's name from the @rider Field.

● Red output (false), any other status: "👩‍🍳 Your pizza is still in our kitchen. We'll let you know as soon as it's on its way!"

In the test after the fix, the debug message still shows out for delivery, and now the agent takes the green output:

Chat where the debug message shows out for delivery and the agent replies that the pizza is on its way with the rider Mateo Tanaka

If the values match exactly and the flow still takes the wrong path, check that the condition uses the right Field and the right comparison, such as EQUAL TO or CONTAINS.

To test one value without touching the real flow, add a temporary Conditions block with two test messages, such as "✅ Match" and "❌ No match", and remove it once you've found the problem.

Was this article helpful?

How to test your agent

Starting Point