diff --git a/web/app/components/workflow/nodes/_base/components/variable/utils.ts b/web/app/components/workflow/nodes/_base/components/variable/utils.ts index 2c0959ec53..6416b0c527 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/utils.ts +++ b/web/app/components/workflow/nodes/_base/components/variable/utils.ts @@ -203,17 +203,17 @@ const formatItem = ( } case BlockEnum.LLM: { - res.vars = [ - ...LLM_OUTPUT_STRUCT, - { + res.vars = [...LLM_OUTPUT_STRUCT] + if (data.structured_output_enabled && data.structured_output?.schema?.properties && Object.keys(data.structured_output.schema.properties).length > 0) { + res.vars.push({ variable: 'structured_output', type: VarType.object, - children: mockStructData, - }, - ] + children: data.structured_output, + }) + } + break } - case BlockEnum.KnowledgeRetrieval: { res.vars = KNOWLEDGE_RETRIEVAL_OUTPUT_STRUCT break