Visual node-based workflow canvas for DSH with sub-agent calls, code execution, branching, loops, scheduling, and workflow import/export.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:CodermanYHZ/dsh-node-flow
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
A visual, executable node-based workflow canvas for DeepSeek Harness
Compose triggers, sub-agents, Python code, conditional branches, loops, schedules, and listens with drag-and-drop nodes, then run the complete workflow directly in DSH.

Overview
DSH Node Flow is a visual workflow plugin for DeepSeek Harness (DSH). It combines agent calls, Python scripts, conditions, loops, and scheduled or listened triggers into executable flow diagrams, making it easy to build automation tasks and multi-step agent workflows.
Features
- Visual orchestration — drag nodes, connect handles, and inspect data and execution paths directly on the canvas.
- Sub-agent calls — agent nodes can inherit the current model or select a model route configured in DSH.
- Code nodes (Python) — run Python on the host, feed it the upstream value and return stdout, with a full-screen code editor.
- Flow control — built-in If, Switch, Loop, and While nodes cover branching and iteration.
- Execution feedback — nodes display their run state, and the actual path taken is highlighted.
- Failure policies — Code and Agent nodes support timeouts, retry count/delay, and either stopping the branch or continuing with an empty value.
- Scheduled tasks — save workflows with five-field cron expressions, inspect them in the task board, run them immediately, end, or resume them.
- Listen triggers — a listen node keeps a Python process resident and fires one run per stdout line, which suits polling files, queues, or endpoints.
- Built-in examples — the workflow library ships example templates; opening one and saving creates your own copy.
- Import and export — save workflows as files for backup, sharing, and reuse.
- Built-in documentation — the help panel explains the execution model, node fields, connection rules, and complete examples.
Screenshots
The canvas defines no palette of its own: background, surfaces, text, borders and accent all
come from the host's --dsw-alias-* theme tokens, so it matches the shell in both light and
dark and follows a theme change.
Node properties
Select a node to configure its label, model, prompt, timeout, and failure policy in the right-hand inspector.

Scheduled tasks and listens
The scheduled-task board displays cron plans, previous trigger times, and latest run results, plus the logs and events of listener processes, with actions to run once, end, resume, or delete a task.

