FlowiseAI/Flowise · error · Error

Pipedream user ID is required

Error message

Pipedream user ID is required

What it means

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.

Source

Thrown at packages/components/nodes/tools/MCP/Pipedream/PipedreamMCP.ts:287

        let externalUserId = nodeData.inputs?.externalUserId as string
        externalUserId = await this.resolveVarsInString(externalUserId, nodeData, options)

        if (externalUserId.includes('{{')) {
            if (!isLoadMethod) {
                throw new Error(
                    '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.'
                )
            }
            // For loadMethods context, use a sanitized fallback so tool listing still works.
            // The actual externalUserId will be resolved at runtime.
            externalUserId = 'flowise_preview_user'
        }

        externalUserId = externalUserId.replace(/<[^>]*>/g, '').trim()
        if (!externalUserId) {
            throw new Error('Pipedream user ID is required')
        }

        const SAFE_USER_ID = /^[a-zA-Z0-9._@+-]{1,250}$/
        if (!SAFE_USER_ID.test(externalUserId.trim())) {
            throw new Error('User ID contains invalid characters. Allowed: letters, digits, . _ @ + -')
        }

        const credentialData = await getCredentialData(nodeData.credential ?? '', options)
        const projectId = getCredentialParam('projectId', credentialData, nodeData)
        const oauthScopes = getCredentialParam('oauthScopes', credentialData, nodeData) as string | 'connect:*'

        if (!projectId) {
            throw new Error('Pipedream Project ID is required in credentials')
        }

        const clientId = getCredentialParam('clientId', credentialData, nodeData)
        const clientSecret = getCredentialParam('clientSecret', credentialData, nodeData)

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Set externalUserId to a concrete non-empty identifier (e.g. a user email or stable id).
  2. If using a variable, confirm it resolves to a non-empty, non-tag-only string at runtime.
  3. Avoid HTML/markup in the field; it is not supported and will be stripped.
Defensive patterns

Strategy: validation

Validate before calling

const cleaned = (externalUserId || '').replace(/<[^>]*>/g, '').trim()
if (!cleaned) {
    throw new Error('Pipedream user ID is required')
}

Type guard

function isNonEmptyUserId(s: string): boolean {
    return s.replace(/<[^>]*>/g, '').trim().length > 0
}

Try / catch

try { await pipedream.getTools(nodeData, options) }
catch (e) { if (e instanceof Error && e.message === 'Pipedream user ID is required') { /* set a concrete id */ } }

Prevention

When it happens

Trigger: 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.

Common situations: Variable resolved to an empty string; user pasted markup that got stripped; trailing/leading-only whitespace; a template produced nothing.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/d187f0ad74230b5a. Report an issue: GitHub.