Operational command interfaces
Operational command interfaces are the binaries and command trees used to run, inspect, configure, migrate, and test a Hatchet deployment. Client commands use saved connection profiles to call the public service boundary. Server commands use deployment configuration to compose data, security, queue, and runtime services. See the API and access layer, public API contracts, authorization and tenancy, database schema and migrations, and repositories, messaging, and configuration pages for related system boundaries.
Command interface model
Entry-point roles
Each entrypoint has a narrow operational role. The API and engine run the platform. The CLI gives operators, scripts, and agents access to it. Other commands prepare deployments, change the schema, serve the dashboard, or measure platform behavior.
| Interface | Operational purpose |
|---|---|
hatchet | Manage profiles, local servers, workflows, runs, workers, triggers, dashboards, terminal views, and agent access. |
hatchet-admin | Prepare and administer an instance, including setup, credentials, seed data, and Kubernetes resources. |
hatchet-api | Start the HTTP API from server configuration. |
hatchet-engine | Start the workflow runtime, selected internal services, and optional in-process operators. |
hatchet-serverless-operator | Run the serverless operator as a separate process that delivers tasks to serverless endpoints. |
hatchet-lite | Run the API, engine, dashboard server, and routing proxy in one process. |
hatchet-migrate | Apply or roll back PostgreSQL schema changes on the primary database and an optional OLAP database. |
hatchet-loadtest | Generate workflow traffic and report execution timing and result checks. |
hatchet-staticfileserver | Serve dashboard assets as a separate HTTP service. |
References: cmd/…/root.go• L18-47 cmd/…/tui.go• L22-91 cmd/…/root.go• L17-61 cmd/…/main.go• L20-42 cmd/…/main.go• L22-51 cmd/…/main.go• L107-137 cmd/…/main.go• L28-50 cmd/…/main.go• L17-81 cmd/…/main.go• L62-131 cmd/…/main.go• L16-53
Shared service composition
Server commands use a shared configuration loader as the boundary between operator input and running services. The loader creates the common data and service layer, then the API or engine starts the parts required by its role. Administrative commands can request a smaller service set for short-lived work such as token creation or data seeding. The separate serverless-operator command uses its own configuration path to compose the repository, encryption, token exchange, safe request sender, and operator host that it needs.
This model keeps tenant, persistence, security, queue, and telemetry settings aligned across deployment shapes. It also lets the API and engine run as separate processes or as parts of the lightweight runtime without changing their configuration contract. Engine startup also announces new workflow versions so other engine processes can refresh their event-key view.
This diagram shows how an operational command turns configuration into a service or a short-lived operation.
flowchart TD
A[Operational command] --> B[Shared or role configuration]
B --> C[Database and repositories]
B --> D[Runtime services]
C --> E[Admin or migration action]
D --> F[HTTP API]
D --> G[Workflow engine]
B --> H[Client profile]
H --> I[Public API and gRPC services]
References: pkg/…/loader.go• L62-79 pkg/…/loader.go• L99-125 pkg/…/loader.go• L436-465 cmd/…/run.go• L41-79 cmd/…/run.go• L87-171 cmd/…/token.go• L70-110 cmd/…/seed.go• L53-83 cmd/…/main.go• L29-104
Configuration boundaries
Server commands read a configuration directory and can take values from the environment. The CLI keeps a separate local configuration with general settings and named profiles. A profile binds a tenant to credentials, API and gRPC endpoints, and a TLS strategy.
When the CLI creates a profile from a token, it checks the token's server and tenant before saving the connection. It can probe the gRPC endpoint for TLS, but it does not trust a plaintext result by itself. If TLS is not confirmed, it asks the operator before allowing a profile that could send the token in cleartext.
Normal CLI connections can fill missing endpoint data from the token. MCP connections use the granted profile as the authority and do not accept HATCHET_CLIENT_* overrides. This keeps an agent's permission grant tied to the deployment it was meant to reach.
References: pkg/…/loader.go• L62-79 pkg/…/config.go• L9-43 pkg/…/config.go• L56-67 cmd/…/init.go• L21-96 cmd/…/client.go• L21-63 cmd/…/client.go• L66-163 cmd/…/profile.go• L600-740
User-facing CLI
Command startup and output
The hatchet root command prepares shared CLI behavior before it runs a subcommand. It reports telemetry and update information for normal commands, while quiet commands keep stdout and stderr suitable for shell use.
Before execution, it moves profile tokens from the profile file to the local keyring when possible. If the keyring is not available, it warns the operator instead of silently changing the credential store. This makes credential migration part of normal CLI use without adding output to commands whose output is consumed by a shell.
References: cmd/…/root.go• L37-85 cmd/…/profile.go• L216-250
Profile-based access
The hatchet CLI treats a profile as the connection context for a command. It selects a saved default when possible and prompts when the operator must choose among profiles. The same profile scope applies to workflow views, run actions, and worker listings.
Profile management also provides a safe shell boundary. profile env emits quoted connection variables for command substitution and emits both API variable names used by the SDKs. It clears old optional values when a profile changes. When run directly in a terminal, it prints usage guidance instead of printing the credential block on screen. The profile can keep its token in the keyring or report when it remains in the profile file.
This keeps tenant selection and transport setup in one place. Feature commands can focus on the requested operation instead of rebuilding access state for each request.
References: cmd/…/profile.go• L31-71 cmd/…/profile.go• L73-130 cmd/…/profile.go• L216-333 cmd/…/profile.go• L600-740 cmd/…/profile.go• L822-881 cmd/…/client.go• L177-207 cmd/…/worker.go• L81-100
Resource and run operations
The CLI turns requests for workflows, runs, workers, and triggers into tenant-scoped API calls. It supports interactive views and JSON output for automation. Run operations include inspection, logs, events, child runs, cancellation, and replay.
Run listing and bulk actions share time, workflow, and status filters. Logs can be printed as JSON or text, limited to recent lines, or followed as new lines arrive. Child and event commands detect whether an ID names a task or a DAG run so operators can use one command shape for both run types.
Bulk destructive actions require a time filter and normally require confirmation. Non-interactive mode keeps the same actions usable in controlled scripts.
References: cmd/…/workflows.go• L13-69 cmd/…/runs.go• L28-129 cmd/…/runs.go• L178-400 cmd/…/runs.go• L403-629 cmd/…/runs.go• L632-819
Terminal operations
The hatchet tui command provides an interactive terminal view over a selected profile. It starts with run inspection and lets an operator move among runs, workflows, workers, rate limits, scheduled runs, cron jobs, and webhooks.
The run view keeps filters for workflow, time range, and status. It refreshes task rows and status counts while the session runs. Operators can open a selected run, move through pages, inspect event severity, and view a DAG whose nodes show task status and dependency paths.
The TUI keeps the selected client as shared view context. An operator can switch profiles in the session, open detail views, return through the view stack, or start at a supplied run ID. A short warning remains visible when a profile token is stored in plain text.
References: cmd/…/tui.go• L22-91 cmd/…/tui.go• L113-179 cmd/…/tui.go• L289-444 cmd/…/tui.go• L474-600 cmd/…/tui.go• L741-823 cmd/…/runs_list.go• L62-131 cmd/…/runs_list.go• L179-328 cmd/…/runs_list_filters.go• L18-145 cmd/…/events_util.go• L13-109 cmd/…/status.go• L20-61 cmd/…/canvas.go• L131-219 cmd/…/renderer_test.go• L24-91
Local development workflows
The CLI can start and stop a local Hatchet environment through Docker. Starting it creates a connection profile and makes it the default when no default exists, which lets later commands use the local instance without separate connection setup.
The local command can select ports, an image tag, a pull policy, a project name, and a development image with authentication disabled. Worker development combines the selected profile with project settings from hatchet.yaml. Those settings define the local command, pre-commands, watched files, and reload behavior. The same command tree can inspect remote workers without a local worker project.
References: cmd/…/server.go• L20-103 cmd/…/server.go• L151-204 cmd/…/worker.go• L26-79 cmd/…/worker.go• L202-276
Workflow triggers
The trigger command supports a project path and a service path. A project trigger runs a local command from hatchet.yaml. A manual trigger sends JSON input to a named workflow through the selected profile and returns a run ID.
The manual path supports interactive input and file-based JSON. A successful trigger can open the resulting run for inspection, connecting an operational write to its later read path.
References: cmd/…/trigger.go• L38-175 cmd/…/trigger.go• L231-315 cmd/…/trigger.go• L402-484 cmd/…/trigger.go• L607-645
Embedded dashboard access
The hatchet embedded-ui command serves the dashboard bundled in the CLI for an embedded instance. It checks that the target is an embedded Hatchet API, proxies API requests, signs the dashboard in with the seeded or supplied admin credentials, and opens a short-lived local URL.
The local server protects the browser session with a random URL token that becomes a cookie. It also checks the request host and the origin of unsafe browser requests, and it does not forward the proxy token to the upstream API. The command can use the default embedded address, an explicit API URL, or a saved profile while preserving the target path prefix.
References: cmd/…/embedded_ui.go• L31-123 cmd/…/embedded_ui.go• L125-220 cmd/…/embedded_ui.go• L223-304 cmd/…/embedded_ui.go• L306-400 cmd/…/embedded_ui.go• L471-531 cmd/…/embedded_ui_session.go• L17-85 cmd/…/embedded_ui_session.go• L154-215
Agent integrations
The CLI installs reference material for coding agents and configures a local MCP server. The MCP server exposes workflow triggers, run inspection, event timelines, worker lists, replay, engine status, and feedback through a stdio boundary.
Each MCP call reads its grant and resolves an allowed profile before it uses the API. A direct loopback check can identify a live embedded instance. A trigger or replay waits for a terminal result by default within a bounded timeout. Replay can either rerun the existing run or start the same workflow with replacement input. Engine status reports only granted profile information, and feedback uses a build-pinned destination rather than a destination chosen by the deployment.
This diagram shows the path from an agent tool call to a tenant-scoped result.
sequenceDiagram
participant Agent
participant MCP as MCP server
participant Grants as Grant store
participant Profiles as Profile store
participant API as Hatchet API
Agent->>MCP: Tool call
MCP->>Grants: Read grant
MCP->>Profiles: Resolve allowed profile
MCP->>API: Send tenant-scoped request
API-->>MCP: Result
MCP-->>Agent: Result
References: cmd/…/skills.go• L26-105 cmd/…/mcp.go• L19-157 cmd/…/grants.go• L119-183 cmd/…/resolve.go• L59-93 cmd/…/server.go• L51-155 cmd/…/server.go• L206-245 cmd/…/server.go• L270-295 cmd/…/server.go• L386-489 cmd/…/tools_test.go• L158-209 cmd/…/tools_test.go• L312-489
Administrative operations
Instance setup
The hatchet-admin command prepares the state needed by a server. Quickstart can create certificates and key material, write database and server configuration, and seed initial data. Operators can skip stages or preserve existing values for partial setup.
The same surface can write server settings and worker credentials to Kubernetes Secrets or ConfigMaps. The Kubernetes quickstart preserves existing key material unless overwrite is requested. Its worker-token command creates a long-lived tenant token from local server configuration and stores it in the selected resource.
The admin command checks the build's security mode before it runs. In a FIPS-enabled build, quickstart cannot create certificates with its bundled OpenSSL step, so operators must provide certificates or skip certificate generation.
References: cmd/…/root.go• L20-44 cmd/…/quickstart.go• L34-123 cmd/…/quickstart.go• L153-216 cmd/…/quickstart.go• L219-271 cmd/…/k8s.go• L31-112 cmd/…/k8s.go• L121-218 cmd/…/k8s.go• L221-310
Identity and key management
Administrative commands create credentials for services and clients. Tokens bind an identity to a tenant and expiry. The token command uses the configured default tenant unless the operator supplies a tenant ID. In an auth-disabled build, it prints the fixed embedded token instead of minting a new token. Keyset commands create local or cloud-backed signing material.
These commands use the same server configuration and encryption rules as the running service. A credential is usable only when its tenant and key settings match the server that validates it.
References: cmd/…/token.go• L25-124 cmd/…/keyset.go• L19-177 pkg/…/loader.go• L1104-1188
Data seeding
Seeding creates the initial user, tenant, and auth state needed by a usable instance. Quickstart runs the standard seed after it writes generated configuration unless the operator skips that stage. Test seeding uses a separate data path and closes its short-lived database layer after the operation.
The Cypress seed also writes the known test users to a generated TypeScript module for browser tests. It finds users by email and tenants by slug, then creates only missing records. It checks each expected tenant membership on every run, removes disallowed memberships, and preserves allowed memberships. This makes repeated test setup converge to the declared user, tenant, and membership model.
When authentication is disabled, seeding checks that the configured default tenant matches the embedded token tenant. It creates the embedded token only when it is missing, so the lightweight access path has a stable credential.
References: cmd/…/seed.go• L15-83 cmd/…/seed.go• L18-150 cmd/…/seed-cypress.go• L41-72 cmd/…/seed-cypress.go• L125-257 cmd/…/seed-cypress.go• L259-366 cmd/…/quickstart.go• L102-116
User account operations
The hatchet-admin user set-password command changes one user's password without exposing the new value as a command argument. It reads the value from standard input, removes the user's active sessions, writes the new password, and removes any session created during the change.
This makes a password reset an access revocation action as well as a credential update. The command requires an email and an explicit standard-input flag so that scripts must choose the input path.
References: cmd/…/user.go• L23-52 cmd/…/user.go• L54-107
Runtime and migration commands
API and engine services
The API command starts the public HTTP service. The engine command starts selected workflow runtime roles from the same server configuration. Both entrypoints enforce the supported security build and apply the process memory limit before they start.
The engine selects its service model from the configured roles. In the current runtime shape, controller, scheduler, and gRPC roles can run as separate units. Task and OLAP controllers can also be paused without removing the rest of the engine. The gRPC role composes dispatch, event ingestion, administrative operations, stream handling, and optional operator and telemetry paths when those features are enabled.
The engine keeps health, telemetry, usage accounting, and service cleanup tied to the process lifecycle. It announces workflow-version changes through the shared message path so other engines invalidate stale event-key workflow lists. On shutdown, it marks dispatchers as draining, stops serverless and claimed operators, closes long-lived streams, flushes usage state, and then closes the gRPC service. This gives work in flight a defined stop path and lets health checks report that the process is leaving service.
References: cmd/…/main.go• L20-42 cmd/…/run.go• L41-79 cmd/…/main.go• L22-51 cmd/…/run.go• L87-185 cmd/…/run.go• L690-916 cmd/…/run.go• L918-1239 cmd/…/operators.go• L20-35 cmd/…/serverless.go• L30-48
Serverless operator service
The hatchet-serverless-operator command runs the serverless operator outside the engine process. It reads dedicated operator configuration, connects to the engine database for leases and endpoints, and reaches the engine's operator service through a gRPC host with per-tenant tokens. This deployment shape separates the operator lifecycle from engine replicas while preserving the same task-delivery role.
The command also applies the shared safety and telemetry boundaries used by the operator service. Its process identity is separate from an engine dispatcher identity, so operators can be scaled and restarted independently.
References: cmd/…/main.go• L1-3 cmd/…/main.go• L29-104 cmd/…/main.go• L107-137
Lightweight runtime
The hatchet-lite command is a single-process shape for local or small deployments. It composes the API, engine, and static file server, then routes API paths to the API and other paths to dashboard assets.
This shape reduces the number of deployed services but keeps the shared configuration contract. It requires a dashboard asset directory and a frontend port. It can use PostgreSQL for the message queue when no queue setting is present, which supports a smaller default deployment.
References: cmd/…/main.go• L28-50 cmd/…/main.go• L77-125 cmd/…/main.go• L127-191
Database migrations
The hatchet-migrate command changes the PostgreSQL schema independently of the API and engine. It supports normal migration, bounded upgrade, and rollback to a named version. When OLAP_DATABASE_URL is set, the command applies the same migration or rollback target to that second PostgreSQL database after the primary operation. Operators should treat both databases as one schema boundary for the API and engine.
The command rejects conflicting upgrade limits before it runs and reports each migration through a debug console logger. The migration runner can also accept a caller-provided logger for embedded use. It selects the database from an explicit URL or an environment variable, retries connection setup, uses a PostgreSQL session lock, handles older schema baselines, and repairs known legacy version IDs before it runs the embedded migrations. It applies the outbox schema before the main migration set.
This diagram shows how one migration request reaches the primary database and, when configured, the matching OLAP database.
flowchart TD
A[Migration command] --> B[Migration target and logger]
B --> C[Primary database]
B --> D{OLAP_DATABASE_URL set?}
D -- No --> E[Complete]
D -- Yes --> F[OLAP database]
C --> G[Apply or roll back schema]
F --> G
Migrations 160 through 181 establish durable streams, time-based access for high-volume data, retry and replay safeguards, stream offsets, task metadata, and operational lookup indexes. The newer migrations extend that boundary:
- Migration 182 adds minute-level OLAP aggregate tables and delta tables for task statuses, task events, and events. Source-table triggers record tenant- and workflow-scoped changes for later aggregation.
- Migration 183 adds the
VERCELserverless endpoint kind, partitioned endpoint health and delivery events, and a 300-second default request timeout. - Migration 184 adds a
readOnlyflag to API tokens. - Migration 185 removes the older OLAP status triggers. Its down path can restore them when a rollback needs the earlier write path.
- Migration 186 updates the partition lookup helpers to select partitions by their stored upper bounds. The weekly and monthly helpers now use the same date-based partition selection rule as the general helper.
- Migration 187 adds a time-partitioned audit log for tenant-scoped actions by users and API keys. It records the action, resource, correlation ID, and request details.
- Migration 189 adds completion time to OLAP run records and keeps that time aligned with terminal status and retry changes for task and DAG records.
- Migration 190 adds tenant and completion-time indexes for failed OLAP runs. It builds partition indexes concurrently before attaching the parent index to support failure-alert lookups across partitions.
- A newer migration adds a minute-level, tenant-scoped aggregate for published and delivered stream bytes. The table is partitioned by its time bucket so stream usage can be rolled up without changing the live stream path.
- A newer migration adds a tenant entitlement flag for direct completion of operator steps. The flag defaults to disabled so the capability is opt-in per tenant.
- The tenant allocated-resource migration adds tenant counts for live cron triggers, pending scheduled runs, and incoming webhooks. It backfills the current state and records schedule fires as deltas for later accounting.
- A newer migration adds a tenant and
last_activeindex for queue activity lookups. It supports queue maintenance and inspection without changing the queue work path. - A newer migration updates retry-queue deletion handling so an empty deletion set returns without requeue work. Eligible queued retries still return to either a concurrency slot or the normal queue item path.
These changes affect audit history, reporting, serverless operations, token policy, OLAP write ownership, stream usage, failure alerts, partition maintenance, resource accounting, operator completion policy, queue activity, and retry recovery. A runtime or maintenance task that expects the new contracts requires the matching migration set in every configured database before rollout.
References: cmd/…/main.go• L17-19 cmd/…/main.go• L27-81 cmd/…/run.go• L43-58 cmd/…/run.go• L74-121 cmd/…/run.go• L128-179 cmd/…/run.go• L191-329 cmd/…/run.go• L326-358 cmd/…/run.go• L502-639 cmd/…/20261027194324_v1_0_182_olap_aggregates.sql• L4-103 cmd/…/20261027194324_v1_0_182_olap_aggregates.sql• L105-266 cmd/…/20261028120000_v1_0_183.sql• L5-36 cmd/…/20261029120000_v1_0_184.sql• L1-5 cmd/…/20261029161424_v1_0_185.sql• L3-92 cmd/…/20261031150000_v1_0_186.sql• L1-116 cmd/…/20261031170000_v1_0_187.sql• L1-31 cmd/…/20261022214734_v1_0_181.sql• L1-25 cmd/…/20261102130000_v1_0_189.sql• L4-193 cmd/…/20261102130001_v1_0_190.go• L17-103 cmd/…/20261105230000_add_stream_bytes_aggregate.sql• L1-15 cmd/…/20261112143742_operator_step_direct_completion_entitlement.sql• L1-9 cmd/…/20261117153600_tenant_allocated_resource_counts.sql• L4-124 cmd/…/20261117220000_add_queue_last_active_index.sql• L1-10 cmd/…/20261119161909_retry_queue_delete_trigger_skip_empty.sql• L1-303
Static asset serving
The static-file command serves dashboard assets below an optional base path. It returns the application entry page for client-side routes and applies long cache times to content-hashed assets while keeping entry files fresh.
The standalone server can also proxy /api requests to a separate API endpoint. The standalone server, lightweight runtime, and embedded dashboard use the same routing and fallback behavior. This keeps dashboard access consistent across deployment shapes.
References: cmd/…/main.go• L16-53 cmd/…/server.go• L15-89 cmd/…/main.go• L142-155 cmd/…/embedded_ui.go• L471-531
Load-test command
Traffic generation
The hatchet-loadtest command measures workflow behavior under controlled traffic. It can register test workflows itself or use workflows registered by an external SDK worker. Event-key scenarios cover standard tasks, batching, durable tasks, DAG shapes, nested DAGs, and concurrency. Concurrency remains opt-in so the default run measures the standard path.
In-process mode owns the test worker and event producer. External-worker mode resolves the workflow names for each selected event key and fanout, then waits for a separately running worker before it sends events. The companion Go worker registers the same scenario families through the Go SDK, which lets the command measure the engine with a worker written in another SDK.
References: cmd/…/main.go• L23-125 cmd/…/do.go• L84-156 cmd/…/do.go• L240-340 cmd/…/run.go• L31-205 cmd/…/emit.go• L24-89 cmd/…/emit.go• L155-260 cmd/…/main.go• L68-213
Timing and result checks
The load test reports push latency and execution timing. External-worker mode polls completed runs and derives queue, scheduling, and execution phases from task timestamps. It samples runs deterministically when configured and fetches selected timings concurrently with a fixed bound, which keeps REST work from growing without limit.
Pending timing fetches remain eligible for retry after transient errors. The collector stops retrying a run after a fixed pending period and reports missing execution, count mismatches, duplicate task runs, and execution time above a configured threshold. The expected count rules account for scenarios whose work is intentionally cancelled, such as concurrency tests.
References: cmd/…/timing.go• L19-38 cmd/…/timing.go• L39-80 cmd/…/timing.go• L118-165 cmd/…/timing.go• L179-337 cmd/…/do.go• L152-625 cmd/…/load_e2e_test.go• L23-35 cmd/…/load_e2e_test.go• L67-290
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the server configuration contract aligned across
hatchet-api,hatchet-engine,hatchet-lite,hatchet-admin, and the shared loader. A new required setting can break both long-lived services and short-lived admin commands. - Keep Kubernetes resource names and resource types aligned with the deployment manifests. The quickstart and worker-token commands must write to the resource that consuming pods read.
- Keep generated credentials aligned with tenant scope, encryption settings, and auth mode. Auth-disabled seeding and token creation must agree on the embedded tenant and token.
- Keep profile fields aligned with endpoint, tenant, token, TLS strategy, and SDK environment output. The normal CLI path and the MCP path must provide the access context required by their callers.
- Keep profile token migration and
profile envoutput aligned with the keyring, shell variable names, SDK endpoint names, explicit TLS behavior, and terminal-output safety. A missing unset or quote can leave stale credentials or expose a token. - Keep MCP grants separate from normal profile selection. A grant or embedded-instance change must not let an ungranted profile reach an agent tool.
- Keep MCP wait, replay, status redaction, and feedback destination rules aligned with the agent tool contract. A change in one rule can make an operation wait forever, expose an ungranted target, or redirect feedback.
- Keep embedded UI host, origin, cookie, and upstream proxy rules aligned. A change in one boundary can weaken local browser protection or forward the proxy token to the API.
- Keep lightweight proxy paths aligned with API and dashboard paths. A prefix change can route a request to the wrong service.
- Keep engine service names, controller pause settings, and API exposure aligned. A role can appear configured while its dependent scheduler, task, OLAP, stream, or operator service is absent.
- Keep workflow-version announcements and event-key cache invalidation aligned across engines. A new workflow version must reach every engine that may serve its event key.
- Keep engine shutdown order aligned with dispatcher draining, operator handoff, stream closure, usage flushing, and health reporting. A new long-lived service needs a cleanup step before the gRPC listener closes.
- Keep the primary and optional OLAP database migration targets, environment bindings, and execution order aligned. A schema contract is incomplete when only one configured database has moved.
- Keep migration version names, rollback behavior, and runtime contracts aligned. New audit-log, OLAP completion-time, failed-run index, endpoint-event, token, status-trigger, partition-helper, stream-usage, allocated-resource-count, operator-entitlement, queue-index, and retry-queue contracts require the matching schema target before rollout.
- Keep migration logger ownership aligned between standalone and embedded callers. Embedded users must be able to route diagnostics through their own logger without unexpected process output.
- Keep migration baseline detection and legacy version rewrites aligned with the names of embedded migration files. A rename can make an existing database look behind or make a later migration appear missing.
- Keep outbox migration ordering aligned with the main migration set. The outbox schema must be ready before code relies on the full migration boundary.
- Keep tenant entitlement readers aligned with the direct operator-step completion column and its default-disabled policy. A capability change must not silently enable the feature for every tenant.
- Keep tenant resource-count backfills, schedule-fire deltas, and count consumers aligned. The backfill and the live trigger must describe the same definition of an allocated resource.
- Keep queue activity readers and maintenance scans aligned with the tenant and
last_activeindex contract. A changed scope or activity field can make queue inspection slow or miss the intended rows. - Keep retry-queue deletion triggers aligned with queue and concurrency requeue rules. Empty delete batches must stop early while eligible queued retries must preserve their current retry and strategy state.
- Keep OLAP aggregate triggers, delta tables, partition helpers, and downstream aggregation aligned. A change in write ownership can double-count data or leave reporting stale.
- Keep stream byte aggregate writes, time partitions, and usage readers aligned. A schema-only change can make usage data fail to persist or remain unreadable.
- Keep partition maintenance callers aligned with migration 186. Partition selection now uses each partition's upper bound, and weekly and monthly helpers no longer add their former extra age filters.
- Keep audit-log writers and readers aligned with tenant scope, actor type, resource identity, correlation IDs, and time-partition maintenance. A changed audit contract can hide or misclassify operator actions.
- Keep failed-run alert queries aligned with migration 189's
finished_atsemantics and migration 190's partition-attached indexes. A status or retry change must preserve the time used by alert lookups. - Keep serverless endpoint kinds, endpoint-event retention, timeout defaults, and operator consumers aligned. A new endpoint type is not usable if the operator or dashboard cannot classify its events.
- Keep API token readers aligned with the new read-only field. A policy path that ignores the field can grant write access to a read-only token.
- Keep run command task/DAG detection, JSON output, log cursors, and event fallbacks aligned with the API endpoints. A new run type can make one operational command silently omit data.
- Keep TUI filters and status metrics aligned on workflow and time scope. A change to the default window or status set can make the table and summary counts describe different populations.
- Keep load-test workflow names, event keys, namespace, fanout, and external-worker registration rules aligned. A naming change can make the producer wait for workflows that the worker did not register.
- Keep the load-test expected execution count aligned with each event-key scenario. A new fanout or DAG shape can make result checks report false failures or miss missing work.
- Keep timing sampling, pending retries, fetch concurrency, and collector shutdown aligned. A change can bias averages or abandon valid samples before they are fetched.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A server command cannot load database or server configuration | API, engine, admin, or setup stops before it creates its service layer | Provide the required configuration directory and environment bindings. |
| A client profile has an expired token or wrong tenant | CLI requests fail or affect a tenant different from the operator's intent | Keep credentials, tenant, endpoints, and TLS choice in one selected profile. |
| Profile TLS detection is uncertain and the operator selects plaintext without a trusted network | The API token can travel without transport protection | Keep TLS enabled unless the endpoint and network are known to be safe. |
| MCP uses a profile that its grant does not allow | The agent call is refused even when the normal CLI can use the profile | Grant the named profile or use the intended embedded path. |
| MCP receives a rotated token under a reused client identity | An agent can keep using stale credentials or report the wrong tenant | Include the current profile token in the client identity and reload grants for each call. |
| MCP waits for a run beyond its bounded timeout | The tool reports no terminal result even though the run may finish later | Use the returned run ID and check it with get_run. |
profile env is evaluated after a profile with missing optional fields without its unset lines | Old endpoint or tenant values remain in the shell and override the new token | Use the generated export block and keep its clear-old-values behavior intact. |
| Kubernetes quickstart cannot read or write the selected resource | Cluster setup does not persist keys or server settings | Run it in a pod with access to the chosen namespace and resource type. |
| Quickstart runs certificate generation in a FIPS build without supplied certificates | Setup stops before it writes a usable server configuration | Provide certificates or skip the certificate stage. |
| Auth-disabled seed data uses a default tenant different from the embedded token tenant | The embedded access path cannot use the seeded tenant | Set the default tenant ID to the embedded token tenant ID. |
| A token is created for the wrong tenant or with mismatched server keys | Authentication succeeds against an unintended tenant or fails at validation | Check the explicit tenant ID and use the same server configuration as the validator. |
| Embedded UI receives an unrecognized host or cross-origin unsafe request | The local dashboard request is rejected instead of reaching the API | Open the printed token URL and keep the browser on the UI listener origin. |
| An engine role is paused or omitted while a dependent API path still expects it | Scheduling, task processing, OLAP updates, streams, or operator work can stop without the process itself failing | Match service roles and paused-controller settings to the APIs and workers enabled for the deployment. |
| An engine does not receive a workflow-version announcement | Its event-key cache can omit a workflow version created by another engine | Keep the shared workflow-version topic and invalidation subscription active. |
| Engine shutdown closes gRPC before operators, streams, or usage state drain | Work in flight can be cut off, usage can be lost, or long-lived clients can block termination | Mark dispatchers draining and close operators, stream sessions, and usage aggregation before the gRPC cleanup. |
| The primary migration succeeds but the configured OLAP migration fails | The two databases expose different schema versions to one deployment | Treat the primary and OLAP runs as one rollout and verify both targets before starting dependent services. |
A migration target is higher than the current version while --down is used | The rollback command stops instead of upgrading the database by mistake | Use a normal upgrade without --down when the target is higher. |
| A database contains a legacy migration version that is not rewritten | Goose can treat an already applied migration as missing and apply an invalid sequence | Keep the legacy version rewrite checks with the migration file history. |
| The outbox migration fails before the main migration set | The database can remain without the queue outbox schema needed by later runtime code | Treat outbox migration success as a prerequisite for the main schema rollout. |
| Migration 182 is applied without its aggregate consumers or partition plan | OLAP deltas can accumulate without usable rollups, or new writes can lack partitions | Roll out the aggregate writer, consumer, and partition plan as one schema boundary. |
| The stream byte aggregate migration is missing while usage writes or readers are active | Stream usage writes fail or the usage view has no minute-level data | Apply the stream aggregate migration before enabling its write and read paths. |
| The allocated-resource-count migration is missing while resource count writes or readers are active | Tenant allocation counts cannot be stored or reported | Apply 20261117153600_tenant_allocated_resource_counts before enabling its count paths. |
Queue activity scans run before the queue last_active index migration is applied | Tenant-scoped queue inspection and maintenance can degrade as queue volume grows | Apply 20261117220000_add_queue_last_active_index before relying on the indexed activity path. |
| The retry queue trigger runs without the empty-delete guard | Delete batches with no rows still enter avoidable retry-requeue work | Apply 20261119161909_retry_queue_delete_trigger_skip_empty and keep its early no-row return. |
| Retry trigger conditions or strategy-array progression change during migration | Eligible queued retries can fail to return to the correct concurrency slot or queue item | Preserve retry-time, queued-state, retry-count, and conflict checks in the trigger contract. |
| Migration 183 is missing for a Vercel endpoint or endpoint event | The endpoint kind or health history cannot be stored as expected | Apply migration 183 before enabling that endpoint flow. |
Migration 184 is missing while token policy reads readOnly | Token policy cannot distinguish read-only credentials from normal credentials | Apply migration 184 before deploying code that enforces the field. |
| Migration 185 is applied while an older OLAP status writer is still required | Status data can stop updating or two write paths can disagree | Deploy the current status write path with the migration. |
| Audit actions are written before migration 187 is applied | Tenant action history cannot be stored or audit views fail | Apply migration 187 before enabling audit-log writes or reads. |
| OLAP status and retry changes run without migration 189 | Completion times are missing or do not match the terminal attempt used by reports and alerts | Apply migration 189 with the OLAP trigger contract that consumes finished_at. |
| Migration 190 cannot build partition indexes or attach the parent index within its lock timeout | Failed-run alert queries lack the intended index and the migration remains incomplete | Re-run after long transactions clear and verify the parent and partition indexes. |
| Tenant entitlement data lacks the operator direct-completion column | The operator completion path cannot apply the tenant capability policy | Apply migration 20261112143742_operator_step_direct_completion_entitlement before enabling that path. |
| Partition maintenance expects partition names to define the selected date | Maintenance can select the wrong partitions or skip partitions whose names do not match their stored bounds | Apply migration 186 and use the partition helpers' upper-bound date contract. |
| The migration target is incompatible with the engine version | Runtime work can fail against missing schema, entitlement, or index contracts | Apply the migration boundary required by the engine version in every configured database before rollout. |
| Run events or logs are available only through the other run type's endpoint | The CLI shows an empty or partial operational view | Preserve the task/DAG fallback and test both identifier types. |
| The TUI table and metrics request use different filters | The summary counts do not match the visible run rows | Build both requests from the same workflow and time filter state. |
| External-worker load testing uses names not registered by the worker | The test waits for workflows that never appear | Match namespace, event types, fanout, and derived workflow names. |
| The selected load-test scenario is not enabled on both sides | The producer or worker does not exercise the intended behavior | Match event-key selection with the worker's registered workflow set. |
| Timing fetches fail until the pending lifetime expires | Selected runs have no phase samples and reported averages can be incomplete | Keep the API reachable and allow the collector to retry before teardown. |
| The static server cannot find index.html | Root and client-side routes return an internal error | Deploy a complete dashboard asset directory. |
Key files
| File | Why to read it |
|---|---|
| cmd/…/root.go | Shows the user-facing CLI boundary and command-wide startup behavior. |
| cmd/…/profile.go | Shows profile selection, credential storage, token validation, TLS choice, and shell access state. |
| cmd/…/client.go | Shows normal and MCP profile-authoritative client creation. |
| cmd/…/runs.go | Shows core run inspection, log, event, child-run, and control actions. |
| cmd/…/trigger.go | Shows project and manual workflow trigger paths. |
| cmd/…/tui.go | Shows terminal views, profile switching, and run navigation. |
| cmd/…/runs_list.go | Shows the live run table, filters, metrics, pagination, and refresh behavior. |
| cmd/…/runs_list_filters.go | Shows the operator-facing workflow, time, and status filter model. |
| cmd/…/events_util.go | Shows event names and severity used in terminal run inspection. |
| cmd/…/status.go | Shows the shared terminal status meaning and display mapping. |
| cmd/…/canvas.go | Shows the status-aware DAG view presented to operators. |
| cmd/…/embedded_ui.go | Shows embedded dashboard checks, browser protection, and proxy access. |
| cmd/…/mcp.go | Shows the agent connection boundary. |
| cmd/…/resolve.go | Shows grant-aware profile and embedded resolution. |
| cmd/…/server.go | Shows agent tools, bounded run waits, replay choices, status, and feedback behavior. |
| cmd/…/tools_test.go | Shows the MCP access, result, redaction, and feedback contracts that must remain safe. |
| cmd/…/root.go | Shows the administrative command boundary and security-build check. |
| cmd/…/quickstart.go | Shows instance setup stages. |
| cmd/…/k8s.go | Shows Kubernetes configuration and worker-token publication. |
| cmd/…/seed.go | Shows initial user, tenant, and auth-disabled token data. |
| cmd/…/seed-cypress.go | Shows repeatable Cypress users, tenants, membership state, and generated browser credentials. |
| cmd/…/token.go | Shows tenant-scoped token creation and auth-disabled behavior. |
| cmd/…/user.go | Shows password reset and session revocation. |
| pkg/…/loader.go | Shows shared composition of data and services. |
| cmd/…/run.go | Shows the API service boundary. |
| cmd/…/run.go | Shows engine role composition, workflow-version synchronization, stream usage, and lifecycle. |
| cmd/…/main.go | Shows the separate serverless operator process boundary. |
| cmd/…/main.go | Shows the single-process deployment shape. |
| cmd/…/main.go | Shows migration target choices, optional OLAP execution, and validation. |
| cmd/…/run.go | Shows migration connection, locking, baseline handling, logger composition, outbox ordering, and migration execution. |
| cmd/…/20261027194324_v1_0_182_olap_aggregates.sql | Shows minute-level OLAP aggregate storage and source-to-delta triggers. |
| cmd/…/20261028120000_v1_0_183.sql | Shows serverless endpoint event history and timeout changes. |
| cmd/…/20261029120000_v1_0_184.sql | Shows the API-token read-only contract. |
| cmd/…/20261029161424_v1_0_185.sql | Shows the OLAP status-trigger ownership change. |
| cmd/…/20261031150000_v1_0_186.sql | Shows the partition helper date-bound change used by maintenance tasks. |
| cmd/…/20261031170000_v1_0_187.sql | Shows the tenant-scoped, partitioned audit-log schema. |
| cmd/…/20261102130000_v1_0_189.sql | Shows OLAP completion-time tracking and status-trigger behavior. |
| cmd/…/20261102130001_v1_0_190.go | Shows concurrent failed-run indexes across OLAP partitions. |
| cmd/…/20261105230000_add_stream_bytes_aggregate.sql | Shows the tenant and time-bucket contract for stream byte usage. |
| cmd/…/20261112143742_operator_step_direct_completion_entitlement.sql | Shows the tenant-level opt-in contract for direct operator-step completion. |
| cmd/…/20261117153600_tenant_allocated_resource_counts.sql | Shows tenant resource-count backfill and schedule-fire delta capture. |
| cmd/…/20261117220000_add_queue_last_active_index.sql | Shows the tenant-scoped queue activity lookup contract. |
| cmd/…/20261119161909_retry_queue_delete_trigger_skip_empty.sql | Shows empty-delete handling and retry requeue behavior for queue and concurrency paths. |
| cmd/…/do.go | Shows the load-test lifecycle, external-worker resolution, timing groups, and checks. |
| cmd/…/run.go | Shows in-process workflow registration and execution identity. |
| cmd/…/timing.go | Shows external-worker timing measurement, sampling, retries, and bounded fetches. |
| cmd/…/main.go | Shows the companion Go SDK worker and scenario registration. |
| cmd/…/main.go | Shows standalone asset serving and optional API proxy setup. |
| cmd/…/server.go | Shows dashboard routing, fallback, and cache behavior. |