# Diagnostic codes (/workflows/code/diagnostics)

Every finding that `check`, `status` and `apply` print has a code. The first letter is its severity: `E_` is an error, `W_` a warning and `I_` information. An error refuses the apply and makes `check` exit `1`. A warning is reported and the apply saves the source as written, except where a row below says the apply refuses it as the matching `E_APPLY_…` error. Information never blocks anything.

A finding prints as `file:line:column` with the code around it and a hint; in `--output json` it is an entry of `diagnostics` (see [Scripting](/cli/scripting#exit-codes) for the shape). The codes are frozen at release, so a script can match on them.

### Workflow source \[#workflow-source]

#### Compile and print \[#compile-and-print]

Reading and writing `workflow.ts`.

| Code | Meaning |
| - | - |
| `E_SYNTAX` | Babel could not parse the file. |
| `E_INVALID_CHARACTER` | A NUL or an unpaired UTF-16 surrogate, raw or escaped in a string, in the file or a code file: a workflow cannot store either. |
| `E_NUMBER_NOT_FINITE` | A number literal too large to store (`1e999` reads as `Infinity`). |
| `W_NUMBER_PRECISION` | A number literal whose digits a number cannot hold; write it as a string. |
| `E_SDK_HEADER` | Line 1 is not `// @sim-sdk N`. |
| `E_SDK_MAJOR` | The header's major is not the one the server reads. |
| `E_UNSUPPORTED_SYNTAX` | A construct outside this grammar; the hint names the supported form. |
| `E_WORKFLOW_EXPORT` | Not exactly one `export default workflow(…)`. |
| `E_LIMIT_EXCEEDED` | Over the block, edge, total-byte, depth or `codeFile()` reference cap (`SOURCE_LIMITS`). Apply answers 413. |
| `E_TOO_MANY_ERRORS` | The compile stopped after 100 errors; fix those and compile again to see the rest. |
| `I_FINDINGS_TRUNCATED` | 100 warnings, or 20 of one code, were listed and the rest omitted, so a flood of one finding never hides another. A finding repeated at the same place is listed once. Infos are capped apart (100, the rest dropped), so they never displace a warning, and errors are never displaced by either. An answer that merges findings from several stages is capped the same way as a whole; when that cuts it, it ends in one `I_FINDINGS_TRUNCATED` counting what it left out, in place of the stages' own. |
| `E_DUPLICATE_NAME` | Two blocks normalize to one key. |
| `E_RESERVED_NAME` | A block name normalizes to `loop`, `parallel` or `variable`. |
| `E_KEY_OVERRIDE` | A `meta.key` that is not a legacy key the stored workflow already has. |
| `E_EMPTY_NAME` | An empty block name. |
| `E_NAME_NOT_LITERAL` | A block or workflow name that is not a string literal. |
| `E_LOOKALIKE_NAME` | Two block names whose keys differ only by Unicode normalization (NFC vs NFD), or a block name with a word that mixes Latin letters with Cyrillic, Greek, Armenian or Cherokee ones (`Сlaude`); the message names the code point. |
| `W_LOOKALIKE_NAME` | A look-alike pair the stored workflow already holds, kept so it round-trips. |
| `W_SUSPICIOUS_CHARACTER` | A block or workflow name holds a bidi control or zero-width character. |
| `E_UNKNOWN_IDENTIFIER` | An identifier that names nothing in scope; the hint has a did-you-mean, says to write the value for a const refused for holding one, and points `process.env` at `env.NAME`. |
| `E_OUT_OF_SCOPE` | A ref or wiring into a sibling subflow's child. |
| `E_UNKNOWN_VARIABLE` | `vars.x` names no declared variable. |
| `E_DUPLICATE_VARIABLE` | Two variables with one key. |
| `E_VARIABLE_NAME_MISMATCH` | A variable's `name` does not normalize to its key. |
| `E_INVALID_ENV_NAME` | `env.X` with an invalid name. |
| `W_ENV_UNKNOWN` | `env.X`, or a code file `$env`, naming a variable the workspace does not hold (checked only when the env names are known); the hint has a did-you-mean. An offline check in a workspace directory knows only the names `secrets.ts` declares, so there the finding says `secrets.ts` does not declare it, and the hint points there. |
| `W_CHILD_INPUT_UNKNOWN` | A child workflow call's `inputMapping` sets an input the child's Start trigger does not declare (`sim workspaces source check`, with the child in the same directory); the hint names the nearest input. |
| `W_CHILD_NO_START` | A child workflow call names a workflow of the same directory that has no Start trigger (`sim workspaces source check`). |
| `W_CHILD_RESULT_PATH` | A reference to a child workflow call's `result.<key>` whose child (in the same directory) ends at a Response block on every run, where `<key>` is not `data`, `status` or `headers`: the child's result is its Response output, so the path reads nothing (`sim workspaces source check`); the hint names `result.data.<key>`. The dry run reports the same reference as a `W_APPLY_LINT` warning. |
| `E_UNKNOWN_SUBFLOW_PROPERTY` | `p.<prop>` that a loop or parallel does not have. |
| `W_FORWARD_REF` | A ref to a block declared later; it resolves. |
| `W_REF_NOT_NORMALIZED` | Hand-written `<Name.path>` text that is not in key form. |
| `E_REF_UNREPRESENTABLE` | A reference to a block whose key holds a character a reference cannot carry (`Q&A`, `x>y`); rename the block. |
| `E_EDGE_SCOPE` | An edge across subflow scopes. |
| `E_EDGE_NOTE` | An edge to or from a note. |
| `E_TARGET_TRIGGER` | An edge into a trigger. |
| `E_NO_DEFAULT_OUTPUT` | `.to()` on a condition or router; wire a branch. |
| `E_DUPLICATE_EDGE` | The same edge twice. |
| `E_ERROR_PORT_UNSUPPORTED` | `onError` on a block with no error port. |
| `W_ERROR_PORT_STORED` | `onError` on a block with no error port (a loop or parallel) that the stored workflow already wires; kept so it round-trips. An offline check, which cannot read the stored workflow, reports it for any such edge between two blocks the lock binds: an apply keeps it only if the stored workflow holds it. |
| `E_UNKNOWN_BRANCH` | `x.key.to()` where `key` is not a branch of `x`. |
| `E_DUPLICATE_BRANCH_KEY` | Two rows with one key. |
| `E_BRANCH_KEY_COLLIDES` | A branch key equal to an output name, `to` or `onError`. |
| `E_BRANCH_ELSE_LAST` | Two or more condition rows that do not end with `else`. |
| `W_RAW_HANDLE` | `edge()` with a handle kept verbatim. |
| `W_SUBFLOW_HANDLE_SCOPE` | `edge()` from a loop or parallel's start handle to a block outside it (the executor runs it as the container's exit), or from another of its handles into its own child. The canvas never draws one; stored ones print this way so they round-trip. |
| `E_EDGE_CYCLE` | Wiring that closes a cycle among enabled blocks, a self-loop included: no block on it ever runs. Framed at the edge back to a block declared earlier, the one to remove; repeat work with `loop()`/`parallel()`. |
| `W_EDGE_CYCLE` | A cycle the stored workflow already holds, kept so it round-trips; none of it runs. An offline check reports it for a cycle among blocks the lock binds, which an apply keeps only if the stored workflow holds every edge of it. |
| `W_BRANCH_UNWIRED` | A condition or router branch no edge leaves, so a run that takes it ends there; the hint names the wiring. Not reported for a branch the stored workflow already leaves unwired. |
| `E_UNKNOWN_BUILDER` | A builder path the catalog does not have, a bare builder-shaped call (`apii('Name', …)`) nothing binds, or a namespace the SDK lacks or the file did not import; `hint` names the builder a common other name stands for (`http.request` → `api`), then prefers a synonymous verb (`postMessage` → `sendMessage`), then the closest path, then the namespace's builders. |
| `E_UNKNOWN_PARAM` | A param the block does not have; the hint has a did-you-mean, or for block meta written there (`retry`, `disabled`, `locked`, `errorPort`) the third argument that takes it. |
| `E_FIXED_PARAM` | A param the builder already pins. |
| `W_FIELD_NOT_APPLICABLE` | A param not visible under the block's values; apply keeps the stored value and the written-back source drops it. |
| `W_REQUIRED_MISSING` | A required field left empty, including `todo()`; not repeated for a field an `E_UNKNOWN_PARAM` did-you-mean names, or one written with a value that failed to compile. |
| `W_UNKNOWN_OPTION` | A dropdown value none of its options names; `hint` lists them. |
| `E_UNKNOWN_OPERATION` | An `operation` the block does not offer; `hint` lists them. A retired one the stored block holds is `W_UNKNOWN_OPTION`. |
| `W_UNKNOWN_MODEL` | A `model` the catalog does not list (kept: custom models are free text). |
| `W_LEGACY_BLOCK_TYPE` | A new block of a legacy or deprecated type; `hint` names the replacement's builders. |
| `I_SCHEDULE_UTC` | A schedule created from source with no `timezone`, which runs in UTC (the editor would have seeded the viewer's zone). |
| `E_STORED_VALUE_MISSING` | `stored()` where the stored workflow holds no value. |
| `W_VALUE_KIND` | A value whose JSON type differs from the field's. |
| `W_OUT_OF_RANGE` | A literal slider value outside the catalog `min`/`max`, off its `step`, or fractional where it takes whole numbers; kept as written, and the executor forwards it unclamped. |
| `W_TABLE_FILTER_SHAPE` | A literal table filter the runtime refuses: the legacy `$` operator grammar, or predicate and builder rows mixed. |
| `W_LITERAL_SECRET` | A password field (an API key, a token) holding literal text instead of an env reference, or any field holding a detected credential (a token format, an `Authorization` header, a credential-named property or query parameter); get prints it as `stored()`. For a literal token in a credential field, the hint says `credential('<key>')`. |
| `W_SUBFLOW_COUNT` | A loop or parallel count, or a parallel batch size, the runtime replaces or clamps. |
| `W_UNKNOWN_OUTPUT_PATH` | A ref path the block's outputs do not have; the hint has a did-you-mean or lists the outputs. |
| `W_OUTPUT_PATH_UNDECLARED` | A path the block does not declare that the run still accepts: an undeclared `inputFormat` input, or `x.error` with no error edge. Never refused. |
| `W_JSON_REF_UNTYPED` | A bare ref in a JSON literal whose type nothing declares. |
| `W_LOOP_CONDITION_SYNTAX` | A while or do-while condition that is not a JavaScript expression once each reference stands in as a value, as the run evaluates it (`return Boolean(<condition>)`): the run fails there. Refused as `E_APPLY_LOOP_CONDITION_SYNTAX` on a loop the edit added or changed. A loop reading its own `index` (or `currentItem`, `items`) by its name in its condition is `W_REF_OUT_OF_SCOPE`: the condition is evaluated outside the loop's body, so only `<loop.index>` reads the iteration there. |
| `W_REF_OUT_OF_SCOPE` | A loop or parallel iteration field (`index`, `currentItem`, `items`) read from a block outside that container: `lp.index` after the loop, `$ref.loop.index` or `<loop.index>` in a block in no loop. The run fails (or reads nothing) there. Refused as `E_APPLY_REF_OUT_OF_SCOPE` on a block the edit changed. |
| `W_UNKNOWN_BLOCK_TYPE` | A new block of a type the catalog does not hold; refused as `E_APPLY_INVALID_BLOCK_TYPE`. A block the stored workflow or the lock already holds keeps its type quietly. |
| `W_TYPE_NOT_ADDABLE` | A new block of a type the catalog keeps only for blocks already using it; refused as `E_APPLY_TYPE_NOT_ADDABLE`. |
| `E_CODE_FILE_MISSING` | `codeFile()` names a file the request did not send. |
| `E_CODE_FILE_PATH` | A code file path outside the directory, or with the wrong extension. |
| `W_CODE_FILE_INLINED` | Print: the code could not round-trip through a file and was inlined. |
| `W_CODE_FILE_REF_SYNTAX` | `$ref.key.path` or `$env.NAME` in a Python or shell code file, which runs as text; the hint names the `<key.path>` or `{{NAME}}` form. Refused as `E_APPLY_CODE_FILE_REF_SYNTAX` in a file the edit changed. |
| `W_CODE_FILE_REF_QUOTED` | A `<key.path>` tag between quotes of its own in a Python code file (`"<start.country>"`): the run substitutes it as a Python literal, so a string value arrives with its quotes in it. Remove the quotes. A file's path (`open('<start.file.path>')`), spliced raw, is not reported. |
| `W_UNRESOLVED_REF` | Print: a stored `<x.y>` token that resolves to nothing. Compile: a code file `$ref` chain that does. Either is kept as text. |
| `W_FORWARD_REF_LITERALIZED` | Print: a ref in a cycle printed as text. |
| `W_COMMENT_MOVED` | A comment hoisted to the nearest anchor. |
| `W_COMMENT_DROPPED` | A comment whose block no longer exists. |

#### Lock and source meta \[#lock-and-source-meta]

Reading `.sim/lock.json`. Each finding names a JSON `path`.

| Code | Meaning |
| - | - |
| `E_LOCK_JSON`, `E_SOURCE_META_JSON` | Not valid JSON. |
| `E_LOCK_VERSION`, `E_SOURCE_META_VERSION` | `version` missing or not `1`. |
| `E_LOCK_SHAPE`, `E_SOURCE_META_SHAPE` | A required field missing or of the wrong type or format. |
| `E_LOCK_UNKNOWN_FIELD`, `E_SOURCE_META_UNKNOWN_FIELD` | A field the schema does not define (`x-` keys are allowed). |
| `E_LOCK_KEY` | A block or variable key not in normalized form. |
| `E_LOCK_IDENT`, `E_SOURCE_META_IDENT` | An ident that is not a JS identifier, or is reserved. |
| `E_LOCK_DUPLICATE_IDENT`, `E_SOURCE_META_DUPLICATE_IDENT` | Two blocks with one ident. |
| `E_LOCK_DUPLICATE_ID` | One block, variable or branch id under two keys. |
| `E_LOCK_PARENT` | A parent naming no block, itself, or forming a cycle. |
| `E_LOCK_BRANCH` | A branch key that is not a JS identifier. |
| `E_LOCK_CODE_FILE_PATH` | A `codeFile` that is absolute, escapes the directory, or uses backslashes. |
| `E_SOURCE_META_ANCHOR` | A comment key that is not a valid anchor. |

#### Canonicalize \[#canonicalize]

Reading the stored workflow in a get.

| Code | Meaning |
| - | - |
| `E_CANON_LEGACY_NAME_COLLISION` | Two stored names normalize alike; the loser is keyed `key~n`. |
| `E_CANON_EDGE_SCOPE` | A stored edge crosses subflow scopes. |
| `W_CANON_RESERVED_NAME` | A stored name normalizes to a reserved key. |
| `W_CANON_DANGLING_EDGE` | A stored edge to a missing block; dropped. |
| `W_CANON_DANGLING_PARENT` | A parent that does not exist; the block is placed at the root and the raw parent kept. |
| `W_CANON_RAW_HANDLE` | An unknown edge handle, kept as a raw port. |
| `W_CANON_UNKNOWN_BLOCK_TYPE` | A type the catalog does not have; params kept. |
| `W_CANON_UNRESOLVED_ID` | A resource id with no key; kept verbatim. |
| `W_CANON_TITLE_OVERRIDE` | A branch title that differs from its positional title. |
| `W_CANON_SUBFLOW_REPAIRED` | A loop or parallel config the loader would repair. |
| `W_CANON_SUBBLOCK_TYPE_DRIFT` | A stored subBlock type differs from the catalog's. |
| `W_CANON_UNDECODABLE_JSON` | A stored JSON-text field that does not parse, kept as text; or a branch list that is not rows with distinct ids, kept verbatim. |

#### Materialize \[#materialize]

Matching the compiled file to the stored blocks.

| Code | Meaning |
| - | - |
| `E_MAT_DUPLICATE_LOCK_ID` | Two lock keys carry one block id. |
| `E_MAT_UNKNOWN_RESOURCE` | A resource key with no live resource in this workspace. |
| `E_MAT_UNKNOWN_VARIABLE` | A `vars.x` reference to a variable the workflow does not declare. |
| `W_MAT_DELETED_SINCE_PULL` | A lock entry whose block was deleted since the read; re-created. |
| `W_MAT_INFERRED_RENAME` | A rename inferred from type, parent and edges (the key and the ident both changed). |
| `W_MAT_RETYPE_RECREATED` | A key kept with a new type: delete plus create, so webhook URLs and schedules change. |
| `W_MAT_LOCK_ID_CLAIMED` | A lock id another workflow holds, ignored: the block binds to the stored block it matches, or gets a new id. |
| `I_MAT_NEEDS_LAYOUT` | A new block with no position, or one moved into or out of a loop or parallel; placed by autolayout. |

#### Apply \[#apply]

Saving the workflow draft.

| Code | Meaning |
| - | - |
| `E_APPLY_STALE` | The workflow changed since the source was read (HTTP 409). |
| `E_APPLY_WORKFLOW_MISMATCH` | `base.workflowId` names another workflow (HTTP 400). |
| `E_APPLY_LOCKED_BLOCK` | The change touches a locked block or a child of a locked container. |
| `E_APPLY_TYPE_NOT_ADDABLE` | A new block of a type that may stay but not be added. |
| `E_APPLY_INVALID_STATE` | The resulting graph fails validation. |
| `E_APPLY_BLOCK_NOT_FOUND`, `E_APPLY_INVALID_BLOCK_TYPE` | A block or type the engine cannot place. |
| `E_APPLY_BLOCK_NOT_ALLOWED`, `E_APPLY_MODEL_NOT_ALLOWED`, `E_APPLY_TOOL_NOT_ALLOWED` | Refused by the workspace's permission group. |
| `E_APPLY_INVALID_EDGE_SOURCE`, `E_APPLY_INVALID_EDGE_SCOPE`, `E_APPLY_INVALID_SOURCE_HANDLE`, `E_APPLY_INVALID_TARGET_HANDLE` | An edge the engine refuses. |
| `E_APPLY_INVALID_SUBBLOCK_FIELD`, `E_APPLY_MISSING_REQUIRED_PARAMS` | A field the engine refuses, or required params missing. |
| `E_APPLY_RETRY_NOT_SUPPORTED` | A new or changed retry policy on a block that always runs once (triggers, human-in-the-loop, containers). |
| `E_APPLY_DUPLICATE_TRIGGER`, `E_APPLY_DUPLICATE_SINGLE_INSTANCE_BLOCK` | A second trigger or single-instance block. |
| `E_APPLY_DISABLED_ANCESTOR` | An enabled block inside a disabled container. |
| `E_APPLY_CREDENTIAL_UNREACHABLE` | A credential the acting user cannot use. |
| `W_APPLY_CREDENTIAL_KEPT` | A credential key the caller cannot resolve stands where the workflow stores a credential the caller cannot see; the stored one is kept, whatever the key. |
| `E_APPLY_SANDBOX_PLAN_REQUIRED` | The sandbox needs a plan the workspace does not have. |
| `W_APPLY_HOSTED_KEY_DROPPED` | A hosted key that does not apply was cleared. |
| `W_APPLY_VALUE_NORMALIZED` | Validation rewrote a value; the returned files show it. |
| `W_APPLY_TYPE_CHANGED` | A block's type changed; its id, webhook URL and schedules are replaced. |
| `W_APPLY_TRIGGER_REMOVED` | A deleted or retyped block still serves a live webhook, schedule, chat output or MCP tool until the next deploy. |
| `W_APPLY_CATALOG_MOVED` | Compile failed and the block catalog changed since the read: get the source again. |
| `E_APPLY_LINT`, `W_APPLY_LINT` | A workflow lint finding, mapped to a source line. |
| `E_APPLY_UNRESOLVED_REF` | A `$ref` naming no block or variable, or a path no output has, in code or a block the edit changed (`W_UNRESOLVED_REF`, `W_UNKNOWN_OUTPUT_PATH` elsewhere). |
| `E_APPLY_REF_OUT_OF_SCOPE` | A `W_REF_OUT_OF_SCOPE` iteration reference on a block the edit added, changed or moved. |
| `E_APPLY_CODE_FILE_REF_SYNTAX` | A `W_CODE_FILE_REF_SYNTAX` in a code file the edit changed. |
| `E_APPLY_LOOP_CONDITION_SYNTAX` | A `W_LOOP_CONDITION_SYNTAX` on a loop the edit added or changed. |
| `E_APPLY_BLOCK_DELETE` | The apply deletes blocks the source no longer declares; pass `--allow-delete`. When it also adds blocks of a deleted one's type, it names them as possible renames and says how to keep the ids. |
| `E_APPLY_VARIABLE_DELETE` | The apply removes workflow variables the source no longer declares; pass `--allow-delete`, as for blocks. |
| `W_APPLY_PROBABLE_RENAME` | With `--allow-delete`, a deleted block and an added one share a type and parent: a probable rename that gets a new id. |
| `E_NAME_TAKEN` | The `workflow('…')` name renames the workflow to one another workflow in its folder holds. |
| `E_WORKFLOW_META_INVALID` | The `workflow('…')` name is empty or over 255 characters, or its description is over 50,000 characters: limits the workflow API holds every workflow to. |
| `E_APPLY_INVALID_SCHEDULE` | An added or changed schedule whose cron, timezone or interval deploy would refuse. |
| `W_TABLE_UNKNOWN_COLUMN` | A table row write whose data names a key that is not a column of the table; the run drops it. The hint names the nearest column. |

#### Type check \[#type-check]

`sim workflows source check` and `sim workspaces source check` type-checking the directory with TypeScript after the compile. The server never reports these.

| Code | Meaning |
| - | - |
| `E_TYPE` | TypeScript (the release the declarations are built for) reported an error; the message starts with its `TS` code. A type error is left out on a line the compile already reports an error on, and in a file still as the last get or apply wrote it when that file had the same error then (against the declarations as that get or apply left them). |
| `W_TYPES_UNCHECKED` | The type check did not run: TypeScript could not be installed (offline, or no `npm`) or did not start. The other findings stand; pass `--no-types` to skip it. |

### Workspace source \[#workspace-source]

Workspace source reports every workflow code above for the files of `workflows/<key>/`, with that path as the file, and these codes for the rest of the directory.

#### Declaration files and the directory layout \[#declaration-files-and-the-directory-layout]

| Code | Meaning |
| - | - |
| `E_DECL_SYNTAX` | A Babel parse error, re-coded. |
| `E_DECL_HEADER` | The first line is not `// @sim-sdk 1`. |
| `E_DECL_IMPORT` | An import from anything but `@sim/workflow-sdk/workspace`, or a non-named import. |
| `E_DECL_EXPORT` | Not exactly one `export default defineX({ … })` with the kind's `defineX`. |
| `E_DECL_UNSUPPORTED` | A construct outside the declaration grammar: JSON literals, the kind's helper calls. |
| `E_DECL_DUPLICATE_KEY` | An object key declared twice. |
| `E_DECL_SHAPE` | A required field is missing, or a field has the wrong type. |
| `E_DECL_UNKNOWN_FIELD` | A field the kind does not define. |
| `E_DECL_UNKNOWN_FILE` | A path inside a kind's folder that no resource owns. |
| `W_PATH_NOT_SENT` | A file under a kind's folder whose path no workspace holds (a hidden name such as `.env`, or a character such as `:` or `?`): the CLI does not send it, so an apply neither writes nor deletes anything for it. |
| `E_BLOB_MANIFEST` | A blob manifest entry listed twice, or at a path that holds no binary file: the apply writes nothing. |
| `E_BLOB_MISSING` | A binary file a write needs whose bytes are not staged (or were staged at another size): the apply writes nothing. Stage it, then apply again. |
| `E_KEY_INVALID` | A resource key outside `^[a-z][a-z0-9_-]{0,63}$`. |
| `W_DECL_SUSPICIOUS_CHARACTER` | A resource name, a skill name, a workspace file path or a knowledge document name holds a bidi control or zero-width character, so it reads differently from what it stores. The workflow-file counterpart is `W_SUSPICIOUS_CHARACTER`. |

#### `.sim/base.json` \[#simbasejson]

| Code | Meaning |
| - | - |
| `E_BASE_JSON` | The base is not valid JSON. |
| `E_BASE_VERSION` | `version` is missing or not `1`. |
| `E_BASE_SHAPE` | A required field is missing or of the wrong type or format. |
| `E_BASE_UNKNOWN_FIELD` | A field the base does not define (`x-` keys are allowed). |

#### Secrets (`secrets.ts`) \[#secrets-secretsts]

| Code | Meaning |
| - | - |
| `E_SECRET_NAME` | A declared name outside the secret name format. |
| `E_SECRET_MISSING` | A workflow uses a declared secret the workspace holds no value for: it is held back. |
| `W_SECRET_MISSING` | A declared secret the workspace holds no value for. |

#### Credentials (`credentials.ts`) \[#credentials-credentialsts]

| Code | Meaning |
| - | - |
| `E_CREDENTIAL_MISSING` | A workflow uses a declared key no credential of its provider binds to: it is held back. |
| `E_CREDENTIAL_AMBIGUOUS` | A workflow uses a declared key several credentials could bind to: it is held back. |
| `W_CREDENTIAL_MISSING` | A declared key no credential of its provider binds to. |
| `W_CREDENTIAL_AMBIGUOUS` | A declared key several credentials could bind to. |

#### Tables \[#tables]

| Code | Meaning |
| - | - |
| `E_TABLE_COLUMN_NAME` | A column key or name outside the table name pattern. |
| `E_TABLE_DUPLICATE_COLUMN` | Two columns resolve to one name. |
| `E_TABLE_TOO_MANY_COLUMNS` | More columns than a table may hold: a size limit, classed like `E_LIMIT_EXCEEDED`. |
| `E_TABLE_OPTIONS` | A select column without options, an option declared twice, or options on another type. |
| `E_TABLE_TYPE_CONVERSION` | A type change the stored cells cannot convert to. |
| `E_TABLE_FOLDER` | A table folder that does not exist in the workspace. |
| `E_TABLE_ROWS` | The declaration's `rows` or its `tables/<key>.rows.jsonl`: a bad mode or key column, a line that is not a row of declared columns, a managed row without its key or repeating one. |
| `I_TABLE_SEED_SKIPPED` | Seed rows declared for a table that already holds rows: only a new or empty table is seeded. |
| `I_TABLE_ROWS_UNKEYED` | Managed rows whose key cell is empty (a row the table's "add row" made and nobody keyed): no file line can name them, so a get leaves them out and an apply keeps them as they are. |
| `W_LIKELY_RENAME` | A column dropped and one of the same type added: probably a rename, which loses the cells. |

#### Custom tools \[#custom-tools]

| Code | Meaning |
| - | - |
| `E_TOOL_SCHEMA` | The schema is not a function declaration a custom tool may store. |
| `E_TOOL_CODE` | `code` is not `codeFile('./<key>.js')`, a string or `stored()`, or its code file is missing or does not parse. |
| `E_TOOL_STORED_MISSING` | `code: stored()` for a tool the server holds no code of (none stored under the key or title). |
| `W_TOOL_LITERAL_SECRET` | The code holds what looks like a literal credential (`holdsSecret`, as for function code): a get prints it as `stored()`, and code a directory writes with one applies with this warning. |

#### Skills \[#skills]

| Code | Meaning |
| - | - |
| `E_SKILL_FRONTMATTER` | `skills/<key>.md` does not open with a frontmatter block of `name` and `description`. |

#### MCP servers \[#mcp-servers]

| Code | Meaning |
| - | - |
| `E_MCP_LITERAL_SECRET` | A credential header (`Authorization`, `X-Api-Key`, …) holds literal text, not an env reference. |
| `E_MCP_STORED_MISSING` | `stored()` names a header the stored server holds no value for. |
| `E_MCP_TOOL_UNKNOWN` | A workflow names a tool the MCP server does not list. |
| `W_MCP_REPLACE` | A changed URL replaces the server: a new server id, the old one deleted. |
| `W_MCP_TOOLS_UNCHECKED` | The server's tools could not be listed, so the tool names workflows use are not checked. |

#### Workspace files \[#workspace-files]

| Code | Meaning |
| - | - |
| `E_FILE_PATH` | A path no workspace file may have: a dot or empty segment, a reserved name or character. |
| `E_FILE_PATH_COLLISION` | Two paths that differ only in letter case, or a path that is both a file and a folder. |
| `E_FILE_NAME` | A name the server would store differently (trimmed, whitespace collapsed, NFC). |
| `E_FILE_TOO_LARGE` | A file over the per-blob cap: a get skips it and an apply never writes it. |
| `E_FILE_CONTENT` | A workspace file sent as text, or listed without a valid SHA-256 and size. |

#### Knowledge bases \[#knowledge-bases]

| Code | Meaning |
| - | - |
| `E_KB_EMBEDDING_IMMUTABLE` | A declared embedding model that differs from the stored one: it is fixed at creation. |
| `E_KB_EMBEDDING_MODEL` | A new knowledge base declares a model this server does not create knowledge bases with. |
| `E_KB_DOC_AMBIGUOUS` | The server holds several documents under one declared file name. |
| `E_KB_DOC_NAME` | A document file name or type the knowledge base cannot hold. |
| `E_KB_DOC_EMPTY` | An empty document, which a knowledge base cannot index. |
| `E_KB_CHUNKING` | Chunking settings outside what a knowledge base accepts. |
| `E_KB_FOLDER` | A knowledge base folder that does not exist in the workspace. |
| `W_KB_DOC_UNCHECKED` | A stored document whose bytes this request had no budget left to download and compare. |
| `W_KB_DOC_FAILED` | Documents whose indexing failed: search does not find them until they are indexed again. |
| `I_KB_REEMBED` | How many documents the apply indexes (embeds) after it writes them. |
| `I_KB_CHUNKING` | Changed chunking applies to documents indexed from now on; stored ones keep their chunks. |
| `I_KB_PROCESSING` | Documents still waiting to be indexed or being indexed: search finds them once that ends. |
| `I_KB_DOCS_UNHASHED` | Documents a get lists without a hash: it had no budget left to download them. |
| `I_KB_UNMANAGED_DOCS` | Documents source leaves alone: connector-synced, too large, or not a plain file name. |
| `I_KB_REPLACE_UNFINISHED` | A replace that stopped partway left a replacement document (under its upload name): the next apply that changes the knowledge base finishes the replace, or removes the replacement. |

#### Deployments \[#deployments]

| Code | Meaning |
| - | - |
| `E_DEPLOY_WORKFLOW` | `deployments/<key>.ts` names no workflow this workspace holds or this directory declares. |
| `E_DEPLOY_SECRET` | A chat password written as a value instead of `env.NAME`, an unset variable, or `stored()` where no password is stored. |
| `E_DEPLOY_CHAT_OUTPUT` | A chat output names a block the workflow does not have. |
| `E_DEPLOY_CHAT_IDENTIFIER` | A chat identifier another live chat already holds. |
| `E_DEPLOY_PINNED_CHAT` | A chat change on a pinned deployment whose draft differs: deploying a chat publishes it. |
| `W_DEPLOYED_DRAFT_CHANGED` | An apply edits a deployed workflow that no `live: 'draft'` deployment republishes. |
| `W_DEPLOY_DRAFT_NOT_SOURCE` | A `live: 'draft'` deployment whose draft holds edits the directory does not declare (made in the editor, say): the apply does not publish it. |
| `E_DEPLOY_DRAFT_NOT_SOURCE_CHAT` | A chat change while the draft holds edits the directory does not: deploying a chat publishes it. |
| `I_DEPLOY_DRAFT_NOT_LIVE` | A pinned deployment's draft differs from its live version, which keeps running. |

#### Plan and apply \[#plan-and-apply]

| Code | Meaning |
| - | - |
| `E_APPLY_NO_BASE` | The server holds the resource but the directory has no base for it: get it first. |
| `E_APPLY_FORBIDDEN` | The caller may not make this change. |
| `E_APPLY_DELETE_NOT_ALLOWED` | The change deletes a resource or data and `--allow-delete` was not given. |
| `E_APPLY_LOCKED` | The resource is locked against this change (HTTP 423). |
| `E_APPLY_REFUSED` | A change a child operation refused, with its message. |
| `E_APPLY_FAILED` | A write failed for a reason that is not the source's (logged on the server). |
| `E_PLAN_TOO_LARGE` | The apply would make more changes or touch more workflows than one request may. |
| `E_PLAN_REF_DELETED` | A declared resource references one this apply deletes. |
| `E_PLAN_REF_HELD` | A declared resource references one this apply holds back, so it is held back too. |
| `W_RESOURCE_IN_USE` | A resource this apply deletes is still used by stored workflows. |
| `W_TABLE_COLUMN_RENAMED_IN_USE` | A table column this apply renames is still written, filtered or sorted by its old name in a stored workflow's Table block, which the run then drops. |
| `E_WORKFLOW_FILES_MISSING` | A workflow folder sent without its files whose base names no workflow of this workspace. |
| `E_WORKFLOW_FOLDER_COPIED` | A workflow folder holding the base of another declared folder's workflow: a copy. |
| `W_UNDECLARED` | A resource the server holds that the directory does not declare (kept without `--allow-delete`). |
| `W_BASE_OTHER_WORKSPACE` | The directory's base was read from another workspace: every resource is created anew. |
| `W_PROMOTE_TARGET_DELETED` | A promotion (`apply --to`) keeps deleted a resource the directory declares that the target deleted since the last promotion: the target no longer holds it. |
| `W_PROMOTE_DELETES_TARGET_ONLY` | A promotion with `--allow-delete` deletes a resource only the target holds (the directory does not declare it). |
| `W_SERVER_CHANGED` | The server changed a resource the directory leaves alone; the apply keeps it. |
| `W_SERVER_DELETED` | The server deleted a resource the directory leaves as it was; it is not created again. |
| `W_SERVER_MOVED` | The server moved a resource the directory leaves as it was; it is not created again. |
| `I_KEY_REBOUND` | A key bound to a deleted resource was bound to the one this apply wrote. |
| `E_KEY_RENAMED` | A declaration under a new key for a resource the base read under another: keys never move. |

#### Shared with workflow source \[#shared-with-workflow-source]

A workspace finding with the same meaning as a workflow finding uses its code.

| Code | Meaning |
| - | - |
| `E_APPLY_STALE` | The workflow changed since the source was read (HTTP 409). |
| `E_LIMIT_EXCEEDED` | Over the block, edge, total-byte, depth or `codeFile()` reference cap (`SOURCE_LIMITS`). Apply answers 413. |
| `E_NAME_TAKEN` | The `workflow('…')` name renames the workflow to one another workflow in its folder holds. |
| `I_FINDINGS_TRUNCATED` | 100 warnings, or 20 of one code, were listed and the rest omitted, so a flood of one finding never hides another. A finding repeated at the same place is listed once. Infos are capped apart (100, the rest dropped), so they never displace a warning, and errors are never displaced by either. An answer that merges findings from several stages is capped the same way as a whole; when that cuts it, it ends in one `I_FINDINGS_TRUNCATED` counting what it left out, in place of the stages' own. |

## Related docs \[#related-docs]

- [File syntax](/workflows/code/syntax)
- [Exit codes](/workflows/code/exit-codes)
- [Limits](/workflows/code/limits)
