FlowiseAI/Flowise · error · Error

User ID contains invalid characters. Allowed: letters, digit

Error message

User ID contains invalid characters. Allowed: letters, digits, . _ @ + -

What it means

Thrown when externalUserId (after trim) fails the SAFE_USER_ID regex /^[a-zA-Z0-9._@+-]{1,250}$/. This prevents characters outside the allowed set (and over-length values) from being passed to Pipedream as the external user identifier.

Source

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

                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)

        if (!clientId || !clientSecret) {
            throw new Error('Pipedream Client ID and Client Secret are required in credentials')
        }
        const accessToken = await this.fetchAccessToken(clientId, clientSecret, oauthScopes)

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Use a plain identifier: letters, digits, dot, underscore, at, plus, hyphen only.
  2. Strip display names/angles from emails; use the bare address.
  3. If the source value is a UUID, that already passes; if it is a free-text username, sanitize it upstream.
  4. Keep the value under 250 characters.

Example fix

// before: externalUserId = 'Jane Doe <jane@example.com>'
// after:  externalUserId = 'jane@example.com'
Defensive patterns

Strategy: validation

Validate before calling

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

Type guard

function isSafeUserId(s: string): boolean {
    return /^[a-zA-Z0-9._@+-]{1,250}$/.test(s.trim())
}

Try / catch

try { await pipedream.getTools(nodeData, options) }
catch (e) { if (e instanceof Error && e.message.startsWith('User ID contains invalid characters')) { /* sanitize input */ } }

Prevention

When it happens

Trigger: externalUserId contains spaces, colons, slashes, Unicode, emoji, angle brackets that survived stripping, or exceeds 250 characters.

Common situations: User entered an email with a display name 'Jane Doe <j@x.com>'; a UUID with hyphens is fine but a value with spaces is not; pasted a long JSON blob; Unicode username from an external IdP.

Understand the failure class

Related errors


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