Quick start
Compatibility
This version targets DSH 0.2.x (engines.dsh in package.json requires >=0.2.0-rc.2). The host half relies on:
| Capability | Uses | Note |
|---|---|---|
| Code nodes | a host Python subprocess (python -u -c) |
upstream input arrives in DSH_INPUT, stdout is the node result; python → python3 → py are probed in order |
| Agent nodes | ctx.subagents.startActivation |
subagents.start() was removed; the child's result comes back with delivery: 'caller' |
| Model dropdown | ctx.llm.listProviders() / listModels() |
listProviders() is synchronous in 0.2.x |
| Sidebar entry and canvas | the main + sidebar.panellist slots |
no shell DOM or class names are read any more (sidebarCol / logoRow no longer exist) |
The minimum host version is declared in package.json under engines.dsh.
Installation
Install from a local directory or from Git until the package is published to npm:
dsh plugin --profile <profile> add /path/to/dsh-workflow-canvas
dsh plugin --profile <profile> add git+https://github.com/CodermanYHZ/dsh-node-flow.git
When running DSH from a DeepSeek Harness source checkout, prefix the command with
pnpm, for example pnpm dsh plugin --profile <profile> add <path>.
Restart the Web UI after installation (dsh web; pnpm dsh web for a source checkout).
A Node Mode icon appears in the DSH sidebar; clicking it opens the canvas in the central column.
Diagnostics
On activation the plugin writes a capability snapshot to
$DSH_HOME/workflow-canvas/health.json; selfTest.ok records whether a real
Python execution succeeded (selfTest.python carries the interpreter version) and
revision is the loaded plugin build. The same report is served by
GET /dsh-node-flow/health. Check it first when a Code node reports a missing Python
interpreter.
Basic usage
- Click Add Node to pick a node kind; 📂 Workflows opens your saved workflows and the built-in examples shipped with the plugin.
- Connect node handles and configure parameters in the right-hand inspector.
- Click ▶ Run and watch the node states and highlighted execution path.
- Use Export to save the workflow as a file, or create a cron schedule from Scheduled Tasks.
Built-in examples live in the repository's examples/ directory and ship with the package. They are marked “内置” in the library and are read-only: opening one and pressing Save writes a new workflow instead of modifying the file inside the package.
Execution Workspace and runner session
Agent nodes do not delegate from "whatever agent happens to be live". The 📁 Workspace selector in the toolbar decides which Workspace a run belongs to:
- Each Workspace owns one node-mode runner session, titled
节点模式运行会话 · <workspace>and listed among that Workspace's sessions. - The first Agent-node run in a Workspace creates it; later runs reuse it; if it is archived or can no longer be revived, the next run creates a fresh one.
- Creation sends one one-off bootstrap message (
节点模式运行会话已就绪…). That is not decoration: the sidebar does not render a session that has no messages, and a runner session never gains any on its own (children hand their result back to the canvas withdelivery: 'caller'), so without it the row would stay invisible forever. - Agent nodes execute as children of that session, so they inherit the Workspace's
directory and sandbox write boundary. That inheritance is the only way to direct a
child: the host ignores
startActivation'scwdargument. - The choice is saved as
executionWorkspaceIdin the workflow document, so export, import and scheduled runs all use the same Workspace.
Bindings live in $DSH_HOME/workflow-canvas/settings.json; the runner section of
GET /dsh-node-flow/health reports each Workspace's session id, liveness and visibility.
Scheduled tasks, listens and run history
A scheduled task does not poll "does the current minute match the cron?". It persists the
next occurrence (nextFireAt) and a single timer compares that anchor with now:
- The anchor advances and is persisted BEFORE the workflow runs, so a crash costs that one run instead of replaying the same occurrence forever.
- An occurrence missed while the host was stopped or the machine asleep is delivered once on the next wake-up (not N times), then the anchor jumps to the next future time.
- If the previous run of the same task has not settled yet, the new occurrence is skipped and logged, so one workflow cannot execute concurrently with itself.
- Cron is matched in the host's local time zone; the document's
timezonefield is stored but not used yet. - Every run is stored in
$DSH_HOME/workflow-canvas/runs/<runId>.jsonwith its own graph snapshot, each node's status/duration/output/error, and the final output; 30 days and 200 records are retained, older ones pruned. - Runs of scheduled tasks and listeners are listed under their own panel entries, where you can inspect node details or replay them on the canvas without touching the graph being edited.
- Manual runs are persisted the same way, but they belong to no scheduled task, so they do not
appear in the task list — read them from
runs/instead.
Listen triggers
A listen node keeps a Python process resident; one stdout line is one event, and each event runs the whole flow:
- Lines starting with
[ready]only record state and never fire. - Events arriving within
minIntervalMs(default 500ms) collapse onto the newest one; the queue holds at most 5 entries. - Events run strictly one at a time; if the process exits, the listener turns into an error and stops.
- Start, stop, restart or delete it in the Scheduled / Listen board; stopping remembers the intent and the host tries to restore it on the next start.
Node types
| Node | Purpose |
|---|---|
| Trigger | Starts the workflow and passes its content downstream. |
| Schedule | Runs the complete workflow using a five-field cron expression. |
| Listen | Keeps a Python process resident; one stdout line fires one run. |
| Agent | Calls a DSH sub-agent using the inherited model or a selected model route. |
| Code | Runs Python on the host, reads upstream input (DSH_INPUT) and returns stdout. |
| If | Routes the workflow to true or false based on a truthy condition. |
| Switch | Matches a value against cases and falls back to default. |
| Loop | Iterates over an array or repeats N times, optionally collecting each result. |
| While | Repeats while a condition remains true, guarded by maxIters. |
| Output | Renders the upstream value using a {{result}} template. |
| Note | Adds a canvas annotation and is not executed. |
Code node (Python)
Code nodes run on the host as python -u -c <code>. The upstream value arrives in the
DSH_INPUT environment variable (non-string input is JSON-encoded first), and stdout, with
surrounding whitespace trimmed, is the node result:
import json, os
raw = os.environ.get("DSH_INPUT", "") # output of the upstream node
print(json.dumps({"length": len(raw)}, ensure_ascii=False))
- A node fails only when the process exits non-zero or times out; the error text comes from stderr (a zero exit ignores stderr entirely).
- The node's
timeout(seconds) bounds a run; a 600-second hard cap applies on top. - The legacy
languagefield is ignored — everything runs as Python.
Node fields, handle names and expression syntax are documented in the in-app 📖 guide; that document is the source of truth.
Runtime requirements
The plugin expects the DSH host to provide these services:
ctx.webServerfor the same-origin routes between canvas and host- a Python interpreter on the host PATH for Code and Listen nodes (
python → python3 → py) ctx.agentsandctx.subagentsfor Agent nodes (viastartActivation)ctx.llmfor the model-route list behind the Agent node's dropdown
The client half needs the slots service (main and sidebar.panellist) and,
optionally, layout for the panel's close action.
React, ReactDOM, and @deepseek-ai/cordis are provided by DSH as peer dependencies.
Local development
npm install
npm run dev # Start the standalone Vite preview
npm run build # TypeScript checks + client bundle + demo build
Built-in examples are plain workflow documents in examples/*.json: edit one and the change is live, no code regeneration needed. Adding an example means adding a JSON file.
License
Released under the MIT License.
Links
More in this category
loopx-project/loopx#dsh-loopx-plugin★ 6769
LoopX, a provider-neutral, local-first state kernel and control plane for long-horizon agents: keeps Goal, Todo, gate, evidence, quota, recovery, and handoff state above DeepSeek Harness, while the plugin bootstraps the CLI and skills, admits bounded same-session continuation, and adds a loopback GoalBar for the exact bound loop. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
Q00/ouroboros#integrations/dsh-plugin★ 6389
Config-only bundle that mounts Ouroboros through the DSH MCP client, exposing 36 interview, Seed, execution, evaluation, and evolution workflow tools in DSH.
chuspeeism/dashi-taskboard#deepseek-harness★ 3539
Embeds the active installed Codex Taskboard runtime in the DeepSeek Harness sidebar, using its launcher runtime descriptor instead of a fixed port.
NanmiCoder/dsh-agent-teams★ 3120
AgentTeams multi-agent teams.
EthanYoQ/AI-Novel-Writer#dsh-ai-novel-writer★ 2944
Installs a dedicated AI novel-writing preset and workbench: revisioned local project assets, a compact side drawer, and native approval-gated single-file changes.
shanliuling/dsh-image-gen★ 1798
Native conversational image generation for DeepSeek Harness: ask the agent to create an image, and it handles generation and keeps the result directly in the conversation.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.