Workflow view types
workflowViewTypes turns the complete workflow catalog into a ViewRegistry
vocabulary. Rendering, validation, inline editing and AI prompt generation then
share the same definitions and examples.
import ViewRenderer, {createViewRegistry} from '@zuilib/apps'
import {coreViewTypes} from '@zuilib/apps/core'
import {workflowViewTypes} from '@zuilib/workflows/view-types'
const registry = createViewRegistry(coreViewTypes, workflowViewTypes)
<ViewRenderer
spec={view}
registry={registry}
datasets={{approvals}}
actions={{
approve: ({id}) => approve(id),
reject: ({id}) => reject(id),
}}
/>
A workflow node remains inert JSON:
{
"id": "commercial-approvals",
"type": "approval-list",
"props": {
"items": {"$bind": "approvals"},
"onApprove": {"$action": "approve"},
"onReject": {"$action": "reject"}
}
}
Catalog
| Node type | Purpose | Stateful |
|---|---|---|
writeback-form | Validated, confirmable data entry | complete form values |
scenario-editor | Planning assumptions and save action | assumption values |
approval-control | One approve/reject decision | no |
approval-list | Queue of decisions | no |
comment-thread | Discussion and add-comment action | no |
audit-timeline | Chronological audit entries | no |
run-history | Status, errors, durations and retry | no |
record-detail | Labelled selected-record fields | no |
task-queue | Prioritized operational work | no |
notification-settings | Selected notification channels | selected channel ids |
Stateful nodes participate in the standard Apps viewState channel. Their
values can be saved per user or composed with an App variable without changing
the component implementation.
Authoring and AI
Every definition declares prop schemas, action props, state bindings, category and an insertable example. That metadata powers:
- the
ViewEditorinsert drawer and generated property controls; validateViewSpecreference checks;registryPromptandviewJsonSchemamodel context; andAppBuilderpreviews and inspection.
const system = registryPrompt(registry, {
datasets: [approvalSchema, taskSchema],
actions: workflowActions,
})
The model can only propose workflow node types and props present in the same registry the runtime uses.