Skip to content

feat(ui): add workflow sessions, editor, and prompt links to the config tab - #263

Open
alexinthesky wants to merge 7 commits into
mainfrom
002-workflows-ui-v2
Open

alexinthesky wants to merge 7 commits into
mainfrom
002-workflows-ui-v2

Conversation

@alexinthesky

@alexinthesky alexinthesky commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Sessions and editor increment for the Workflows feature (#260, #261): the config tab now shows each workflow's execution sessions, opens them in the chat, edits full workflow configs, and jumps to the prompt editor. Also drops the redundant orgId entry field — Grafana provisions app settings per org, so a workflow always runs in the org that owns its settings.

What this adds

  • Sessions per workflow: each row expands into its recent runs (GET /api/workflows/{name}/runs, Admin only, newest first: status, time, terminal error) with an Open button that deep-links the chat (?sessionId=).
  • Admin read for workflow sessions: GET /api/sessions/{id} allows Admins to read workflow-conversation sessions in their own org (the synthetic owner would otherwise make them invisible); interactive sessions stay owner-scoped — an Admin still gets 404 on another user's chat. GetSessionUnscoped added to both stores, used only by this path.
  • Full config editor: create, edit, delete workflow entries in the tab — every field (skill picker from enabled skills, message, model, interval, timeout, cap, iteration budget, allowlist, spawnable skills, fallback). The name is immutable after creation (renaming would orphan the synthetic user's sessions). Saves persist the whole list losslessly through the standard settings path.
  • Edit prompt: jumps from a workflow to the Skills tab with that skill's editor open (focusSkill).
  • orgId removed from entries, the status API, and the editor: the workflow runs in the owning org's instance; the instance identity (org, URL, SA token) seeds from that org's requests (OrgIdentityStore is now the single-org instance binding). The tenant payload in Consensys/w3f-observability#810 drops the field in the same change.
  • Provisioning fix: the dev asko11y provisioning moves from provisioning/plugins/app.yaml to provisioning/apps/asko11y.yaml — the legacy plugins path silently drops secureJsonData, so the redisURL never reached the plugin in dev.
  • Runs panel error state: a failed runs listing reads as an error, not as an empty history (found while testing: a stale backend binary made the fetch fall through to the default handler and the UI showed "No sessions recorded" for a running workflow).

RBAC statement (constitution III)

Action Admin Editor Viewer Enforcement
Read GET /api/workflows and /api/workflows/{name}/runs yes no no isAdmin, pkg/plugin/workflow_status.go
Read a workflow session (GET /api/sessions/{id}) yes (workflow sessions, own org only) owner only owner only admin branch in handleSessionRouter, test TestAdminMayReadWorkflowSessionsOnly
Edit workflow entries (settings save) yes no no Grafana app settings, AppConfig page role

Gates

Gate Result
go test ./pkg/... all packages pass
golangci-lint run ./pkg/... 0 issues
npm run test:ci 596 pass (7 Workflows tab tests)
npm run typecheck / lint / lint:standards clean / 0 errors / clean
npm run build / build:backend / validate:openapi / validate pass
npm run e2e 46 pass
node scripts/verify-retro-specs.mjs pass

Spec 002 amended (Stories 9 and 10, FR-019 to FR-026, FR-001 org note); retro 111 (admin read rules 33-34), 110/114/125 (provisioning path move) updated.


Note

Medium Risk
New admin-only share endpoints expose read-only session transcripts, and org identity is now instance-scoped—workflow scheduling behavior changes for multi-org config that relied on per-entry orgId.

Overview
Adds admin APIs to inspect and open workflow runs: GET /api/workflows/{name}/runs lists recent runs (session id, status, errors), and POST .../runs/{runId}/share get-or-creates a read-only share for the run’s session so the Workflows tab can navigate to the shared-session view without cross-owner session reads.

Org semantics are simplified: WorkflowEntry no longer carries orgId; OrgIdentityStore holds a single per-instance org/URL/service-account binding seeded from the first request, and schedulers/sessions use that org everywhere.

Durability fixes: Redis session blobs now round-trip conversationType and workflow; workflow list status counters are rebuilt from the run store (timeouts counted separately) so they match the runs panel after restarts.

The Workflows config tab grows a full entry editor (create/edit/delete), expandable Sessions rows with Open-via-share, Edit prompt jumping to the Skills tab (focusSkill), and surfaced errors when run listing fails. OpenAPI and specs/tasks are updated to match share-based opening and the dropped orgId field.

Reviewed by Cursor Bugbot for commit ab8fedb. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread pkg/plugin/workflow_status.go Resolved
Comment thread src/components/AppConfig/Workflows.tsx Resolved

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread pkg/plugin/workflow_status.go Resolved
Comment thread pkg/plugin/workflow_status.go Resolved

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ab8fedb. Configure here.

return
}
hours := 30 * 24
share, err := p.shareStore.CreateShare(run.SessionID, data, orgID, synthetic, &hours)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Share snapshot omits live run transcript

High Severity

handleWorkflowRunShare snapshots the stored session and reuses the first unexpired share for that session. Assistant output and tool results are only appended after the loop finishes, so an Open during a running run (or reuse of an early share_session link) freezes a prompt-only transcript for 30 days. The existing share_session path already merges workflowRunTranscript for this reason; this handler does not.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ab8fedb. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant