Skip to content

Commit d24304f

Browse files
committed
Minor fixes
1 parent dcb3501 commit d24304f

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

apps/sim/lib/copilot/tools/client/workflow/get-block-outputs.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,29 +95,27 @@ export class GetBlockOutputsClientTool extends BaseClientTool {
9595
let insideSubflowOutputs: string[] | undefined
9696
let outsideSubflowOutputs: string[] | undefined
9797

98-
if (block.type === 'loop' || block.type === 'parallel') {
99-
const insidePaths = getSubflowInsidePaths(block.type, blockId, loops, parallels)
100-
insideSubflowOutputs = formatOutputsWithPrefix(insidePaths, blockName)
101-
outsideSubflowOutputs = formatOutputsWithPrefix(['results'], blockName)
102-
}
103-
104-
const outputPaths = computeBlockOutputPaths(block, ctx)
105-
const formattedOutputs = formatOutputsWithPrefix(outputPaths, blockName)
106-
10798
const blockOutput: GetBlockOutputsResultType['blocks'][0] = {
10899
blockId,
109100
blockName,
110101
blockType: block.type,
111-
outputs: formattedOutputs,
102+
outputs: [],
112103
}
113104

114-
if (insideSubflowOutputs) blockOutput.insideSubflowOutputs = insideSubflowOutputs
115-
if (outsideSubflowOutputs) blockOutput.outsideSubflowOutputs = outsideSubflowOutputs
105+
if (block.type === 'loop' || block.type === 'parallel') {
106+
const insidePaths = getSubflowInsidePaths(block.type, blockId, loops, parallels)
107+
blockOutput.insideSubflowOutputs = formatOutputsWithPrefix(insidePaths, blockName)
108+
blockOutput.outsideSubflowOutputs = formatOutputsWithPrefix(['results'], blockName)
109+
} else {
110+
const outputPaths = computeBlockOutputPaths(block, ctx)
111+
blockOutput.outputs = formatOutputsWithPrefix(outputPaths, blockName)
112+
}
116113

117114
blockOutputs.push(blockOutput)
118115
}
119116

120-
const variableOutputs = getWorkflowVariables(activeWorkflowId)
117+
const includeVariables = !args?.blockIds || args.blockIds.length === 0
118+
const variableOutputs = includeVariables ? getWorkflowVariables(activeWorkflowId) : []
121119

122120
const result = GetBlockOutputsResult.parse({
123121
blocks: blockOutputs,

0 commit comments

Comments
 (0)