MCPcopy Index your code
hub / github.com/simstudioai/sim / processExecutionFiles

Function processExecutionFiles

apps/sim/lib/execution/files.ts:86–114  ·  view source on GitHub ↗
(
  fieldValue: any,
  executionContext: { workspaceId: string; workflowId: string; executionId: string },
  requestId: string,
  userId?: string
)

Source from the content-addressed store, hash-verified

84 * Process all files for a given field in workflow execution input
85 */
86export async function processExecutionFiles(
87 fieldValue: any,
88 executionContext: { workspaceId: string; workflowId: string; executionId: string },
89 requestId: string,
90 userId?: string
91): Promise<UserFile[]> {
92 if (!fieldValue || typeof fieldValue !== 'object') {
93 return []
94 }
95
96 const files = Array.isArray(fieldValue) ? fieldValue : [fieldValue]
97 const uploadedFiles: UserFile[] = []
98 const fullContext = { ...executionContext }
99
100 for (const file of files) {
101 try {
102 const userFile = await processExecutionFile(file, fullContext, requestId, userId)
103
104 if (userFile) {
105 uploadedFiles.push(userFile)
106 }
107 } catch (error) {
108 logger.error(`[${requestId}] Failed to process file ${file.name}:`, error)
109 throw new Error(`Failed to upload file: ${file.name}`)
110 }
111 }
112
113 return uploadedFiles
114}
115
116/**
117 * Extract inputFormat fields from a start block or trigger block

Callers 3

processChatFilesFunction · 0.90
processInputFilesFunction · 0.85
processInputFileFieldsFunction · 0.85

Calls 3

processExecutionFileFunction · 0.85
errorMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected