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
| Type | Description | Executor |
|---|---|---|
start | Entry point | Built-in |
end | Exit point | Built-in |
llm | LLM completion with configurable model/prompt | Planner |
code | Execute Python/JS/Go/Shell code | Sandbox Runner |
browser | Browser automation (navigate, click, extract) | BrowserEngine |
knowledge | Knowledge base hybrid search | KnowledgeStore |
condition | Conditional branching (if/else) | Built-in |
loop | Repeat a subgraph N times | Built-in |
api | External HTTP API call | HTTP client |
transform | Data transformation (JSON/text) | Built-in |
wait | Pause for duration or event | Built-in |
human | Wait for human input | Built-in |
subworkflow | Invoke another workflow | Recursive |
parallel | Execute branches in parallel | Built-in |
Creating a Workflow
Via API
POST /v1/workflows
Content-Type: application/jsonjson
{
"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
- Navigate to Workflows in the sidebar
- Click New Workflow
- Use the visual node editor to drag-and-drop nodes
- Connect nodes with edges
- Configure each node's parameters
- Save and run
Running Workflows
POST /v1/workflows/:id/runjson
{
"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 # CancelStorage
Workflow definitions and instances are persisted to Ledger KV with file-system fallback. Data survives restarts.
API Reference
| Method | Path | Description |
|---|---|---|
| GET | /v1/workflows | List all definitions |
| POST | /v1/workflows | Create definition |
| GET | /v1/workflows/:id | Get definition |
| PUT | /v1/workflows/:id | Update definition |
| DELETE | /v1/workflows/:id | Delete definition |
| POST | /v1/workflows/:id/run | Start instance |
| GET | /v1/workflows/:id/instances | List instances |
| POST | /v1/workflows/:id/instances/:iid/cancel | Cancel instance |