Skip to main content

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 typePurposeStateful
writeback-formValidated, confirmable data entrycomplete form values
scenario-editorPlanning assumptions and save actionassumption values
approval-controlOne approve/reject decisionno
approval-listQueue of decisionsno
comment-threadDiscussion and add-comment actionno
audit-timelineChronological audit entriesno
run-historyStatus, errors, durations and retryno
record-detailLabelled selected-record fieldsno
task-queuePrioritized operational workno
notification-settingsSelected notification channelsselected 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 ViewEditor insert drawer and generated property controls;
  • validateViewSpec reference checks;
  • registryPrompt and viewJsonSchema model context; and
  • AppBuilder previews 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.