FlowiseAI/Flowise · error · Error

Topic is required to update a chat

Error message

Topic is required to update a chat

What it means

Thrown synchronously by UpdateChatTool._call when topic is falsy after the chatId check passes. Above the try block at core.ts:710, propagates as a raw Error. zod schema (core.ts:691) marks topic required. This is the only field update the tool exposes, so an empty topic is a no-op the tool refuses to send.

Source

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

            }),
            baseUrl: BASE_URL,
            method: 'PATCH',
            headers: {}
        }

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

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

        if (!chatId) {
            throw new Error('Chat ID is required')
        }

        if (!topic) {
            throw new Error('Topic is required to update a chat')
        }

        try {
            const body = { topic }
            const endpoint = `/chats/${chatId}`
            await this.makeTeamsRequest(endpoint, 'PATCH', body)

            return this.formatResponse(
                {
                    success: true,
                    message: 'Chat updated successfully'
                },
                params
            )
        } catch (error) {
            return this.formatResponse(`Error updating chat: ${error}`, params)
        }
    }

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Pass a non-empty topic string.
  2. If the goal is to remove a topic, note Graph's PATCH /chats/{id} does not accept null topic — you cannot clear it via this tool.
  3. Fix the params spread order.
  4. Catch the propagated Error upstream.

Example fix

// before
if (!topic) {
    throw new Error('Topic is required to update a chat')
}

// after — explicit trim and a structured failure for empty/whitespace
if (!topic || !String(topic).trim()) {
    throw new Error('Topic is required to update a chat')
}
Defensive patterns

Strategy: validation

Validate before calling

function validateUpdateChatTopic(input: unknown) {
  const { topic } = (input ?? {}) as any
  if (typeof topic !== 'string' || !topic.trim()) {
    throw new Error('topic is required and must be a non-empty string')
  }
}

Type guard

function isNonEmptyTopic(x: unknown): x is string {
  return typeof x === 'string' && x.trim() !== ''
}

Try / catch

try {
  if (!isNonEmptyTopic(input.topic)) return { error: 'topic required' }
  return await updateChatTool.invoke(input)
} catch (e) {
  return { error: (e as Error).message }
}

Prevention

When it happens

Trigger: update_chat invoked with chatId but empty/undefined topic; defaultParams.topic set to '' or undefined; agent thinking it can clear the topic by passing empty string.

Common situations: Agent calling update without specifying a topic; UI clearing the topic field; intent to remove the topic (not supported — Graph does not allow clearing group chat topic via this PATCH shape).

Related errors


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