Repository navigation
Let chat orchestration propose workflows with an Approve, Deny and Edit card #1547
Description
Summary
Part of #1543 (Phase 4). Add a workflow deliverable and a workflow_propose capability so a V2 chat orchestration plan can propose a saved workflow. The proposal renders as a card the user must decide on: Approve (Create & start or Create paused), Deny, or Edit in the V2 workflow editor.
User Value
"Every Monday read my email and tell me what to do this week" gets this week's answer right away, plus a card that sets up the recurring workflow. The user doesn't need to know workflows exist or how to build one, and nothing is created without an explicit click.
Proposed Behavior
-
Planner context:
- a bounded, metadata-only catalog of the user's workflows (the MCP summary shape, following the action-catalog pattern in
functions_action_catalog.py:259-298), so the planner can suggest an existing workflow instead of a duplicate - a sanitized File Sync source catalog
- the user's validated browser timezone on RunContext
- a bounded, metadata-only catalog of the user's workflows (the MCP summary shape, following the action-catalog pattern in
-
Deliverable kind
workflowinfunctions_orchestration_deliverables.pyand the V2 plan types, with closed unavailable reasons. -
Capability
workflow_propose(Render):- gated by
enable_chat_orchestration,allow_user_workflows, and a newenable_chat_orchestration_workflowsthat defaults to False. An empty capability allowlist means "all", so without the new setting an upgrade would turn the capability on silently. - requires the WorkflowUser role from RunContext
- at most one per plan, with a static blueprint input that can't consume upstream outputs
- its adapter only runs the Phase 2 dry run. It never touches Flask and never writes.
- gated by
-
Routes for accept, status and draft (for Edit), plus deny persistence. Accept mirrors the image-proposal route:
- authenticate, then authorize the conversation
- load the run and step on the server, and confirm the proposal belongs to that run
- confirm the clicker is the requester, and check the role
- rebuild and validate
- create with a deterministic
uuid5(user, proposal_id)ID, so a double click creates one workflow, and write provenance
Status is a point read of that ID, so there's no new container and no deployer change.
-
V2 card that discloses the schedule and timezone, runner and agent, actions and effective Microsoft 365 sources, whether it can send anything, Run as, alerts and runs per month. Calls to action cover Connect Microsoft 365 and Run-as approval.
-
Creating from chat always needs this manual decision, even when plan approval is Auto.
Acceptance Criteria
- "Every Monday read my email…" returns this week's preview plus a card, and Approve creates exactly one workflow that runs Monday at the chosen local time and notifies.
- Deny and Edit behave as described, and reloading the chat shows the correct card state.
- Only the requester can act on the card.
- Double submits and retries create one workflow.
- Functional tests (registry and admin option equality, adapter never touches Flask, accept checks), route policy tests for every new route, and Playwright coverage of the card.
-
enable_chat_orchestration_workflowsdocumented (docs/admin/*,docs/_data/features.yml, regenerated inventory), guide update, feature doc, release notes andconfig.pyversion.
Notes
- Roadmap: §6, Phase 4. Related gotchas in §8: 2, 4 (Microsoft 365 setup), 5 (persistent prompt injection), 6 (Auto plan approval), 7 (thread and identity boundary), 8 (shared conversations), 10 (duplicates), 17 (stale proposals), 18 (
test_orchestration_actions_admin.pymust match new registry IDs). - Open decision (§9), with the recommendation: proposals expire after 14 days, and Deny state persists with the run output.
- Depends on: Phase 2 (Add a workflow draft service: dry-run build, blueprint builder and provenance #1545). Phases 5 (Let chat orchestration run existing durable workflows #1551), 6a (Post workflow results back into chat and answer follow-ups from them #1546) and 7 (Hand off big one-time jobs from chat to a durable workflow #1549) depend on this.
- Related: Complete the orchestration harness with Gather, Reason, Render and explicit file creation #1509 (orchestration harness: Gather, Reason, Render), Introduce turn-level orchestration across chat capabilities #1021 (turn-level orchestration), Split Microsoft 365 actions with sharing approvals, live file RAG, and delegated workflow execution #1493 (Microsoft 365 delegated workflow execution).
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn review
Activity
Address CodeQL notes on the Phase 4 changes
Author personal File Sync in the V2 workflow editor
Add workflow planning context and browser time zone to orchestration
Move Phase 4 to reserved version 0.261.204
Add the workflow deliverable kind to orchestration
1 remaining item
Add the workflow_propose orchestration capability
Add workflow proposal routes and decisions
Add the workflow proposal card under orchestration answers
Answer a workflow preview against the request's local time
Move Phase 4 to reserved version 0.261.206
Merge V2 (2f8dab4, 0.261.204) into Phase 4
Move Phase 4 to reserved version 0.261.207
Offer the workflow planner only documents the user named
Add the Propose Workflows From Chat admin switch and document proposals
Merge V2 18dac67 into Phase 4
Approve workflowProposalLink as a same-origin URL builder
Test personal File Sync on structured drafts and in the Changes tab
Describe no_suitable_agent as a card reason, not a plan failure
Stub log_workflow_creation for tests that import the orchestration ro…
Mirror Phase 4's personal File Sync save in the assist projection