Automation

Automate recurring work against Kival using the CLI, API, SDKs, and event-driven patterns.

Kival is designed to participate in automation, but it is not itself a workflow engine or scheduler. Use the CLI, HTTP API, or SDKs to read and change shared knowledge, and keep execution state in the system that owns the workflow.

Pick the interface that matches the automation

Use the CLI for shell scripts and tool-using agents, an SDK for application code, or the raw HTTP API when you need direct transport control or another language.

All three expose the same server-side semantics. The API is the canonical reference for pagination, optimistic updates, errors, rate limits, and realtime behavior.

Make structured data the boundary

For CLI automation, prefer JSON output and structured input rather than parsing presentation-oriented text. For SDK/API integrations, keep the returned IDs and version identifiers needed to continue safely from the state you actually read.

An automation that updates an object should base the mutation on the current version it observed. If Kival returns a conflict, re-read and reconcile instead of implementing last-write-wins.

Use durable events for incremental processing

Audit events have globally ordered sequence numbers and can support incremental processing within the caller's authorization boundary. A consumer can retain its own last processed sequence and query forward from there.

Keep that checkpoint in the automation system, not in Kival's knowledge model unless it is itself useful shared knowledge.

Use realtime only when latency matters

Realtime invalidations can tell a connected client that visible state may have changed. They are not a replayable event stream and can be delayed, duplicated, reordered, or missed.

When an automation needs both low latency and reliable catch-up, use realtime as a wake-up signal and HTTP/events as the durable source.

Keep orchestration outside Kival

Kival currently provides no built-in workflow engine or outbound webhook delivery. Schedulers, queues, retries, execution leases, external side effects, and delivery guarantees belong in the system orchestrating the work.

Kival's role is the durable shared knowledge boundary: the objects, versions, context, access, and provenance that humans and automated systems can work against together.