Diagnostics and exit behavior
Authoring errors provide:
TypeScript
type WomlDiagnostic = {
code: string;
phase: "parse" | "validation" | "compile" | "runtime";
message: string;
file: string;
location: {
start: { line: number; column: number; offset: number };
end?: { line: number; column: number; offset: number };
};
hint?: string;
};Line/column are one-based; byte offset is zero-based. Locations point into the original .woml, including translated script locations when available. Diagnostics may include several sorted errors, with one primary diagnostic.
Representative codes:
| Code | Meaning |
|---|---|
WOML_UNKNOWN_ELEMENT, WOML_UNKNOWN_ATTRIBUTE | Unsupported or misplaced syntax. |
WOML_DUPLICATE_ID | Structural identity collision. |
WOML_INVALID_REFERENCE, WOML_UNKNOWN_REFERENCE | Malformed or unknown declarative reference. |
WOML_REFERENCE_NOT_DOMINATING | Output is not guaranteed before the consumer. |
WOML_REFERENCE_NOT_AVAILABLE | Runtime nested property is missing. |
WOML_BRANCH_TEST_NOT_BOOLEAN | <when> resolved to a non-boolean. |
WOML_SWITCH_VALUE_INVALID | Switch input is not a string. |
WOML_TRIGGER_SCHEMA_INVALID | Ingress payload failed its JSON Schema. |
WOML_TRIGGER_IDEMPOTENCY_CONFLICT | Same occurrence ID reused with different data. |
WOML_POLICY_QUEUE_FULL | Durable policy queue reached capacity. |
WOML_WORKFLOW_TIMED_OUT | Total workflow deadline won. |
WOML_WORKFLOW_TARGET_NOT_FOUND | Called/started workflow is not actively owned. |
WOML_WORKFLOW_CALL_CYCLE | Call lineage would cycle. |
WOML_WORKFLOW_CALL_WAIT_UNSUPPORTED | Synchronous call target contains approval. |
A non-zero CLI exit means the requested finite operation failed. Long-lived run, inspect, and log-follow commands normally end through Ctrl+C or an explicit stop.