Workflowsbeta
The visual builder, the node types and their configuration, test runs, publishing, and how workflows attach to agents and rules.
Workflows are deterministic steps around the model: call your APIs, branch, render UI, notify the app. They are defined as kletso.workflow/v1 documents and edited on a canvas.
Builder
- Toolbar: inline name, version badge, node and edge counts, Test run, Publish.
- Palette (left): click or drag a node onto the canvas. Connect handles left to right. Condition nodes have true and false outputs.
- Canvas: pan, zoom, drag to position, Backspace/Delete removes the selection. Every new workflow starts with
start→end. - Inspector (right): with nothing selected, the workflow description and input JSON Schema; with a node selected, its title and type-specific fields, On error (Fail the run, Continue, Retry) and Timeout, plus the raw node JSON.
Node types
| Node | Config | Output |
|---|---|---|
| Start | none | {}; the run’s variables begin as { input, context } |
| AI | prompt (templates: {{ input.x }}, {{ nodeId.field }}) | { text } from the agent’s model, tools disabled |
| Condition | expression (order.ageDays <= 30 && order.status == "delivered") | { result }; picks the true or false edge |
| Decision (Jev) · beta | state (templated JSON) and questions: a map of Jev questions, each { type: "choice" | "noul" | "score", instructions, criteria } | the answers map, e.g. { intent: { choice, confidence, probabilities }, urgent: { noul } }; a following Condition can branch on intent.intent.choice == 'refund' when the node is called intent |
| HTTP / Tool | tool name, input mapping, optional confirmation | the tool’s JSON result |
| Transform | output mapping (templated JSON) | the mapping |
| Retrieve | knowledge base, query | placeholder until indexing ships |
| Render UI | a surface (fixture picker today) | { surfaceId }, emits ui.render |
| Notify app | title, body, channel (banner, toast, alert, system, silent), open chat | { notificationId, channel }, emits app.notify |
| Return | value (templated JSON) | ends the run with that output |
| End | none | ends the run |
Each node’s output is stored under its id, so later nodes reference {{ order.total }} when the HTTP node is called order. Runs stop after 100 node executions.
Expression language: &&, ||, ==, !=, <, <=, >, >=, !, parentheses, strings, numbers, true, false, null, dotted paths. Parse errors evaluate to false.
Test run
Opens a drawer with an input JSON. The run executes on the runtime against the draft and logs every node: status, duration, input and output. Emitted ui.render and app.notify envelopes are listed. Deep links ?run=<id> reopen a stored run.
Publish
Creates an immutable version and marks the workflow published. Versions are shown as a badge; there is no rollback list for workflows yet.
Attaching
- Agent → Workflow tab sets
workflowIdon the agent. - Trigger rule → Run a workflow sets
action.workflowId. - A surface action of kind
workflownames a workflow and input.
All three are stored and shown under Used by. Dispatching a workflow from a live conversation or a live event is not wired in this build; use Test run to exercise it. See Roadmap.