From ff7a467a1af036114e5c5883bc96b62f95313a59 Mon Sep 17 00:00:00 2001 From: Joel Date: Tue, 15 Oct 2024 11:20:45 +0800 Subject: [PATCH] fix: iteration not support file item --- .../workflow/nodes/_base/components/variable/utils.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 df5bfed4d9..2e8e728955 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/utils.ts +++ b/web/app/components/workflow/nodes/_base/components/variable/utils.ts @@ -581,6 +581,16 @@ export const toNodeAvailableVars = ({ environmentVariables, conversationVariables, }) + const itemChildren = itemType === VarType.file + ? { + children: OUTPUT_FILE_SUB_VARIABLES.map((key) => { + return { + variable: key, + type: key === 'size' ? VarType.number : VarType.string, + } + }), + } + : {} const iterationVar = { nodeId: iterationNode?.id, title: t('workflow.nodes.iteration.currentIteration'), @@ -588,6 +598,7 @@ export const toNodeAvailableVars = ({ { variable: 'item', type: itemType, + ...itemChildren, }, { variable: 'index',