Decision runtime
Typed human work inside AI workflows.
Tasks keeps the durable state small and strict: open a task, wait for a typed outcome, decide/cancel/fail it, and let product domains own assignment and notification policy.
/task
Task surface
schema
task_tasks
Task record with kind, key, state, instructions, context, outcome schema, outcome, error, and timestamps.
actions
openTask
Creates or reuses a durable task, usually idempotent by key.
getTask
Reads the current task state and stored outcome metadata.
awaitOutcome
Waits until a task has a typed outcome or reaches a terminal state.
decideTask
Stores a typed outcome and closes the task.
Showcase-first surface
The route exists before registry publication so the public surface can be shaped against the real domain contract.
From simple to complex
The same idea, three depths.
in one sentence
A pause button for workflows.
The workflow stops, a human decides, and the workflow continues with that decision.
how it works
Open a task, wait for the outcome, keep going.
A workflow opens a task describing what needs to be decided and what shape the answer must have. It then waits — minutes or days — until someone records an outcome, cancels, or fails it. The moment a decision lands, the workflow picks up exactly where it paused, with a typed result in hand.
under the hood
One strict record with a schema-validated outcome.
task_tasks stores kind, key, state, instructions, context, and a zod outcome schema that validates the decision before it closes the task. openTask is idempotent by key, awaitOutcome blocks until a terminal state, and decideTask, cancelTask, and failTask resolve it — assignment and notifications stay in your product domain.
Route contract
Landing, UI, and library are separate surfaces.
Runtime shape
Package behavior. Registry presentation.
Tasks UI should expose pending decisions, typed outcome controls, task state, and the domain context needed to decide.
package
@ekairos/tasks@beta
aggregate
task_tasks
durable
outcome
ui
component surface reserved