FlowiseAI/Flowise · error · Error

Team ID, Channel ID, and User ID are all required

Error message

Team ID, Channel ID, and User ID are all required

What it means

Thrown synchronously by AddChannelMemberTool._call when teamId, channelId, or userId is falsy after the params merge. Above the try block at core.ts:467, propagates as a raw Error. zod schema (core.ts:450) marks all three required. The body at core.ts:472 uses user@odata.bind referencing the user resource URL — a wrong userId surfaces downstream as error 440 (400/404), but the missing-arg case is caught here first.

Source

Thrown at packages/components/nodes/tools/MicrosoftTeams/core.ts:468

            schema: z.object({
                teamId: z.string().describe('ID of the team that contains the channel'),
                channelId: z.string().describe('ID of the channel'),
                userId: z.string().describe('ID of the user to add')
            }),
            baseUrl: BASE_URL,
            method: 'POST',
            headers: {}
        }

        super({ ...toolInput, accessToken: args.accessToken, defaultParams: args.defaultParams })
    }

    protected async _call(arg: any): Promise<string> {
        const params = { ...arg, ...this.defaultParams }
        const { teamId, channelId, userId } = params

        if (!teamId || !channelId || !userId) {
            throw new Error('Team ID, Channel ID, and User ID are all required')
        }

        try {
            const body = {
                '@odata.type': '#microsoft.graph.aadUserConversationMember',
                'user@odata.bind': `https://graph.microsoft.com/v1.0/users('${userId}')`
            }

            const endpoint = `/teams/${teamId}/channels/${channelId}/members`
            await this.makeTeamsRequest(endpoint, 'POST', body)

            return this.formatResponse(
                {
                    success: true,
                    message: 'Member added to channel successfully'
                },
                params
            )

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Pass teamId, channelId, and userId (Azure AD object ID, GUID-shaped) explicitly.
  2. If you only have a UPN/email, resolve it first via /users?$filter=mail eq '...' and pass the returned id.
  3. Fix the params spread order.
  4. Catch the propagated Error upstream.

Example fix

// before
const params = { ...arg, ...this.defaultParams }

// after
const params = { ...this.defaultParams, ...arg }
Defensive patterns

Strategy: validation

Validate before calling

function validateAddChannelMemberInput(input: unknown) {
  const { teamId, channelId, userId } = (input ?? {}) as any
  for (const [k, v] of Object.entries({ teamId, channelId, userId })) {
    if (typeof v !== 'string' || !v.trim()) throw new Error(`${k} required`)
  }
  if (!/^[0-9a-f-]{36}$/i.test(userId)) {
    throw new Error('userId must be an Azure AD object ID (GUID) — resolve UPN first')
  }
}

Type guard

function isAddChannelMemberArgs(x: unknown): x is { teamId: string; channelId: string; userId: string } {
  const o = x as any
  return typeof x === 'object' && x !== null &&
    typeof o.teamId === 'string' && o.teamId.trim() !== '' &&
    typeof o.channelId === 'string' && o.channelId.trim() !== '' &&
    typeof o.userId === 'string' && /^[0-9a-f-]{36}$/i.test(o.userId)
}

Try / catch

try {
  if (!isAddChannelMemberArgs(input)) return { error: 'teamId, channelId, and a GUID userId are required' }
  return await addChannelMemberTool.invoke(input)
} catch (e) {
  return { error: (e as Error).message }
}

Prevention

When it happens

Trigger: add_channel_member invoked without all three IDs; defaultParams clobbering any of them; agent passing a UPN/email where a GUID userId is required (technically passes this check, fails at Graph).

Common situations: Agent confusing UPN with userId; defaultParams misconfiguration; UI form missing the user picker value; member just-in-time resolution failing.

Related errors


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