MCPcopy
hub / github.com/FlowiseAI/Flowise / processConfigParams

Function processConfigParams

packages/server/src/utils/buildAgentflow.ts:531–551  ·  view source on GitHub ↗
(configObj: any, configParamWithAcceptVariables: string[])

Source from the content-addressed store, hash-verified

529 // Helper function to process config parameters with acceptVariable
530 // Example: Processes agentSelectedToolConfig object, resolving variables in requestsGetHeaders
531 const processConfigParams = async (configObj: any, configParamWithAcceptVariables: string[]) => {
532 if (typeof configObj !== 'object' || configObj === null) {
533 return
534 }
535
536 // Handle arrays of config objects
537 if (Array.isArray(configObj)) {
538 for (const item of configObj) {
539 await processConfigParams(item, configParamWithAcceptVariables)
540 }
541 return
542 }
543
544 for (const [key, value] of Object.entries(configObj)) {
545 // Only resolve variables for parameters that accept them
546 // Example: requestsGetHeaders is in configParamWithAcceptVariables, so resolve "Bearer {{ $vars.TOKEN }}"
547 if (configParamWithAcceptVariables.includes(key)) {
548 configObj[key] = await resolveNodeReference(value)
549 }
550 }
551 }
552
553 // STEP 1: Get all params with loadConfig from inputParams
554 // Example result: ["agentModel", "agentSelectedTool"]

Callers 1

getParamValuesFunction · 0.85

Calls 1

resolveNodeReferenceFunction · 0.85

Tested by

no test coverage detected