Skip to content

Commit 4be0e12

Browse files
use editor-format graphStep directly for step config form
The `graphStep` passed to `WorkflowInvocationStep` is already the full editor-format step loaded via `getWorkflowFull` (style=editor) in `useInvocationGraph`. It already has `config_form` populated with the correct parameter values, as well as `label`, `tool_state`, and `post_job_actions` — so there is no need to call `build_module` at all in the graph view. `activeStepWithConfig` now returns `graphStep` directly when its `config_form` is present, rendering the form immediately with no network roundtrip and showing the actual values set in the workflow. The `build_module` fetch is kept as a fallback for non-graph contexts where `graphStep` is absent or incomplete, using `tool_state` (the proper editor-format) instead of the previously used `tool_inputs`.
1 parent 1296dc9 commit 4be0e12

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

client/src/components/WorkflowInvocationState/WorkflowInvocationStep.vue

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,15 @@ const jobsTabTitle = computed(() => {
152152
});
153153
154154
const activeStepWithConfig = computed(() => {
155+
// graphStep is the full editor-format step (already has config_form with correct values)
156+
if (props.graphStep?.config_form) {
157+
return props.graphStep as any;
158+
}
159+
// If the graphStep doesn't have config_form, we may be able to get it from stepConfigData (fetched when user clicks on Step Config tab)
155160
if (!stepConfigData.value) {
156161
return null;
157162
}
158-
const step = props.workflowStep as any;
163+
const step = props.graphStep ?? (props.workflowStep as any);
159164
return {
160165
...step,
161166
config_form: stepConfigData.value.config_form,
@@ -165,16 +170,17 @@ const activeStepWithConfig = computed(() => {
165170
});
166171
167172
async function fetchStepConfig() {
168-
if (stepConfigData.value || loadingStepConfig.value) {
173+
// graphStep already has config_form — no fetch needed
174+
if (props.graphStep?.config_form || stepConfigData.value || loadingStepConfig.value) {
169175
return;
170176
}
171177
loadingStepConfig.value = true;
172178
try {
173-
const step = props.workflowStep as any;
179+
const step = props.graphStep ?? props.workflowStep;
174180
const { data } = await axios.post(`${getAppRoot()}api/workflows/build_module`, {
175181
type: step.type,
176-
content_id: step.content_id ?? step.tool_id,
177-
tool_state: step.tool_state ?? "{}",
182+
content_id: "content_id" in step ? step.content_id : step.tool_id,
183+
tool_state: "tool_state" in step ? step.tool_state : {},
178184
});
179185
stepConfigData.value = data;
180186
} finally {

0 commit comments

Comments
 (0)