Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.
Workflow Graph v2 — server-native automation
MSO Workflow Graph v2 is MSO's private, server-native visual automation layer. It provides the core self-hosted workflow capabilities normally expected from n8n while keeping MSO's project registry, Linux filesystem, Skills, project knowledge, agents, integrations and capability permissions as the execution authorities.
It is additive: existing deterministic project flows, RASMIC scripts and learned workflow memory remain supported.
Authority and storage
- Workflow Graph owns automation topology, triggers, flow control, node configuration, execution history and graph versions.
- Project registry resolves canonical projects and real server paths at runtime. Portable graph definitions store ids/hints, never installation-specific absolute paths.
- Integrations own credentials and provider connections. Graphs store connection references only.
- Private workflow variables provide runtime values through
{"$var":"KEY"}. Secret variables are never returned by list APIs; short strings, scalar values and structured secret leaves are redacted from execution receipts. - Git remains code SSOT; project knowledge/memory remain their existing SSOTs.
Graphs, versions, variables and execution receipts are private per authenticated principal. Source and builtin templates contain no operator-specific user, credential, path or seeded workflow.
Idempotency keys are scoped to the principal, graph and trigger node; reusing a key with different input or revision still fails. Legacy receipt IDs remain addressable and are reused only for the same graph/trigger. Detailed receipts require their creation scope and device role on every status, waited response, stop, retry and idempotent replay. Owner-era receipts stay Owner-only after demotion, including runs made with a lower scope; legacy receipts require Owner/exec. Viewer execution history remains metadata-only and never returns node outputs or logs.
Delegated write authority excludes the live MSO checkout, Git control files, user-systemd units, user-local CLI launchers, Hermes/OpenClaw runtime trees and parent directories that could replace them. These control-plane mutations require exec authority; canonical symlink targets are checked as well.
Node catalog
Triggers
manual— UI/CLI/MCP runschedule— interval, five-field cron, or one explicit-offsetrunAtinstant; see schedule semantics and recoverywebhook— GET/POST/PUT/PATCH/DELETE server endpoint; requires a bearer token from a private secret variable
Trigger nodes must be roots. Activating a workflow enables its server-side schedule/webhook behavior; drafts remain inert. Stored graphs are data rather than durable privilege grants: execution rechecks the live device role and deployment scope, and unattended stored non-web principals fail closed instead of acquiring fresh exec authority.
Webhook endpoint:
/api/v1/workflows/webhook/<graphId>/<nodeId>
responseMode=onReceived returns a run id immediately. responseMode=lastNode waits for bounded execution and returns only the explicit output-node result. Active webhooks fail closed unless authVariable names a secret-marked string of at least 16 characters; unauthenticated lookup traffic is rate-limited before graph discovery and cannot consume the authenticated execution bucket.
Schedule triggers can drive proactive workflow graphs that target durable agent sessions via agent nodes configured with sessionRef, allowing always-on agent turn cycles without external cron or daemon processes.
Flow control
condition— true/false handlesswitch— named case handles plus defaultmerge— combine, append or pass-through incoming outputsbatch— split up to 1000 items into deterministic batchesloop— execute one bounded tool for each item with concurrency 1–4repeat— execute one saved Workflow Graph repeatedly until a result condition matches, with explicitdone/exhaustedbranches,maxIterations1–50, optional inter-iteration delay, and a hard node duration capwait— delay/until, bounded to ten minutes inside a runsubflow/ Execute Workflow — execute another private Workflow Graph, or a legacy project flowoutput— explicit result collection
Graph edges stay acyclic. Item fan-out uses loop; conditional loop-back uses repeat, which reruns a referenced saved Workflow Graph internally instead of creating an unrestricted graph cycle. repeat always has hard iteration/time bounds and emits done or exhausted. Cross-workflow recursion is rejected with an ancestry guard.
Actions and context
toolproject_functionproject_mcpintegrationscript— execute a saved, validated repo-local RASMIC automation manifest byproject + script_id; the graph stores only the reference, while runtime re-validates the manifest before replayagent— execute an organization seat, a project agent, or target a durable agent session viasessionReffor proactive/scheduled agent turns with history and event audit persistenceprojectfolderskillknowledgedata_table— list/read a persistent owner-private data table or insert/update/delete one bounded row
Project/folder nodes resolve the live canonical server path when the graph runs and can open that real directory in MSO Files/Finder.
Script nodes intentionally do not execute arbitrary shell or browser-supplied JavaScript. The Inspector can search the selected project's .agent/scripts catalog, shows candidate/tested state and step count, and persists the chosen script_id in the graph. Execution delegates to project_script_run, which re-reads the manifest and refuses steps outside the bounded replay-safe RASMIC policy. A successful candidate replay is promoted to tested by the existing script runner.
Agent nodes configured with sessionRef bind turn execution directly to a same-owner durable session: the bounded turn runs via the local session agent seam, serializes via an at-most-one execution lease to avoid interleaving concurrent writes, appends an audit event, and updates the session's durable conversation history.
Repeat Until and saved Session workflows
repeat is the bounded equivalent of a normal while / do...while automation loop:
- Select an existing
workflowIdas the body. A workflow created with Save session as workflow draft is valid after its disabled learned actions have been reviewed and enabled. - The child workflow runs with the configured
inputplusinput.repeat.iterationandinput.repeat.previous. - MSO reads the child workflow's explicit Output node.
pathis resolved against{ result, iteration, previous }; for exampleresult.output.ok. - When
equalsis configured, MSO performs exact JSON equality. Withoutequals, normal truthiness is used. - A match routes
done; reachingmaxIterationsroutesexhausted. A child failure remains a node failure and can use the normal red error branch / retry policy.
Example configuration:
{
"workflowId": "saved-workflow-id",
"input": { "target": "production" },
"path": "result.output.ready",
"equals": true,
"maxIterations": 10,
"delayMs": 30000,
"maxDurationMs": 600000
}
Each child execution has its own persisted Workflow run receipt. The parent repeat receipt stores bounded iteration metadata and the final output rather than duplicating every child receipt.
Data binding
Node config supports safe declarative bindings:
{ "$ref": "nodes.previous.output.value" }
{ "$var": "PRIVATE_VARIABLE" }
Loop arguments additionally support $item and $index.
Secret-like fields such as raw tokens, passwords, API keys, cookies and authorization headers are rejected recursively from stored graph definitions. Credential-backed actions use an integration node referencing an existing MSO integration connection instead.
Retry and error handling
Action nodes may use:
{
"retry": { "maxAttempts": 3, "backoffMs": 1000 }
}
Retries are bounded to five attempts with bounded exponential backoff. A red error output routes a failed node to an explicit error branch. onError: "continue" supports continue-on-fail behavior. A graph can also set metadata.errorWorkflowId to invoke another private workflow after an unhandled failure.
Successful runs finish completed; handled action failures finish completed_with_errors; unhandled failures record the exact failed node and block downstream nodes.
Execution history and observability
Private run receipts retain up to 1000 recent executions and expose:
- trigger type
- graph revision
- queued / running / completed / failed / skipped / blocked node state
- attempts and duration
- bounded node output
- compact logs
- failed node id/name
The Workflows canvas reflects live node state and pulses edges while related nodes run. The Executions panel filters one graph's persisted executions and can reopen a complete receipt. A running local execution can be stopped after its current bounded action. Finished/stopped executions can be retried with their owner-private retained input only while the graph revision still matches, and finished receipts can be deleted.
POST /api/v1/workflows with action: "run" may include expected_revision, the exact saved
SHA-256 graph revision reviewed by its caller. A malformed revision is rejected with 400 and a
changed revision with 409 before an agent session or run is created. Callers that omit this field
retain the existing current-graph behavior. The onboarding project check uses this guard alongside
its stable idempotency key; local progress never substitutes for the server run receipt.
Versions and rollback
Create/update/restore operations save private snapshots. Up to 100 versions are retained per graph. The Versions panel shows timestamp, reason, revision and node count; restore is compare-and-swap against the current graph revision so concurrent edits cannot be silently overwritten.
Templates and AI-assisted creation
The Create dialog supports:
- blank graph
- generic builtin templates
- AI-assisted draft generation using MSO's currently selected model
AI assistance has an isolated workflow-design system prompt, receives no implicit owner-memory recall, emits JSON only, cannot authorize execution, and is validated through the same graph schema. AI-created graphs always start as drafts.
Native Workflows app
/workflows provides:
- private searchable workflow library with description/project/folder/tag metadata, clickable tag chips, and shared query syntax (
tag:,status:,project:,folder:,node:plus free-text AND terms) - draft / active / archived lifecycle
- category-aware node creator with search across Triggers, Actions, AI, Flow and Context
- contextual + quick-add from every executable output/branch; the chosen node is positioned and connected automatically, while trigger-only nodes stay out of after-node suggestions
- draggable canvas with node-family iconography, live execution state, multi-select and collapsible presentation groups
- click-to-connect input/output ports
- persistent per-edge
Auto/Solid/Dashedpresentation, executionActivetoggle, directional arrows and bounded reverse-direction control - true/false, switch and error handles
- structured trigger/action/retry inspectors plus advanced JSON
- real project/folder navigation
- one live Directory for Tools, Workflows, Sessions, Projects and Skills (the same registries used by runtime nodes)
- execution log + persisted history
- graph version restore
- private variable/secret manager
- persistent workflow data-table manager and
data_tablenodes - portable workflow JSON import/export
- execution stop/retry/delete controls
- template and AI-assisted creation
Run automatically saves a dirty graph before execution, so execution always uses the revision visible in the editor. Disabled connections remain visible in the graph and receipts but are excluded from runtime traversal, cycle checks and tidy layout; a target reachable only through disabled connections is skipped rather than silently promoted to a new root.
Canvas construction UX
The native editor follows the same construction rhythm users expect from tools such as n8n without copying n8n code or branding:
- Add node opens a searchable category browser rather than a flat technical type list.
- Hover any executable output and use + to choose the next node in context. Trigger nodes are omitted because a connected trigger would violate the graph contract.
- The new node is placed to the right of its source, connected through the exact branch handle (
true,false, switch case,done,exhausted, or ordinary output), and opened in Inspector immediately. - Node cards separate Trigger / Action / AI / Flow / Context families visually and surface running/completed/failed state without changing the stored definition.
- Multi-select grouping remains presentation-only. Selecting a collapsed group makes it manageable directly on the canvas; expanding restores its original executable members and ports.
The result is a fast visual-builder path while the saved Workflow Graph remains the execution SSOT. There is no hidden browser-local automation state.
Dedicated n8n workspace
n8n is a separate first-class MSO app at /n8n; it is no longer mounted as a sibling tab inside native Workflows. /workflows now always opens the native Workflow Graph editor, so external editor loading, authentication, or frame policy cannot shrink or replace the native canvas.
Reviewed n8n presentation metadata still uses the owner-private surface registry in lib/surfaces/config.ts. New n8n registrations should use "placements": ["n8n"]. The compatibility reader also accepts an existing n8n registration using the legacy "workflows" placement so operators can migrate without losing access. The registry contains presentation metadata only; Integration credentials are never returned through this surface.
The dedicated n8n app keeps the same cookie-isolation rule: a reviewed external destination is blocked when it would receive the MSO cockpit session cookie. n8n retains its own login and cookies; MSO does not proxy credentials or remove upstream frame/security headers. If embedding is unavailable, the app exposes the reviewed top-level destination instead.
Native feature ownership is documented in N8N-PARITY.md: Workflows owns automation topology/execution/history/versions/variables, Organization owns units/seats/projects/routing context, and Integrations owns credentials/connections.
CLI
mso workflow list
mso workflow embeds
# Review a metadata-only app and use the revision above:
mso workflow embed-save --input @reviewed-embed.json
mso workflow show <id>
mso workflow catalog --query webhook
mso workflow templates
mso workflow template webhook-router
mso workflow create --input @workflow.json
mso workflow save <id> --revision <rev> --input @workflow.json
mso workflow run <id> --input '{}' --key operation-001 --wait
mso workflow runs <id>
mso workflow versions <id>
mso workflow restore <id> --revision <current> --version <saved>
mso workflow variables
mso workflow variable-set WEBHOOK_TOKEN --input '"secret"' --secret
mso workflow variable-delete WEBHOOK_TOKEN
mso workflow ai --prompt "Every weekday inspect project health and route failures"
MCP
MSO deliberately keeps this capability behind one compact MCP tool to preserve the public schema budget:
workflow_graph
Actions:
list, search, get, create, update, delete, clone, optimize_preview, optimize_clone, run, status, runs, stop, retry, run_delete, versions, restore, catalog, scripts, templates, create_from_template, variables, variable_set, variable_delete, data_tables, data_table_get, data_table_create, data_table_delete, data_table_row_upsert, data_table_row_delete. list and search accept the same workflow query/filter semantics used by the UI; scripts returns safe RASMIC manifest summaries for an exact project without exposing raw script files or credentials.
The linear flow_catalog, flow_manage, flow_run and flow_status tools remain compatible for small deterministic project-owned sequences.
Flow Optimizer
Flow Optimizer is a review-first compiler pass over an existing Workflow Graph. It does not replace the graph engine, planner, capability catalog, permissions or confirmation policy.
optimize_preview analyzes an exact saved graph revision and returns bounded candidate transformations, per-candidate probability, risk class, before/after counts and whether deterministic fallback was used. It never mutates the graph. optimize_clone repeats the analysis against the exact current revision and creates a new draft graph; the source graph is never overwritten.
Two candidate classes exist in v1:
- Safe / presentation-only — consecutive action/context nodes may be wrapped in a collapsed
metadata.customNodesgroup. Original executable nodes, edges, arguments and run receipts stay unchanged. - Review / structural — three or more consecutive calls to the same read-only MSO tool may be compacted into one sequential
loopnode containing the exact already-prepared argument objects. This changes the output shape and therefore requiresapply_review=true. Write/exec tools are not eligible.
Decision modes:
deterministicis always available and uses local policy scores.jevsends only the compact workflow summary plus host-generated candidate descriptions to TypeSafe Jev through OpenRouter’s Decisions API by default. The OpenRouter key comes from the exact Settings → AI / Integrations → AI Providers credential store. Graph arguments, credentials and capability authority stay in MSO. Jev can score host-generated candidates; it cannot invent a new tool call, alter arguments, authorize an action, or execute anything. The preview also computes a deterministic shadow baseline and reports agreement/disagreement.- If the Jev call fails or returns no usable probability, the preview records
provider: fallbackand uses the deterministic scores.
For Jev, connect OpenRouter once in Settings → AI or Integrations → AI Providers. Both surfaces use the same server-side credential store. MSO calls ~typesafe/jev-latest through OpenRouter’s Decisions API and never creates a second Jev/TypeSafe key store. Existing JEV Integration Variables and named MCP Jev connections remain supported only as explicit diagnostic/legacy overrides; they are no longer the default path. Neither path stores credentials in a Workflow Graph.
The native Workflows UI exposes Optimize and a Flow Optimizer detail panel. Dirty graph edits are saved before opening the optimizer so preview/clone always operate on the revision the user can see. Jev mode shows OpenRouter Jev as the normal path, with explicit named-MCP fields retained only under a legacy/diagnostic override.
Workflow Sessions also retain a mso.jev-session-capsule.v1 value packet after JEV preservation. The packet is exact-source checksum-bound and includes bounded semantic steps/tool routes/artifact refs plus the LLM continuation packet. It is surfaced in Workflow Sessions and automatically attached by agent_session_resume when still current. A zero-recommendation JEV result therefore still has reusable semantic value; it is not treated as permission to delete the source session.
The separate MCP capability jev_action is a policy gate, not an autonomous agent. propose scores only caller/host-supplied structured capability candidates and never executes. execute requires the server-held proposal id, rejects expired or capability-digest-stale proposals, and permits only selected safe non-destructive read capabilities. The call re-enters the normal MSO Capability Runtime, so token allowlists, argument constraints, workflow correlation and rate limits stay authoritative. Write/review/destructive candidates return to the normal explicit tool flow. Post-action Jev verification is a semantic signal alongside—not instead of—deterministic execution status.
Automatic learning
workflow_start still checks reusable automation before performing exploratory work. Successful workflow_finish learns a sanitized route, updates private procedural memory and creates/deduplicates a private draft graph candidate. Learned workflows never auto-activate or bypass normal scope/authz checks.
Scope of n8n parity
MSO targets core self-hosted workflow parity, not visual cloning or n8n's SaaS business surface. The native editor intentionally matches the high-value interaction model: searchable categorized node creation, contextual insert-and-connect, explicit branch handles, drag/connect/tidy/minimap canvas controls, run-state overlays, execution history, retry/error routing, reusable Execute Workflow, Loop Over Items, Split In Batches, Merge, If/Switch, Wait, schedules/webhooks, variables, and previous-node data references.
MSO intentionally uses its own server-native Project, Folder, Skill, Agent, Organization-seat, RASMIC and Integration nodes instead of reproducing n8n's marketplace or cloud billing/team-administration products. n8n's richer drag-and-drop input/output data mapper and full community-node ecosystem are not claimed as native parity today. Free cyclic graph topology is also intentionally replaced by bounded Loop/Repeat/Execute-Workflow constructs for safer unattended server execution. A reviewed external n8n editor can still be mounted as a sibling Workflows tab when an owner wants the original n8n surface.
Organization seat routing
Organization is not owned by Workflow Graph. An agent node may set orgSeatId; at execution time MSO resolves that seat from the private Organization registry and routes to its current Project Agent, Local Agent, or A2A target. This indirection lets a workflow say “send to the CTO seat” without duplicating which concrete agent currently fills that seat. Direct project-bound Agent nodes remain backward compatible. See ORGANIZATION.md.
External editor credential isolation
Different origins do not by themselves isolate cookies. Reviewed external editors must
be outside the currently validated OS_SESSION_COOKIE_DOMAIN and must not reuse a cockpit
hostname on another port when cookies are host-only. MSO blocks both framing and editor/login
links for colliding destinations and shows the configuration reason. Signed browser sessions
are also bound to a durable cookie-policy generation. Widening, narrowing or unsetting the
Domain rotates that generation in the private auth store; returning later to an earlier Domain
rotates it again, so retained/captured tokens from that older generation never revive. Shared
MCP Page discovery uses the same boundary. Registry review is not a credential-sharing exception; native managed-app/
browser proxy routes keep their separate existing authentication boundaries.
Selected custom nodes and connector routing
One or multiple selected nodes can become a named, collapsible custom node directly
on the automation canvas. Ctrl/Cmd-click or box-select, then Create custom node.
The selection survives rerenders. Double-click the compact card to expand it;
Ungroup removes only the wrapper. Save persists the change as ordinary graph data.
metadata.customNodes stores {id,name,nodeIds,collapsed} arrays, validated against
the same graph. Members cannot belong to overlapping/nested groups.
This is a presentation abstraction, not an executable new node type: stored node ids,
configurations, boundary handles, input references, edge topology and run receipts stay
unchanged. Original members execute in the original graph. Clone/export/import carry
the grouping metadata. The existing workflow_graph get/update actions provide function
calling with the current revision; no new transport or permission bypass is introduced.
The shared connector renderer avoids measured node cards where a route exists, uses arrowheads and crossing halos, and highlights a selected node's incident routes. Overlapping cards without a viable port exit receive a visible routing warning.