Skip to content

Deleted workflow reappears after daemon restart #1192

@nimitbhardwaj

Description

@nimitbhardwaj

Description: When a workflow is deleted via the web dashboard or API, it disappears from the UI. However, after restarting the openfang daemon/gateway, the deleted workflow reappears. This happens because the workflow's .json file is not removed from ~/.openfang/workflows/ when the workflow is deleted.

Expected Behavior: A workflow should remain deleted after deletion, even after daemon restart.

Steps to Reproduce:

  1. Create a new workflow via the web dashboard
  2. Verify the workflow's .json file exists in ~/.openfang/workflows/
  3. Delete the workflow via the web dashboard
  4. Verify the workflow disappears from the dashboard UI
  5. Check that the .json file still exists in ~/.openfang/workflows/ (BUG: file not deleted)
  6. Restart the openfang daemon/gateway
  7. Observe that the deleted workflow reappears in the dashboard

Root Cause:

  • remove_workflow() in crates/openfang-kernel/src/workflow.rs:235-238 only removes from in-memory HashMap, does NOT delete the .json file
  • Workflow creation in crates/openfang-api/src/routes.rs:985-1001 correctly persists to disk
  • On startup, load_workflows_from_dir() in crates/openfang-kernel/src/kernel.rs:4634-4650 loads all .json files, re-importing "deleted" workflows

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions