lbb_workflows_manage
Create a workflow from a starter workflow, or refresh, pause or resume a triggered workflow. Run lbb_workflows action=preview first and show the user the watch and the instance count.
Instructions
Create a workflow from a starter workflow, or refresh, pause or resume a triggered workflow. Run lbb_workflows action=preview first and show the user the watch and the instance count. use creates a workflow from a starter workflow of action=starters, under a name (default: the class's local name), with its watch (class, fields) and params; the workflow then reads every instance of the class and follows each published commit. A developer workflow (starter=workflow) also takes workflow (workflow_type and version of the developer's worker), owns and batch; it needs a server with the workflow engine. use again with the same starter and name changes only what you name, and the same request again changes nothing. A workflow that calls models (ontology.fit, documents.link, documents.map, values.extract) spends model budget as it reads. refresh asks the workflow to run now and returns at once with queued; poll lbb_workflows action=get for progress. pause stops a workflow (a developer workflow, documents.parse, documents.link, documents.map or values.extract) from reading and sending, and stops the claims of a developer workflow's shards; resume lets it catch up. Without starter, pause and resume name a workflow with triggers. search.embed and ontology.fit cannot be paused. define creates or changes a workflow with triggers of the developer's worker (/v1/workflows/named): name, workflow, class and fields (its watch trigger), owns, batch, and shards (engine identities, 1 to 16), route_by (a field that keeps work in order) and window (messages queued per shard, default 4); it needs a server with the workflow engine, and a change of shards waits for empty inboxes. run (name) runs a workflow with triggers now: its watch sends every instance again.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gate | No | use: outputs below this confidence go to review instead of the graph, for a workflow with a review gate. | |
| name | No | The triggered workflow's name, [a-z0-9][a-z0-9-]{0,62} (refresh, pause, resume: required; use: omit for the class's local name). | |
| owns | No | preview/use, developer workflow only: what your code writes. classes it creates instances of, relations it writes as out-edges of the watched instances, properties it writes on them. Owned outputs never trigger the workflow itself. | |
| batch | No | preview/use, developer workflow only: instances per message, 1 to 64 (default 16). | |
| class | No | preview/use: the class whose instances the workflow watches (an IRI, or a name the ontology knows). Required unless the starter workflow's watch is fixed. | |
| graph | No | Graph to target; defaults to the connection's graph | |
| action | Yes | ||
| detail | No | Response detail level. Defaults to compact. | |
| fields | No | preview/use: the fields whose change triggers the workflow, as embedding paths (transcript, label, about/label, <https://…>). Omit for the starter workflow's own choice. | |
| params | No | preview/use: the starter workflow's own settings, as listed in its catalog entry: search.embed takes model, dim and title; ontology.fit takes context (one sentence about the text, e.g. {"context": "interviews with employees"}); workflow takes none. | |
| shards | No | define: engine identities that receive the messages, 1 to 16 (default 1). A change needs every shard's inbox empty. | |
| window | No | define: messages the watch keeps queued per shard, 1 to 128 (default 4). | |
| exclude | No | preview/use: fields to drop from the automatic choice. | |
| starter | No | The starter workflow's catalog id from action=starters, e.g. search.embed (embeddings on a class), ontology.fit (fit from text) or workflow (a developer workflow: your worker's workflow gets the instances). get/preview/use/refresh: required. pause/resume: omit to name a workflow with triggers. | |
| trigger | No | define: the watch trigger's id (default watch). queue: the trigger whose queue to read. | |
| route_by | No | define: a field of the class whose value keeps work in order: the changes of one value go to one shard. Default: the instance. | |
| workflow | No | preview/use, developer workflow (starter=workflow) only, required there: the workflow of your worker that receives the messages. Creating it creates the instance starter.<name>. | |
| budget_usd_per_month | No | use: a monthly model budget in USD for this workflow, below the stack's own. |