> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langdock.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Runtime limits

> Look up the caps that stop a workflow run so you can size loops, files, and node outputs before you publish.

Workflows stop at hard caps, not only at spend. Check these numbers when you loop a long list, accept a large webhook, or pass a wide API response into a Code node. Spend and monthly USD caps live on [Cost Management](https://docs.langdock.com/en/using-langdock/workflows/guides/cost-management.md) and [Workflow limits](https://docs.langdock.com/en/admin/manage-workflows/spend-limits.md) for admins.

Some values are fixed. Others are set on the node, in workflow **Settings**, or on the workspace.

## Run size

| Limit | Value | Where | When it trips | What to do |
| - | - | - | - | - |
| Steps per run | 2,000 (workspace default) | Every run | The run fails with `Steps-per-run limit reached`. | Split the job, shrink the loop, or drop extra Delay nodes. Your workspace value can differ. |
| **Max runs per hour** | Default 100, maximum 5,000 | Workflow **Settings** | No new run starts while this many runs exist in the last 60 minutes. A new run can start once older runs fall out of that window. | Raise **Max runs per hour**, or slow the trigger. |
| Monthly run cap | Depends on the Workflows plan. Cloud default is 2,500 | Workspace | New runs stop. Scheduled and polling workflows turn off when they try to run. | Ask an admin to change the plan. Dedicated deployments do not apply this count cap. |

Each node execution counts as a step, including iterations inside a Loop and Delay nodes. Agent **Max Steps** is a separate cap on tool calls inside one Agent node. It does not replace the step limit for the whole run.

## Loops, agents, and delays

| Limit | Value | Where | When it trips | What to do |
| - | - | - | - | - |
| **Max iterations** | Default 200, maximum 2,000 | Loop node | The Loop fails if the array is longer than the configured value, and it always fails above 2,000 items. | Raise **Max iterations**, page the list, or split across runs. |
| **Collect outputs** | 25 MB combined | Loop node, when **Collect outputs** is on | The loop end fails. The oversized result is not stored. | Turn **Collect outputs** off, or collect summaries instead of every iteration's full output. |
| **Max Steps** | Default 25, maximum 100 | Agent node | The Agent node fails if the agent reaches this cap before finishing. | Raise **Max Steps** for research-heavy agents. Lower it for short, predictable tasks. |
| Delay duration | Maximum 1 day | Delay node | You cannot save a longer delay. | Use a [Scheduled Trigger](https://docs.langdock.com/en/using-langdock/workflows/nodes/triggers/scheduled-trigger.md) for waits longer than a day. |

## Files and payloads

| Limit | Value | Where | When it trips | What to do |
| - | - | - | - | - |
| Node output | 25 MB | Every node | The node fails with `Node output exceeded the maximum size of 25 MB`. Nothing is stored. | Filter or paginate. Return files as files, not as inline JSON. |
| Run inspection | 512 KB (524,288 bytes) | Every node, in the builder and in workflow run history | The field is replaced by a truncation marker. The node does not fail, and later nodes still load the stored output. | Return less data if you need the JSON on screen. |
| Code node input | 5 MiB of loaded upstream outputs | [Code node](https://docs.langdock.com/en/using-langdock/workflows/nodes/code-node.md#limits) | The node fails before your code runs. | Reference only the slugs you need. Avoid `data`. Shrink upstream output or turn **Collect outputs** off. |
| JavaScript sandbox response | 150 MB | Code node (JavaScript) | Code execution fails. The stored workflow output is still capped at 25 MB. | Return less, or write files instead of a huge return value. See [Sandbox Utility Functions](https://docs.langdock.com/en/using-langdock/guides/integrations/sandbox-utilities.md). |
| Webhook body | 25 MB. 12 MB when **Preserve raw request body** is on | [Webhook Trigger](https://docs.langdock.com/en/using-langdock/workflows/nodes/triggers/webhook-trigger.md) | HTTP 413 | Turn off **Preserve raw request body**, or send file references instead of huge Base64. |
| Form files | 20 files, 100 MB total | [Form Trigger](https://docs.langdock.com/en/using-langdock/workflows/nodes/triggers/form-trigger.md) | The submission is rejected. | Upload fewer or smaller files. |
| Form fields | 20 fields | Form Trigger | The builder blocks adding more fields. | Split into two forms, or collect extra data later in the run. |
| Action files | 20 files | Action results and form uploads | The form rejects the submit. Some actions fail instead of keeping extra files. | Limit attachments in the action. |

Files you return from a Code node in a `files` array, or create in the Python working directory, are uploaded before the 25 MB output measurement. Their bytes do not count toward that cap.

In the builder and in workflow run history, input, output, logs, and the input and output errors are checked one by one. A value over 512 KB comes back as an `_truncated` object with `originalBytes`, `maxBytes`, and the message `This value was truncated because it exceeded the safe size limit for workflow data.` The original JSON is not included. Loop data keeps a few keys beside the marker:

* Loop input keeps `_loopContext`.
* A Loop output with `items` keeps its other keys, with `items` set to `[]` and `total` kept.
* A collected Loop output with `iterations` keeps `total`, with `iterations` set to `[]`.
* A per-iteration Loop output keeps `currentIndex`, `currentItem`, and `total`.

Any other value, including Agent output, is the marker alone.

An Agent output counts `structured`, `messages`, and `files` when the agent created files, plus `agentState` while the node waits for input. `messages` holds the resolved **Prompt**, assistant replies, and tool results, plus earlier messages when the node resumes. `files` holds file metadata, not file bytes. The agent's own instructions are not stored in the output.

## Cost caps

USD and EUR spend caps are separate from the table above. Set **Monthly cap**, **Per-run cap**, and **Max runs per hour** in the workflow **Settings** panel. Workspace admins set the workspace spend cap and the maximum monthly cap per workflow.

When a workflow hits its monthly spend cap, new runs cannot start. Scheduled and polling workflows are deactivated when they try to run after that. Details: [Cost Management](https://docs.langdock.com/en/using-langdock/workflows/guides/cost-management.md).

## Workarounds that usually help

* Filter or summarize before an Agent or Code node. Do not loop 2,000 raw records through a large model.
* Page large lists into several runs instead of one Loop at the 2,000-item ceiling.
* Keep **Collect outputs** off unless a later node needs the full array.
* In Code nodes, name the upstream slugs you read. `data` loads every predecessor into the 5 MiB budget.
* Prefer file references over Base64 in webhooks and node outputs.

## FAQ

> **Why did my run fail after it already processed many loop items?**
>
> The step limit for the run counts every node execution, including each loop iteration. Hitting 2,000 steps fails the run even if **Max iterations** still has room.

> **Why is my Code node failing before the script starts?**
>
> The 5 MiB input cap is measured on the upstream outputs your code loads. A Loop with **Collect outputs** on is a common cause. Reference fewer slugs, or collect less.

> **Can I raise the 2,000-step limit myself?**
>
> No. Steps per run is a workspace setting, default 2,000. Ask your admin or Langdock contact if your workspace needs a different value.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.