DocsCore ConceptsWorkflows

Workflows

Definitions, generations, builds, and lifecycle rules.

A workflow is the persistent definition of work that Chronoverse schedules. It contains a kind, a kind-specific payload, a minute interval, a failure threshold, and log-retention policy.

Workflow kinds

  • HEARTBEAT performs a lightweight health check and never produces execution logs.
  • CONTAINER runs a Docker image and command and may retain stdout and stderr.

Build lifecycle

Workflow execution inputs are prepared asynchronously by the workflow worker. Build states are QUEUED, STARTED, COMPLETED, FAILED, and CANCELED.

For CONTAINER workflows, build validates the user-authored payload and resolves the image reference/digest as workflow-level derived metadata. HEARTBEAT workflows leave resolved image fields empty. Jobs read the workflow metadata at execution time and never store image metadata themselves.

Generations and build hashes

Each relevant update advances the workflow generation. Events carry the generation they belong to, allowing workers and services to reject stale build, reschedule, termination, and deletion work.

Build hashes prevent repeated image and execution preparation when the effective user-authored execution inputs have not changed. Resolved image references and digests are outputs of build, not inputs to the build hash.

Termination and deletion

Termination stops future scheduling and coordinates active state changes. Deletion requires a terminated workflow with no incompatible active work. These checks are deliberate preconditions, not best-effort cleanup.

The dashboard gives the delete request, including any CSRF lookup, ten seconds. It does not queue the request for reconnection when the browser is offline. If it times out, the dashboard makes a separate check with its own ten-second budget. The workflow may still be deleted after either deadline.

The dashboard keeps one delete attempt in progress per workflow in the current tab session, even if you switch away from Details and return. If the outcome is uncertain, it checks whether the workflow is still accessible. A denied or not-found response hides the current view and reports that deletion could not be confirmed. A later authenticated read can restore the view if access returns. If the check finds the workflow, the dashboard reloads its details and actions.

Mutation safety

Create and update requests require Idempotency-Key. Workflow state and its publication intent are committed together through the transactional outbox.

Workflow gRPC contractproto/workflows/workflows.proto