# Limits (/workflows/code/limits)

A get leaves out what an apply would refuse, so anything a get writes can be applied back unchanged. The numbers below are hard limits, read from the same constants the CLI and the server enforce.

## What happens over a limit \[#what-happens-over-a-limit]

- **A workflow** over a limit is refused when you read or save it (`E_LIMIT_EXCEEDED`), and the CLI exits `7`.
- **An apply of a workspace directory** that would make more changes than the limit, send more edited workflows, or hold more resources of a kind is refused before anything is written, and the CLI exits `7`.
- **A get of a workspace** that holds more resources of a kind than one directory takes leaves that kind out (`E_LIMIT_EXCEEDED`, hint `--only`), writes the rest and exits `0`; the directory does not manage that kind.
- **A workspace file or knowledge base document** over its limit, or whose name a directory cannot hold, is left out of the get and listed in `.sim/skipped.json`. An apply never writes or deletes it.

### One workflow \[#one-workflow]

| Limit | Value |
| - | - |
| Blocks in one workflow | 2,000 |
| Connections (edges) in one workflow | 10,000 |
| Variables in one workflow | 2,000 |
| Files in one source: `workflow.ts` plus one function file per block | 2,001 |
| Bytes of all files together, `workflow.ts` and function files | 4,000,000 bytes |
| Nesting depth of `workflow.ts`, and of each JavaScript function file | 200 |

### A workspace directory \[#a-workspace-directory]

| Limit | Value |
| - | - |
| Resources of one kind in one directory | 500 |
| Bytes of every declaration file together, workflow files excluded | 2,000,000 bytes |
| Edited workflows one apply sends | 100 |
| Bytes of every workflow file one apply sends | 8,000,000 bytes |
| Bytes of every workflow file one get writes; a workflow past it is left out | 32,000,000 bytes |
| Changes one apply makes, no-ops excluded | 1,000 |
| Rows in one `tables/<key>.rows.jsonl` | 10,000 |
| Bytes of every rows file together | 16,000,000 bytes |
| Columns in one table | 1,000 |
| Bytes of one workspace file or knowledge base document | 10,000,000 bytes |
| Workspace files and knowledge base documents together in one directory | 20,000 |
| Nesting depth of a declaration file | 200 |

### Uploading and downloading files \[#uploading-and-downloading-files]

| Limit | Value |
| - | - |
| Bytes of files one upload request carries; a larger file goes in a request of its own | 8,000,000 bytes |
| Files in one upload request | 1,000 |
| Bytes of stored files one get or apply downloads to compare | 24,000,000 bytes |
| Files one caller may hold staged in one workspace at once | 20,000 |
| Bytes one caller may hold staged in one workspace at once | 4,000,000,000 bytes |

## Related docs \[#related-docs]

- [Exit codes](/workflows/code/exit-codes)
- [Diagnostic codes](/workflows/code/diagnostics)
- [Manage a workspace as code](/workflows/code/workspace)
