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

Function resolveWorkflowFolderPath

apps/sim/lib/copilot/chat/process-contents.ts:343–355  ·  view source on GitHub ↗

* Resolve a workflow folder id to its canonical, per-segment-encoded VFS folder * path. Returns null for root-level workflows or when the folder can't be * resolved. Uses the shared buildVfsFolderPathMap so the pointer path * matches what the workspace VFS serves.

(
  workspaceId: string | null | undefined,
  folderId: string | null | undefined
)

Source from the content-addressed store, hash-verified

341 * matches what the workspace VFS serves.
342 */
343async function resolveWorkflowFolderPath(
344 workspaceId: string | null | undefined,
345 folderId: string | null | undefined
346): Promise<string | null> {
347 if (!folderId || !workspaceId) return null
348 try {
349 const folders = await listFolders(workspaceId)
350 return buildVfsFolderPathMap(folders).get(folderId) ?? null
351 } catch (error) {
352 logger.warn('Failed to resolve workflow folder path', { workspaceId, folderId, error })
353 return null
354 }
355}
356
357async function processWorkflowFromDb(
358 workflowId: string,

Callers 3

processWorkflowFromDbFunction · 0.85
resolveFolderResourceFunction · 0.85

Calls 4

listFoldersFunction · 0.90
buildVfsFolderPathMapFunction · 0.90
getMethod · 0.65
warnMethod · 0.65

Tested by

no test coverage detected