{"record":{"id":"f981c4cc0546ab12","repo":"FlowiseAI/Flowise","slug":"variables-in-user-id-are-not-resolved-vars","errorCode":null,"errorMessage":"Variables in User ID are not resolved. {{$vars.*}} requires a matching workspace variable. {{$flow.*}} variables (e.g. sessionId) are only available at runtime, not when refreshing actions.","messagePattern":"Variables in User ID are not resolved\\. (.+?)\\} requires a matching workspace variable\\. (.+?)\\} variables \\(e\\.g\\. sessionId\\) are only available at runtime, not when refreshing actions\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/MCP/Pipedream/PipedreamMCP.ts","lineNumber":274,"sourceCode":"    }\n\n    async getTools(nodeData: INodeData, options: ICommonObject, isLoadMethod = false): Promise<Tool[]> {\n        const appSlug = nodeData.inputs?.appSlug as string\n        if (!appSlug) {\n            throw new Error('Pipedream app slug is required')\n        }\n\n        const SLUG_PATTERN = /^[a-z0-9](?:[a-z0-9_-]{0,98}[a-z0-9])?(?:,\\s*[a-z0-9](?:[a-z0-9_-]{0,98}[a-z0-9])?)*$/\n        if (!SLUG_PATTERN.test(appSlug)) {\n            throw new Error('Invalid app slug format. Must be lowercase letters, digits, hyphens and underscores only.')\n        }\n\n        let externalUserId = nodeData.inputs?.externalUserId as string\n        externalUserId = await this.resolveVarsInString(externalUserId, nodeData, options)\n\n        if (externalUserId.includes('{{')) {\n            if (!isLoadMethod) {\n                throw new Error(\n                    'Variables in User ID are not resolved. ' +\n                        '{{$vars.*}} requires a matching workspace variable. ' +\n                        '{{$flow.*}} variables (e.g. sessionId) are only available at runtime, not when refreshing actions.'\n                )\n            }\n            // For loadMethods context, use a sanitized fallback so tool listing still works.\n            // The actual externalUserId will be resolved at runtime.\n            externalUserId = 'flowise_preview_user'\n        }\n\n        externalUserId = externalUserId.replace(/<[^>]*>/g, '').trim()\n        if (!externalUserId) {\n            throw new Error('Pipedream user ID is required')\n        }\n\n        const SAFE_USER_ID = /^[a-zA-Z0-9._@+-]{1,250}$/\n        if (!SAFE_USER_ID.test(externalUserId.trim())) {\n            throw new Error('User ID contains invalid characters. Allowed: letters, digits, . _ @ + -')","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/MCP/Pipedream/PipedreamMCP.ts#L256-L292","documentation":"Thrown (only when isLoadMethod is false) if externalUserId still contains '{{' after resolveVarsInString ran — meaning a {{$vars.*}} or {{$flow.*}} placeholder did not resolve. In loadMethod context the code instead substitutes a safe fallback so tool listing still works; at runtime it errors because the real value is required.","triggerScenarios":"externalUserId references a workspace variable that does not exist ({{$vars.foo}} with no matching var), or a flow variable only available at runtime ({{$flow.sessionId}}) while the node is being executed in a context where it is not yet present.","commonSituations":"Typo in the variable name; workspace variable deleted but node still references it; using {{$flow.*}} during the design-time 'refresh actions' step (isLoadMethod) which is now guarded, or running the node in a context that lacks flow state.","solutions":["Check the externalUserId field for any {{...}} tokens and ensure each references an existing workspace variable.","Create the missing workspace variable, or fix the typo so it matches an existing variable name.","Replace {{$flow.*}} tokens with a concrete value if the node runs outside a flow session that provides them.","Use a static externalUserId if dynamic resolution is not required."],"exampleFix":"// before: externalUserId = '{{$vars.tenantId}}'  // tenantId does not exist\n// after:  create workspace variable 'tenantId' OR set a literal:\n//         externalUserId = 'tenant-1234'","handlingStrategy":"validation","validationCode":"let externalUserId = nodeData.inputs?.externalUserId as string\nexternalUserId = await resolveVarsInString(externalUserId, nodeData, options)\nif (externalUserId.includes('{{') && !isLoadMethod) {\n    // tell user which token is unresolved and stop\n}","typeGuard":"function isFullyResolved(s: string): boolean {\n    return !s.includes('{{')\n}","tryCatchPattern":"try { await pipedream.getTools(nodeData, options, false) }\ncatch (e) { if (e instanceof Error && e.message.startsWith('Variables in User ID are not resolved')) { /* list missing vars */ } }","preventionTips":["Surface unresolved tokens in the UI live preview.","Keep a registry of workspace variables so names are easy to match.","Avoid {{$flow.*}} tokens in externalUserId unless the runtime always provides them."],"tags":["pipedream","variables","templating","validation","runtime"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}