{"record":{"id":"d187f0ad74230b5a","repo":"FlowiseAI/Flowise","slug":"pipedream-user-id-is-required","errorCode":null,"errorMessage":"Pipedream user ID is required","messagePattern":"Pipedream user ID is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/MCP/Pipedream/PipedreamMCP.ts","lineNumber":287,"sourceCode":"        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, . _ @ + -')\n        }\n\n        const credentialData = await getCredentialData(nodeData.credential ?? '', options)\n        const projectId = getCredentialParam('projectId', credentialData, nodeData)\n        const oauthScopes = getCredentialParam('oauthScopes', credentialData, nodeData) as string | 'connect:*'\n\n        if (!projectId) {\n            throw new Error('Pipedream Project ID is required in credentials')\n        }\n\n        const clientId = getCredentialParam('clientId', credentialData, nodeData)\n        const clientSecret = getCredentialParam('clientSecret', credentialData, nodeData)\n","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/MCP/Pipedream/PipedreamMCP.ts#L269-L305","documentation":"Thrown after externalUserId is HTML-stripped and trimmed and the result is empty. This catches cases where the field contained only tags/whitespace or became empty after sanitization, ensuring a non-empty user identifier is sent in the x-pd-external-user-id header.","triggerScenarios":"externalUserId was set to only whitespace, only HTML-like tags (e.g. '<script>'), or resolved to empty after variable substitution; the field appears filled but contains no usable characters.","commonSituations":"Variable resolved to an empty string; user pasted markup that got stripped; trailing/leading-only whitespace; a template produced nothing.","solutions":["Set externalUserId to a concrete non-empty identifier (e.g. a user email or stable id).","If using a variable, confirm it resolves to a non-empty, non-tag-only string at runtime.","Avoid HTML/markup in the field; it is not supported and will be stripped."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const cleaned = (externalUserId || '').replace(/<[^>]*>/g, '').trim()\nif (!cleaned) {\n    throw new Error('Pipedream user ID is required')\n}","typeGuard":"function isNonEmptyUserId(s: string): boolean {\n    return s.replace(/<[^>]*>/g, '').trim().length > 0\n}","tryCatchPattern":"try { await pipedream.getTools(nodeData, options) }\ncatch (e) { if (e instanceof Error && e.message === 'Pipedream user ID is required') { /* set a concrete id */ } }","preventionTips":["Default externalUserId to a known stable value in templates.","Reject HTML/markup in the input via UI validation."],"tags":["pipedream","validation","sanitization","configuration"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}