Appearance
hailer.workflow
Read workflows and install workflow templates. Results depend on app kind.
| Method | Host op | Returns |
|---|---|---|
list() | workflow.list | Promise<Workflow[]> |
get(workflowId) | workflow.get | Promise<Workflow> |
install(spec, option?) | workflow.install | Promise<IdsMap> |
list()
ts
const workflows = await hailer.workflow.list();- Workspace app — workflows in the app's workspace.
- Private app — workflows across all workspaces the user belongs to.
Each returned Workflow carries a workspaceId. Phases are returned as an object keyed by phase id, and fields without a type are omitted.
get(workflowId)
ts
const workflow = await hailer.workflow.get(workflowId);In a workspace app the lookup is scoped to the app's workspace. Rejects with a 404 if the workflow isn't found or isn't visible.
install(spec, option?)
Install a workflow template into a workspace.
ts
const idsMap = await hailer.workflow.install(spec, { workspaceId });option.workspaceId defaults to the app's workspace. If neither is available the call is rejected. Returns an IdsMap mapping template ids to the created ids.