Skip to content

Workflow Engine

Yunque Agent includes a visual workflow engine for automating multi-step processes. Workflows define a DAG (Directed Acyclic Graph) of nodes connected by edges, executed by the runtime engine.

Concepts

  • Definition: a reusable workflow template with nodes and edges
  • Instance: a running execution of a definition
  • Node: a single step (LLM call, code execution, browser action, etc.)
  • Edge: a connection between nodes defining execution order

Node Types

TypeDescriptionExecutor
startEntry pointBuilt-in
endExit pointBuilt-in
llmLLM completion with configurable model/promptPlanner
codeExecute Python/JS/Go/Shell codeSandbox Runner
browserBrowser automation (navigate, click, extract)BrowserEngine
knowledgeKnowledge base hybrid searchKnowledgeStore
conditionConditional branching (if/else)Built-in
loopRepeat a subgraph N timesBuilt-in
apiExternal HTTP API callHTTP client
transformData transformation (JSON/text)Built-in
waitPause for duration or eventBuilt-in
humanWait for human inputBuilt-in
subworkflowInvoke another workflowRecursive
parallelExecute branches in parallelBuilt-in

Creating a Workflow

Via API

POST /v1/workflows
Content-Type: application/json
json
{
  "name": "Daily Report",
  "description": "Generate a daily summary report",
  "nodes": [
    { "id": "start", "type": "start" },
    { "id": "fetch", "type": "api", "config": { "url": "https://api.example.com/metrics" } },
    { "id": "analyze", "type": "llm", "config": { "prompt": "Summarize these metrics: {{fetch.output}}" } },
    { "id": "end", "type": "end" }
  ],
  "edges": [
    { "from": "start", "to": "fetch" },
    { "from": "fetch", "to": "analyze" },
    { "from": "analyze", "to": "end" }
  ]
}

Via Dashboard

  1. Navigate to Workflows in the sidebar
  2. Click New Workflow
  3. Use the visual node editor to drag-and-drop nodes
  4. Connect nodes with edges
  5. Configure each node's parameters
  6. Save and run

Running Workflows

POST /v1/workflows/:id/run
json
{
  "inputs": {
    "date": "2026-04-12"
  }
}

Monitoring Instances

GET /v1/workflows/:id/instances     # List instances
GET /v1/workflows/:id/instances/:iid  # Instance detail
POST /v1/workflows/:id/instances/:iid/cancel  # Cancel

Storage

Workflow definitions and instances are persisted to Ledger KV with file-system fallback. Data survives restarts.

API Reference

MethodPathDescription
GET/v1/workflowsList all definitions
POST/v1/workflowsCreate definition
GET/v1/workflows/:idGet definition
PUT/v1/workflows/:idUpdate definition
DELETE/v1/workflows/:idDelete definition
POST/v1/workflows/:id/runStart instance
GET/v1/workflows/:id/instancesList instances
POST/v1/workflows/:id/instances/:iid/cancelCancel instance

© 2025 云鸢科技(青岛)有限公司 × Dream Lab