Skip to content

Add an AI workflow assistant to the V2 workflow editor #1548

Open

Description

@paullizer

Summary

Part of #1543 (Phase 3). An Ask AI side channel in the V2 workflow editor, modeled on Score's assisted editing. The assistant edits the unsaved draft, every AI change is highlighted with its previous value, each AI turn can be undone, and saving AI changes asks for confirmation.

User Value

Workflow definitions have many fields: triggers, tasks, runners, references, alerts and Run as. An assistant lets a user say what they want ("run this at 7 AM on weekdays and only alert me when something is urgent") and see exactly what changed, instead of hunting through the editor. Highlights and per-turn undo keep the user in control, which matters because a workflow keeps running long after the edit.

Proposed Behavior

  • 3a: change tracking in the editor, useful even without AI. Built on WorkflowAuthoringSession:
    • stable-ID descriptors and a diff against the opened baseline
    • attribution, so AI changes and your own edits are highlighted differently (manual changes show as "Edited")
    • WorkflowChangedField highlights, Removed · Restore rows, a Changes tab, and Revert
  • 3b: assist endpoint, POST /api/user/workflows/assist:
    • allowlisted operations only (roadmap §5). The server applies them, dry-run validates through the Phase 2 service, and allows one correction round.
    • 409 when the editor's base is stale
    • # references go through the A2 authorizer as request-local handles, placed according to the wording of the request
    • never writes. The route has @swagger_route(security=get_auth_security()), login_required, user_required, enabled_required('allow_user_workflows') and workflow_user_required.
    • 1 request in flight and about 20 per 10 minutes per user, with content-free telemetry through log_event
  • 3c: Ask AI tab, built on the A1 assist thread:
    • a change card per turn with Jump to and Undo this change
    • focus on one task, quick actions, and Draft with AI on an empty task
    • the editor is locked while a turn runs, with Cancel
    • save confirmation for AI changes, including the Run-as re-approval warning when it applies
  • The transcript is session-only in v1, so there's no new container. The saved workflow stays the permanent record.
  • Ask AI is hidden for group workflows until Phase 8.

Acceptance Criteria

  • "Run this at 7 AM on weekdays and only alert me when something is urgent" changes the schedule and alert fields, highlights each with its previous value, and can be undone as one turn or reverted field by field.
  • Saving AI changes goes through the normal save path after a confirmation that includes the Run-as re-approval warning when it applies.
  • "Compare every new document against #checklist" adds it as a shared reference the review task uses, "investigate #incident-report" binds it to one task, and an ambiguous request gets a question instead of a change.
  • Escalation attempts (forbidden fields, documents the user didn't reference) are rejected.
  • Functional tests (change-set validation, escalation rejection, re-approval warnings), route policy tests, and Playwright coverage.
  • Admin setting documented (docs/admin/*, docs/_data/features.yml, regenerated inventory), a guide under docs/guides/, feature doc, release notes and config.py version.

Notes

Activity

  1. moved this from In progress to In review in Simple Chat Roadmapon Sep 29, 2026
  2. paullizer commented on Oct 1, 2026

    @paullizer
    ContributorAuthor

    Phase 3 complete

    All three parts are merged into paullizer-react-v2-ui:

    Acceptance criteria

    • The "7 AM on weekdays" request changes the schedule and alert fields, highlights each with its previous value, and can be undone as one turn or reverted field by field (3a, 3c).
    • Saving AI changes asks for confirmation first, with the Run-as re-approval warning when it applies, then goes through the normal save (3c).
    • # references: a shared reference, a reference bound to one task, and a question back when the request is ambiguous (3b, 3c).
    • The server rejects escalation attempts, such as forbidden fields and documents the user didn't reference (3b).
    • Functional, route policy and Playwright tests.
    • Docs: the admin setting, features.yml, the regenerated inventory, an "Ask AI to change a workflow" section in docs/guides/create-a-workflow.md, WORKFLOW_AI_ASSISTANT.md, release notes and the version.

    Validation on #1593's final head (a9dd15b)

    • Functional tests: 33 passed (Ask AI 7, server parity 12, assist thread 14), under both normal Python and -O.
    • Playwright: Ask AI 32, proposal 3 and proposal card 22, all passing.
    • Every non-equivalent mutation tried in review was caught.
    • CI: 11/11 checks passed, and CodeQL reported no new alerts.

    Follow-ups (not blocking)

    • /api/workflows/draft-instructions doesn't check Enable AI Workflow Assistant on the server. V2 hides Draft with AI when the assistant is off, but a direct call, or the classic workspace's Draft Workflow Instructions button, still drafts. A separate PR will add the check for personal workflows.
    • Disable Reload while a save is in flight.
    • The other items in Phase 3c: Ask AI tab in the V2 workflow editor (0.261.211) #1593's Follow-ups section.

    This issue is ready to close.

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

Metadata

Metadata

Labels

P1Priority 1: urgent, address before P2 workenhancementNew feature or request

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions