Skip to content

Commit 1e3db39

Browse files
authored
fix: auto-activate custom workflow after submission (#510)
## Problem Custom workflows were not being activated after submission - the form dialog would close, but no network call was made to the backend API to actually load the workflow. ## Root Cause When submitting a custom workflow, the code was only calling `setCustomWorkflow()` which set it as "pending" but never called `activateWorkflow()`. Out-of-the-box workflows automatically activated, but custom ones didn't. ## Solution Modified the `CustomWorkflowDialog` submission handler to automatically activate the workflow after setting it as pending. This now: 1. Sets the workflow as pending 2. Closes the dialog 3. Creates a workflow config object 4. **Immediately activates it** (makes the POST request to `/api/projects/{project}/agentic-sessions/{session}/workflow`) This matches the behavior of OOTB workflows. ## Testing - ✅ Frontend builds successfully with `npm run build` - ✅ No linting errors - Ready to test on dev cluster after deployment ## Changes - Modified `components/frontend/src/app/projects/[name]/sessions/[sessionName]/page.tsx` - Added automatic activation call in `CustomWorkflowDialog` onSubmit handler
1 parent a6ced3a commit 1e3db39

File tree

1 file changed

+11
-0
lines changed
  • components/frontend/src/app/projects/[name]/sessions/[sessionName]

1 file changed

+11
-0
lines changed

components/frontend/src/app/projects/[name]/sessions/[sessionName]/page.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,6 +2034,17 @@ export default function ProjectSessionDetailPage({
20342034
onSubmit={(url, branch, path) => {
20352035
workflowManagement.setCustomWorkflow(url, branch, path);
20362036
setCustomWorkflowDialogOpen(false);
2037+
// Automatically activate the custom workflow (same as OOTB workflows)
2038+
const customWorkflow = {
2039+
id: "custom",
2040+
name: "Custom workflow",
2041+
description: `Custom workflow from ${url}`,
2042+
gitUrl: url,
2043+
branch: branch || "main",
2044+
path: path || "",
2045+
enabled: true,
2046+
};
2047+
workflowManagement.activateWorkflow(customWorkflow, session?.status?.phase);
20372048
}}
20382049
isActivating={workflowManagement.workflowActivating}
20392050
/>

0 commit comments

Comments
 (0)