@nocobase/nocobase-workflow-manage
Use when users need to inspect, create, revise, enable, or diagnose NocoBase workflows through the `nb` CLI, including trigger selection, node-chain changes, version safety checks, and execution troubleshooting.
| name | nocobase-workflow-manage |
| description | Use when users need to inspect, create, update, copy, enable, or diagnose NocoBase workflows through `nb`, including version-safe edits, node changes, approval surfaces, and execution troubleshooting. |
| argument-hint | [inspect|create|update|copy|enable|diagnose] [workflow-id|workflow-key|node-id|title] [options] |
| allowed-tools | shell, Read(local skill references only), nb(workflows:list|get|create|update|revision|execute, workflows/<workflowId>/nodes:create, flow_nodes:get|update|destroy|destroyBranch|move|duplicate|test, executions:list|get, jobs:get, flowSurfaces:get|catalog|applyApprovalBlueprint|addBlock|addField|addAction|compose|configure|setLayout) |
| owner | platform-tools |
| version | 1.0.0 |
| last-reviewed | 2026-08-01 |
| risk-level | high |
Goal
Manage NocoBase workflows end to end through nb api workflow.
- Require an authenticated
nbCLI. - Run
-honce before first using a subcommand in the current task. - Use only workflow-specific CLI interfaces; do not substitute generic CRUD or source edits.
Scope
- Inspect, create, update, version, copy, enable, and diagnose workflows.
- Configure triggers and sequential node chains.
- Move, duplicate, test, or delete nodes and branches.
- Inspect executions and failed jobs.
- Author workflow-bound approval surfaces through
flowSurfaces.
Non-Goals
nbinstallation or authentication setup.- Data-model design; use
nocobase-data-modeling. - Ordinary pages, tabs, popups, or routes; use
nocobase-ui-builder. - Whole-workflow deletion.
- Approval schema wiring.
- Invented types, fields, keys, filters, or evaluator functions.
Input Contract
Environment and Tooling
- Stop on authentication or authorization errors.
- For
expression, load the matching formula.js or math.js reference; never invent functions.
Filter Authoring Gate
Before drafting any workflow node/trigger filter or condition, or any user/assignee query object, load the nocobase-utils skill with topic filter, then read Filter Condition Format in the current task. This is mandatory even when the natural-language comparison looks obvious; the relative link is only the exact document location and does not replace the skill invocation.
- Read the target collection's field metadata and resolve the terminal field's frontend interface/type.
- Select the operator only from that field group's documented allowlist.
- For date fields, map “before/less than” to
$dateBefore, “after/greater than” to$dateAfter, “not before/at least/greater than or equal” to$dateNotBefore, and “not after/at most/less than or equal” to$dateNotAfter. Never use$lt,$lte,$gt, or$gteon a date field. - Keep the configuration's documented filter shape and verify the final field/operator pairs before mutation.
Commercial Plugin Capability Gate
Verify the required plugin is installed and enabled before mutation:
| Capability | Plugin |
|---|---|
| Approval and approval surfaces | @nocobase/plugin-workflow-approval |
| Webhook | @nocobase/plugin-workflow-webhook |
| Subflow | @nocobase/plugin-workflow-subflow |
If unavailable, name the prerequisite and stop that path. Never replace requested approval semantics with a manual node. See commercial plugin gate.
Mandatory Clarification Gate
- Ask only about unresolved create-time, destructive, high-risk, or owner choices; at most two rounds and three questions per round.
- Proceed when later-editable details are at least 70% certain; verify them after mutation.
- Require a unique target and exact intended end state before mutation.
- Do not ask which copy mode the user means; infer it through the following gate and state the chosen outcome before mutation.
Workflow Update and Copy Intent Gate
Users usually describe a change, not a technical revision. Route by desired outcome:
| Intent | Signals | Route and consequence |
|---|---|---|
| Modify the existing workflow | Update/adjust logic, trigger, condition, or nodes | Fetch nodes and versionStats. If versionStats.executed > 0, create a same-workflow revision first; otherwise edit in place. Never create an independent workflow. |
| Create a new version | Explicit new version/revision, preserved history, or successor version | Create a revision with the same key. Version executions start at zero; history and key-level aggregate statistics remain. |
| Copy the workflow entity | Copy/clone/save as, another process/template, renamed copy, reset statistics, or bare “copy this workflow” | Create an independent workflow with a new key; execution count and history start empty. |
Precedence: explicit version continuity → revision; explicit separate identity → independent copy; concrete behavior change → update; bare workflow copy → independent copy.
Use exactly these revision calls:
# Same workflow, new version
nb api workflow workflows revision \
--filter-by-tk <source-id> \
--filter '{"key":"<source-key>"}'
# Independent workflow
nb api workflow workflows revision \
--filter-by-tk <source-id>
- Same-workflow mode requires the exact top-level control object
{"key":"..."}. Never nest it in$and/$or, put it in the body, or use an empty filter. - Omit
filterfor an independent copy. - Read back before further mutation: revision means new
idand unchangedkey; independent copy means both differ. - The CLI sends
filteras one JSON query object; the repository switches mode only on directfilter.key.
Collection Resolution Gate
For any required but unclear collection:
- Inspect existing collections and fields with
nocobase-data-modeling. - Use a match at 70% confidence or higher.
- Otherwise ask the user to identify or create the collection.
This applies to collection-bound triggers, operations, schedules, and nodes. See workflow conventions.
Reference Loading Map
- Version and copy operations: workflows CLI
- HTTP transport: workflows HTTP API
- Keys, versions, and statistics: workflow model
- Authoring: triggers, nodes, and conventions
- Any node/trigger filter, condition, or assignee query: load
nocobase-utilswith topicfilter, then read Filter Condition Format before operator selection - Approval UI: approval UI index and surface constraints
Final Command Surface
- Workflows:
workflows list|get|create|update|revision|sync|execute - Nodes:
workflows nodes create;flow-nodes get|update|destroy|destroy-branch|move|duplicate|test - Diagnostics:
executions list|get;jobs list|get|resume - Approval surfaces:
flowSurfaces get|catalog|applyApprovalBlueprint|addBlock|addField|addAction|compose|configure|setLayout
Use CLI index for flags and HTTP API index only for underlying request shapes.
Approval UI Entry
- Approval surfaces are bound by
approvalUidortaskCardUid; they are not ordinary pages. - Initiator UI requires
ApplyFormModel; approver UI requires bothApprovalDetailsModelandProcessFormModel. - Use only actions and blocks returned by the live catalog; do not patch reconciled node action config manually.
- Use
applyApprovalBlueprintfor first setup or replacement. - Resolve the bound root before localized operations.
- Task cards support
fields + layout; usesetLayoutfor layout-only edits. - Read field-component options from
catalog.node.configureOptions.fieldComponent.enum. - Load the approval UI index before authoring; load surface constraints for payload rules.
Safety Gate
- Create workflows disabled; require confirmation before enabling.
- Apply the update and copy gate before editing or copying.
- Pass a concrete target to every mutation or destructive call.
- Create nodes sequentially and chain them with
upstreamId. - Apply the Filter Authoring Gate to every persisted node/trigger filter; wrap workflow data/query filters in
$andor$or. See the intent gate for revision control. - Reference node results by the returned node
key, never its numericid. - Model raw JSON with
json-variable-mappingorjson-querybefore downstream use. - Read back every mutation.
- Require confirmation before manual execution.
Workflow
Planning Phase
Resolve intent, trigger, node chain, sync mode, collections, filters, mappings, variables, and raw JSON modeling. If any persisted filter is required, load nocobase-utils with topic filter, read the Filter reference, and resolve each terminal field type before drafting operators. State the plan and any history/statistics consequence.
For approval UI, classify the request as whole-surface setup/replacement or localized editing, then load the approval UI reference.
Creating a New Workflow
- Resolve collections.
- Create with
enabled: false. - Configure the trigger.
- Build the node chain under the Safety Gate.
- Complete the Verification Checklist.
Editing an Existing Workflow
- Fetch the workflow with
nodesandversionStats. - Apply the update and copy gate.
- Mutate only the resolved editable
id. - Complete the Verification Checklist.
Diagnosing a Failed Execution
- List executions by
workflowId, newest first. - Fetch the execution with jobs, workflow, and nodes; omit job results initially.
- Find status
-1(failed),-2(error), or-3(aborted). - Fetch the failed job and inspect
result. - Fix the configuration, then follow the Safety Gate.
Error Handling
400/422: correct the reported type, field, or link error, then retry.- Authentication error: stop and request restored access.
- Node creation failure: fix or remove it before creating downstream nodes.
- Revision failure: re-fetch state before retrying.
Verification Checklist
Verify:
- Workflow type, title, sync mode, and enabled state.
- Trigger configuration.
- Node count, order, types, configs, and
upstreamIdchain. - Required mutation filters are non-empty.
- Revision/copy
idandkeymatch the selected mode. - Approval roots and surface readback match the intended route.
- Raw JSON is modeled before downstream use.
- Required commercial plugins are enabled.
- The returned mutation state matches the requested outcome.
- Every persisted filter field/operator pair was checked against the terminal field's frontend operator group; date fields contain no number comparison operators.
Plugin version control revision rule
- Load
nocobase-revisionevery round. If unavailable, ignore this section and disclose nothing about it. - Reveal no revision information until that skill confirms
nb revision createis available. - If available, make one revision decision immediately before the final reply; report a created revision or the concrete reason none was created.
References
- Commercial plugin gate
- Approval UI index and surface constraints
- Workflow model and workflow fields
- Conventions
- CLI and HTTP API
- Triggers and nodes
- Filter format and evaluators
- Data modeling skill
- Official workflow handbook and revision guide [verified: 2026-04-09]
Loading...
Select a file to preview
Analyzing security...
Checking scan reports and verification data.
Bill of Materials
Everything this skill can do — files, network, commands, and more.