Skip to content

Workflow builder cannot view or edit global workflows from ~/.archon/workflows #1556

@guanghuang

Description

@guanghuang

Summary

Global workflows appear in the Web UI workflow list, but opening them in the workflow builder can fail because the workflow detail endpoint does not resolve home-scoped workflow files.

Problem

Archon workflow discovery includes home-scoped workflows from:

~/.archon/workflows/

Those workflows are returned from GET /api/workflows with source: "global".

However, GET /api/workflows/:name, which the workflow builder uses to load the DAG/editor view, only checks:

  • project workflows under <cwd>/.archon/workflows/<name>.yaml
  • bundled/default workflows

It does not check:

~/.archon/workflows/<name>.yaml

So the workflow can show in the list but fail to open for viewing/editing.

Expected Behavior

A workflow listed with source: "global" should be viewable in the workflow builder.

When saving edits to a global workflow, the builder should preserve the source and write back to:

~/.archon/workflows/<name>.yaml

Actual Behavior

Global workflows are discoverable in the list, but the builder detail load can return Workflow not found.

Impact

Users who keep reusable workflows in global Archon config cannot reliably view or edit those workflows from the Web UI DAG builder.

Proposed Fix

  • Update GET /api/workflows/:name to search home-scoped workflows before falling back to bundled defaults.
  • Add source-aware save/delete support for global workflows, e.g. source=global.
  • Preserve loaded workflow source in the Web UI builder so saving a global workflow writes back to global scope.
  • Ensure global commands remain visible in the workflow builder command library.

Validation

Add route coverage for:

  • loading a global workflow from ARCHON_HOME/workflows
  • saving a workflow with source=global

Also verify:

bun test packages/server/src/routes/api.workflows.test.ts
bun run type-check

Notes

This issue is limited to global workflow view/edit behavior. Project-level workflow editing already works. Bundled/default workflows should remain non-editable in place or be saved as user workflows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority - Backlog, when time permitsarea: workflowsWorkflow enginebugSomething is broken

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions