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`.
This commit is contained in:
Ahmed Awan
2026-03-31 14:47:49 -05:00
parent 1296dc926b
commit 4be0e12e00
@@ -152,10 +152,15 @@ const jobsTabTitle = computed(() => {
});
const activeStepWithConfig = computed(() => {
// graphStep is the full editor-format step (already has config_form with correct values)
if (props.graphStep?.config_form) {
return props.graphStep as any;
}
// 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)
if (!stepConfigData.value) {
return null;
}
const step = props.workflowStep as any;
const step = props.graphStep ?? (props.workflowStep as any);
return {
...step,
config_form: stepConfigData.value.config_form,
@@ -165,16 +170,17 @@ const activeStepWithConfig = computed(() => {
});
async function fetchStepConfig() {
if (stepConfigData.value || loadingStepConfig.value) {
// graphStep already has config_form — no fetch needed
if (props.graphStep?.config_form || stepConfigData.value || loadingStepConfig.value) {
return;
}
loadingStepConfig.value = true;
try {
const step = props.workflowStep as any;
const step = props.graphStep ?? props.workflowStep;
const { data } = await axios.post(`${getAppRoot()}api/workflows/build_module`, {
type: step.type,
content_id: step.content_id ?? step.tool_id,
tool_state: step.tool_state ?? "{}",
content_id: "content_id" in step ? step.content_id : step.tool_id,
tool_state: "tool_state" in step ? step.tool_state : {},
});
stepConfigData.value = data;
} finally {