---
title: Debug
description: Generate sample data, delay, or throw on demand
---

Generate sample data, add a short pause, or force an error while you build and test a workflow.

## What it does

Debug does one of three things, chosen with **Mode**:

* **Generate** emits predictable sample data in the **Shape** you pick. It ignores the incoming data.
* **Delay** waits **Delay (ms)** milliseconds, then passes the incoming data through unchanged.
* **Throw** fails on purpose with **Error message**.

It never touches the network, your credentials or your stored data.

## When to use it

* Feed a node sample data so you can test it before connecting a real source.
* Check how a step copes with a long text or a deeply nested object.
* Slow a step down to watch the run, or space out two actions.
* Fail on purpose to test [Try / Catch](/nodes/builtin/flow/try/), retries or **Continue On Fail**.

For waits longer than a few seconds, or that must survive closing the tab, use [Wait](/nodes/builtin/flow/wait/).

## Inputs and settings

Each **Generate** setting applies to one shape only: **Count** to *Indexed items* (default 5), **Length** to *Long string* (default 1000), **Depth** to *Nested object* (default 3). The others are ignored. **Error message** defaults to "Debug node threw on demand".

## Outputs

* **Generate**, by shape:
  * *Indexed items*: **Count** items, each `{ index, id }`, with `index` from `0` and `id` like `item-0`.
  * *Long string*: one item `{ value }` whose text is exactly **Length** characters.
  * *Nested object*: one item nested **Depth** levels deep, `{ level: 1, child: { level: 2, ... } }`; the deepest level has `leaf: true`.
  * *Random JSON*: one item `{ id, name, active, score, tags }` with random values (number, text, true/false, number, list of text).
* **Delay**: the incoming data, unchanged (an empty item if nothing came in).
* **Throw**: no output; the node fails.

## Dependencies and credentials

None. This node needs no connection and has no slots for other nodes.

## Example workflow

Test an error branch before connecting the real step:

1. [When Started](/nodes/builtin/trigger/whenstarted/) trigger.
2. [Try / Catch](/nodes/builtin/flow/try/).
3. From **Try**: Debug, **Mode** Throw, **Error message** `Simulated API failure`.
4. From **Catch**: [Browser Notification](/nodes/extension/browsernotification/) with **Message** `{{ $input.nodeLabel }} failed: {{ $input.message }}`.

Once the catch branch works, replace Debug with the real step.

## Common issues

* **The run stops with "Debug node threw on demand".** That is Throw mode doing its job. Switch **Mode** back, or handle the error with [Try / Catch](/nodes/builtin/flow/try/) or **Continue On Fail** in the node's settings.
* **Count, Length or Depth seems ignored.** Each only applies to its own **Shape**.
* **The delay is lost when you close the tab.** Delay is a plain in-run timer. Use [Wait](/nodes/builtin/flow/wait/) for waits that must survive a closed tab.
* **The data from the previous node is gone.** Generate replaces it with sample data. Only Delay passes data through.

## Related nodes

* [Wait](/nodes/builtin/flow/wait/): pause longer, even across a closed tab.
* [Try / Catch](/nodes/builtin/flow/try/): handle the error Throw raises.
* [Stop and Error](/nodes/builtin/flow/stopanderror/): fail a run on purpose in a finished workflow.
* [Code](/nodes/builtin/core/code/): build custom test data.