FlowiseAI/Flowise · error · Error
Members list is required to create a chat
Error message
Members list is required to create a chat
What it means
Thrown synchronously by CreateChatTool._call when members is falsy after the params merge. Above the try block at core.ts:648, propagates as a raw Error. zod schema (core.ts:634) declares members as a required string — a comma-separated list of user IDs. Note the schema's chatType enum is ['oneOnOne','group'] while the default in _call (core.ts:646) is 'group', and topic is only attached for group chats (core.ts:664).
Source
Thrown at packages/components/nodes/tools/MicrosoftTeams/core.ts:649
schema: z.object({
chatType: z.enum(['oneOnOne', 'group']).optional().default('group').describe('Type of chat to create'),
topic: z.string().optional().describe('Topic/subject of the chat (for group chats)'),
members: z.string().describe('Comma-separated list of user IDs to add to the chat')
}),
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 { chatType = 'group', topic, members } = params
if (!members) {
throw new Error('Members list is required to create a chat')
}
try {
const memberIds = members.split(',').map((id: string) => id.trim())
const chatMembers = memberIds.map((userId: string) => ({
'@odata.type': '#microsoft.graph.aadUserConversationMember',
'user@odata.bind': `https://graph.microsoft.com/v1.0/users('${userId}')`
}))
const body: any = {
chatType,
members: chatMembers
}
if (topic && chatType === 'group') {
body.topic = topic
}
View on GitHub (pinned to abe4a8601a)
Solutions
- Pass members as a non-empty comma-separated string of Azure AD user object IDs.
- For oneOnOne chats pass exactly two IDs (yourself + the other user); for group chats pass 2+ IDs.
- Validate the string splits into at least one non-empty ID before invoking.
- Fix the params spread order.
- Catch the propagated Error upstream.
Example fix
// before — only checks truthiness, accepts ' , '
if (!members) {
throw new Error('Members list is required to create a chat')
}
// after — validate at least one real ID is present
const memberIds = String(members ?? '').split(',').map((s) => s.trim()).filter(Boolean)
if (memberIds.length === 0) {
throw new Error('Members list is required to create a chat')
} Defensive patterns
Strategy: validation
Validate before calling
function validateCreateChatInput(input: unknown) {
const { members, chatType } = (input ?? {}) as any
if (typeof members !== 'string' || !members.trim()) {
throw new Error('members is required and must be a comma-separated string of user IDs')
}
const ids = members.split(',').map((s) => s.trim()).filter(Boolean)
if (ids.length === 0) throw new Error('members must contain at least one user ID')
if (chatType === 'oneOnOne' && ids.length !== 2) {
throw new Error('oneOnOne chat requires exactly two user IDs')
}
for (const id of ids) {
if (!/^[0-9a-f-]{36}$/i.test(id)) throw new Error(`userId ${id} is not a GUID`)
}
} Type guard
function isCreateChatArgs(x: unknown): x is { members: string; chatType?: 'oneOnOne' | 'group'; topic?: string } {
if (typeof x !== 'object' || x === null) return false
const o = x as any
if (typeof o.members !== 'string' || !o.members.trim()) return false
return o.members.split(',').map((s: string) => s.trim()).filter(Boolean).length > 0
} Try / catch
try {
if (!isCreateChatArgs(input)) return { error: 'comma-separated members string required' }
return JSON.parse((await createChatTool.invoke(input)).split(TOOL_ARGS_PREFIX)[0])
} catch (e) {
return { error: (e as Error).message }
} Prevention
- Pass members as a comma-separated string of Azure AD object IDs — not an array.
- For oneOnOne chats include exactly two IDs (the signed-in user + the other party).
- Topic is only applied to group chats — do not set it for oneOnOne.
- Resolve any UPN/email to a GUID via /users first.
When it happens
Trigger: create_chat invoked without members; defaultParams clobbering members to undefined; agent passing an array instead of a comma-separated string (would pass this check but fail at Graph); members string empty after trim.
Common situations: Agent forgetting to populate members; UI multi-select cleared; members passed as an array because the schema says 'list'; defaultParams misconfiguration; oneOnOne chat requested with wrong number of members (passes this check, fails downstream).
Related errors
- Team ID and Display Name are required to create a channel
- Team ID, Channel ID, and User ID are all required
- Chat ID is required
- Topic is required to update a chat
- Team ID is required to list channels
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/112fdce7df9a6fb8.
Report an issue: GitHub.