FlowiseAI/Flowise · error · Error

Variables in User ID are not resolved. {{$vars.*}} requires

Error message

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.

What it means

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.

Source

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

    }

    async getTools(nodeData: INodeData, options: ICommonObject, isLoadMethod = false): Promise<Tool[]> {
        const appSlug = nodeData.inputs?.appSlug as string
        if (!appSlug) {
            throw new Error('Pipedream app slug is required')
        }

        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])?)*$/
        if (!SLUG_PATTERN.test(appSlug)) {
            throw new Error('Invalid app slug format. Must be lowercase letters, digits, hyphens and underscores only.')
        }

        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, . _ @ + -')

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Check the externalUserId field for any {{...}} tokens and ensure each references an existing workspace variable.
  2. Create the missing workspace variable, or fix the typo so it matches an existing variable name.
  3. Replace {{$flow.*}} tokens with a concrete value if the node runs outside a flow session that provides them.
  4. Use a static externalUserId if dynamic resolution is not required.

Example fix

// before: externalUserId = '{{$vars.tenantId}}'  // tenantId does not exist
// after:  create workspace variable 'tenantId' OR set a literal:
//         externalUserId = 'tenant-1234'
Defensive patterns

Strategy: validation

Validate before calling

let externalUserId = nodeData.inputs?.externalUserId as string
externalUserId = await resolveVarsInString(externalUserId, nodeData, options)
if (externalUserId.includes('{{') && !isLoadMethod) {
    // tell user which token is unresolved and stop
}

Type guard

function isFullyResolved(s: string): boolean {
    return !s.includes('{{')
}

Try / catch

try { await pipedream.getTools(nodeData, options, false) }
catch (e) { if (e instanceof Error && e.message.startsWith('Variables in User ID are not resolved')) { /* list missing vars */ } }

Prevention

When it happens

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

Common situations: 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.

Related errors


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