diff --git a/api/core/tools/entities/tool_entities.py b/api/core/tools/entities/tool_entities.py index 02f66c545d..b8eae600d1 100644 --- a/api/core/tools/entities/tool_entities.py +++ b/api/core/tools/entities/tool_entities.py @@ -125,7 +125,7 @@ class ToolInvokeMessage(BaseModel): class VariableMessage(BaseModel): variable_name: str = Field(..., description="The name of the variable") - variable_value: str = Field(..., description="The value of the variable") + variable_value: Any = Field(..., description="The value of the variable") stream: bool = Field(default=False, description="Whether the variable is streamed") @model_validator(mode="before") diff --git a/web/app/components/workflow/run/utils/format-log/iteration/index.ts b/web/app/components/workflow/run/utils/format-log/iteration/index.ts index ca3dad7fb0..d51c2315e3 100644 --- a/web/app/components/workflow/run/utils/format-log/iteration/index.ts +++ b/web/app/components/workflow/run/utils/format-log/iteration/index.ts @@ -3,10 +3,10 @@ import type { NodeTracing } from '@/types/workflow' import formatParallelNode from '../parallel' function addChildrenToIterationNode(iterationNode: NodeTracing, childrenNodes: NodeTracing[]): NodeTracing { const details: NodeTracing[][] = [] - childrenNodes.forEach((item) => { + childrenNodes.forEach((item, index) => { if (!item.execution_metadata) return - const { parallel_mode_run_id, iteration_index = 0 } = item.execution_metadata - const runIndex: number = (parallel_mode_run_id || iteration_index) as number + const { iteration_index = 0 } = item.execution_metadata + const runIndex: number = iteration_index || index if (!details[runIndex]) details[runIndex] = []