@@ -214,40 +214,18 @@ const getOutputTypeForPath = (
214214 outputPath : string ,
215215 mergedSubBlocksOverride ?: Record < string , any >
216216) : string => {
217- if ( block ?. triggerMode && blockConfig ?. triggers ?. enabled ) {
218- return getBlockOutputType ( block . type , outputPath , mergedSubBlocksOverride , true )
219- }
220- if ( block ?. type === 'starter' ) {
221- const startWorkflowValue =
222- mergedSubBlocksOverride ?. startWorkflow ?. value ?? getSubBlockValue ( blockId , 'startWorkflow' )
223-
224- if ( startWorkflowValue === 'chat' ) {
225- const chatModeTypes : Record < string , string > = {
226- input : 'string' ,
227- conversationId : 'string' ,
228- files : 'files' ,
229- }
230- return chatModeTypes [ outputPath ] || 'any'
231- }
232- const inputFormatValue =
233- mergedSubBlocksOverride ?. inputFormat ?. value ?? getSubBlockValue ( blockId , 'inputFormat' )
234- if ( inputFormatValue && Array . isArray ( inputFormatValue ) ) {
235- const field = inputFormatValue . find (
236- ( f : { name ?: string ; type ?: string } ) => f . name === outputPath
237- )
238- if ( field ?. type ) return field . type
239- }
240- } else if ( blockConfig ?. category === 'triggers' ) {
241- const blockState = useWorkflowStore . getState ( ) . blocks [ blockId ]
242- const subBlocks = mergedSubBlocksOverride ?? ( blockState ?. subBlocks || { } )
243- return getBlockOutputType ( block . type , outputPath , subBlocks )
244- } else {
217+ const subBlocks =
218+ mergedSubBlocksOverride ?? useWorkflowStore . getState ( ) . blocks [ blockId ] ?. subBlocks
219+ const triggerMode = block ?. triggerMode && blockConfig ?. triggers ?. enabled
220+
221+ if ( blockConfig ?. tools ?. config ?. tool ) {
245222 const operationValue = getSubBlockValue ( blockId , 'operation' )
246- if ( blockConfig && operationValue ) {
223+ if ( operationValue ) {
247224 return getToolOutputType ( blockConfig , operationValue , outputPath )
248225 }
249226 }
250- return 'any'
227+
228+ return getBlockOutputType ( block ?. type ?? '' , outputPath , subBlocks , triggerMode )
251229}
252230
253231/**
@@ -1789,7 +1767,7 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
17891767 mergedSubBlocks
17901768 )
17911769
1792- if ( fieldType === 'files' || fieldType === 'array' ) {
1770+ if ( fieldType === 'files' || fieldType === 'file[]' || fieldType === ' array') {
17931771 const blockName = parts [ 0 ]
17941772 const remainingPath = parts . slice ( 2 ) . join ( '.' )
17951773 processedTag = `${ blockName } .${ arrayFieldName } [0].${ remainingPath } `
0 commit comments