{"record":{"id":"8984faf1e7c1518d","repo":"FlowiseAI/Flowise","slug":"team-id-channel-id-and-user-id-are-all-required","errorCode":null,"errorMessage":"Team ID, Channel ID, and User ID are all required","messagePattern":"Team ID, Channel ID, and User ID are all required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/MicrosoftTeams/core.ts","lineNumber":468,"sourceCode":"            schema: z.object({\n                teamId: z.string().describe('ID of the team that contains the channel'),\n                channelId: z.string().describe('ID of the channel'),\n                userId: z.string().describe('ID of the user to add')\n            }),\n            baseUrl: BASE_URL,\n            method: 'POST',\n            headers: {}\n        }\n\n        super({ ...toolInput, accessToken: args.accessToken, defaultParams: args.defaultParams })\n    }\n\n    protected async _call(arg: any): Promise<string> {\n        const params = { ...arg, ...this.defaultParams }\n        const { teamId, channelId, userId } = params\n\n        if (!teamId || !channelId || !userId) {\n            throw new Error('Team ID, Channel ID, and User ID are all required')\n        }\n\n        try {\n            const body = {\n                '@odata.type': '#microsoft.graph.aadUserConversationMember',\n                'user@odata.bind': `https://graph.microsoft.com/v1.0/users('${userId}')`\n            }\n\n            const endpoint = `/teams/${teamId}/channels/${channelId}/members`\n            await this.makeTeamsRequest(endpoint, 'POST', body)\n\n            return this.formatResponse(\n                {\n                    success: true,\n                    message: 'Member added to channel successfully'\n                },\n                params\n            )","sourceCodeStart":450,"sourceCodeEnd":486,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/MicrosoftTeams/core.ts#L450-L486","documentation":"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.","triggerScenarios":"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).","commonSituations":"Agent confusing UPN with userId; defaultParams misconfiguration; UI form missing the user picker value; member just-in-time resolution failing.","solutions":["Pass teamId, channelId, and userId (Azure AD object ID, GUID-shaped) explicitly.","If you only have a UPN/email, resolve it first via /users?$filter=mail eq '...' and pass the returned id.","Fix the params spread order.","Catch the propagated Error upstream."],"exampleFix":"// before\nconst params = { ...arg, ...this.defaultParams }\n\n// after\nconst params = { ...this.defaultParams, ...arg }","handlingStrategy":"validation","validationCode":"function validateAddChannelMemberInput(input: unknown) {\n  const { teamId, channelId, userId } = (input ?? {}) as any\n  for (const [k, v] of Object.entries({ teamId, channelId, userId })) {\n    if (typeof v !== 'string' || !v.trim()) throw new Error(`${k} required`)\n  }\n  if (!/^[0-9a-f-]{36}$/i.test(userId)) {\n    throw new Error('userId must be an Azure AD object ID (GUID) — resolve UPN first')\n  }\n}","typeGuard":"function isAddChannelMemberArgs(x: unknown): x is { teamId: string; channelId: string; userId: string } {\n  const o = x as any\n  return typeof x === 'object' && x !== null &&\n    typeof o.teamId === 'string' && o.teamId.trim() !== '' &&\n    typeof o.channelId === 'string' && o.channelId.trim() !== '' &&\n    typeof o.userId === 'string' && /^[0-9a-f-]{36}$/i.test(o.userId)\n}","tryCatchPattern":"try {\n  if (!isAddChannelMemberArgs(input)) return { error: 'teamId, channelId, and a GUID userId are required' }\n  return await addChannelMemberTool.invoke(input)\n} catch (e) {\n  return { error: (e as Error).message }\n}","preventionTips":["Always pass the Azure AD object ID (GUID), not a UPN or email — this check accepts any string but Graph rejects non-GUIDs downstream.","Resolve UPN/email via GET /users?$filter=mail eq '...' first.","Audit defaultParams; resolve IDs from prior list calls."],"tags":["validation","microsoft-teams","required-field","channel","members","user-id"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}