ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

nocobase-workflow

Guide AI to create NocoBase workflows — triggers, conditions, data operations, SQL, scheduling

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/alexander-lq/work-fllows
Or

NocoBase Workflow Building

You are guiding the user to create automated workflows in NocoBase.

Key Concepts

Trigger Types

TypeDescriptionMode
collectionData change trigger1=create, 2=update, 3=create+update, 4=delete
scheduleTime-based trigger0=cron, 1=date field
actionManual button trigger

Node Types

TypeDescription
conditionIf/else branch (basic engine or math.js)
updateUpdate existing records
createCreate new records
queryQuery records for use in downstream nodes
sqlExecute raw SQL
requestHTTP request (webhooks, external APIs)
loopIterate over array data
endTerminate workflow (1=success, 0=failure)

Node Linking Model

  • Nodes form a linked list: upstreamIddownstreamId
  • Branch nodes (condition, loop) use branchIndex:
    • 1 = true branch (condition) or loop body (loop)
    • 0 = false branch (condition)
    • null = main line continuation

Variable System

VariableDescription
{{$context.data.field}}Field from the trigger record
{{$context.data.id}}ID of the trigger record
{{$jobsMapByNodeKey.<key>.field}}Result from a previous node
{{$scopes.<key>.item}}Current item in a loop

Workflow Patterns

Pattern 1: Auto-numbering (on create)

Generate sequential IDs like PR-2026-001:

# Step 1: Create workflow
nb_create_workflow("Auto Purchase Number", "collection",
    '{"mode": 1, "collection": "purchase_requests", "appends": [], "condition": {"$and": []}}')

# Step 2: Add SQL node
nb_add_node(wf_id, "sql", "Generate Number",
    '{"dataSource": "main", "sql": "UPDATE purchase_requests SET request_no = \'PR-\' || TO_CHAR(NOW(), \'YYYY\') || \'-\' || LPAD((SELECT COALESCE(MAX(CAST(SUBSTRING(request_no FROM \'[0-9]+$\') AS INT)),0)+1 FROM purchase_requests WHERE request_no LIKE \'PR-\' || TO_CHAR(NOW(), \'YYYY\') || \'-%\')::TEXT, 3, \'0\') WHERE id = {{$context.data.id}}"}')

# Step 3: Enable
nb_enable_workflow(wf_id)

Pattern 2: Status Sync (on create)

Set default status when a record is created:

nb_create_workflow("Default Status", "collection",
    '{"mode": 1, "collection": "orders", "appends": [], "condition": {"$and": []}}')

nb_add_node(wf_id, "update", "Set Draft Status",
    '{"collection": "orders", "params": {"filter": {"id": "{{$context.data.id}}"}, "values": {"status": "draft"}}}')

nb_enable_workflow(wf_id)

Pattern 3: Conditional Branch (on create)

Different actions based on field value:

nb_create_workflow("Transfer Type Handler", "collection",
    '{"mode": 1, "collection": "transfers", "appends": [], "condition": {"$and": []}}')

Metadata

Stars4473
Views1
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-alexander-lq-work-fllows": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.