FlowiseAI/Flowise · error · Error

There was a problem parsing your system message. Please try

Error message

There was a problem parsing your system message. Please try a prompt without one.

What it means

When the reducer has flagged mergeWithPreviousContent (e.g. a system message being merged into the prior content), it looks up acc.content[acc.content.length - 1]. If that entry is unexpectedly undefined, the system-message merge has no target and Flowise throws this user-facing message. It signals a malformed message sequence where a merge was requested but there is nothing to merge into.

Source

Thrown at packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/FlowiseChatGoogleGenerativeAI.ts:431

                throw new Error('Unsupported message input')
            }
            const author = getMessageAuthor(message)
            if (author === 'system' && index !== 0) {
                throw new Error('System message should be the first one')
            }
            const role = convertAuthorToRole(author)

            const prevContent = acc.content[acc.content.length]
            if (!acc.mergeWithPreviousContent && prevContent && prevContent.role === role) {
                throw new Error('Google Generative AI requires alternate messages between authors')
            }

            const parts = convertMessageContentToParts(message, isMultimodalModel, messages.slice(0, index), model)

            if (acc.mergeWithPreviousContent) {
                const prevContent = acc.content[acc.content.length - 1]
                if (!prevContent) {
                    throw new Error('There was a problem parsing your system message. Please try a prompt without one.')
                }
                prevContent.parts.push(...parts)

                return {
                    mergeWithPreviousContent: false,
                    content: acc.content
                }
            }
            let actualRole = role
            if (actualRole === 'function' || (actualRole === 'system' && !convertSystemMessageToHumanContent)) {
                actualRole = 'user'
            }
            const content: Content = {
                role: actualRole,
                parts
            }
            return {
                mergeWithPreviousContent: author === 'system' && !convertSystemMessageToHumanContent,

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Try the prompt without a system message (as the message text itself suggests) — use a HumanMessage with the same instructions instead.
  2. Ensure at least one non-system message precedes any merge-triggering system message, or move the system message to index 0.
  3. Toggle convertSystemMessageToHumanContent off in the node config to avoid the merge path entirely.
  4. Update FlowiseComponents — older builds had bugs in the system-merge branch that produced empty content arrays.

Example fix

// before
messages = [systemMsg] // merge path with empty acc.content -> throws [82]

// after
// drop the system message and fold its text into the first human message
messages = [new HumanMessage(systemMsg.content + '\n\n' + firstHuman.content)]
Defensive patterns

Strategy: validation

Validate before calling

function safeForSystemMerge(messages) {
  // If a system message exists and convertSystemMessageToHumanContent is on,
  // ensure there is at least one non-system message before it OR it is at index 0.
  const nonSys = messages.filter(m => getMessageAuthor(m) !== 'system')
  if (nonSys.length === 0 && messages.some(m => getMessageAuthor(m) === 'system')) {
    throw new Error('Refusing to send system-only payload to Google merge path')
  }
}

Type guard

function hasOnlySystemMessages(messages: unknown[]): boolean {
  return messages.length > 0 && messages.every(m => getMessageAuthor(m) === 'system')
}

Try / catch

try {
  await model.invoke(messages)
} catch (e) {
  if (e.message.includes('parsing your system message')) {
    const folded = new HumanMessage(messages[0].content)
    await model.invoke([folded, ...messages.slice(1)])
  } else throw e
}

Prevention

When it happens

Trigger: The very first message in the array is a system message while convertSystemMessageToHumanContent logic has set mergeWithPreviousContent=true, leaving acc.content empty when the lookup occurs. Also reachable when a system message follows a sequence that produced an empty content array.

Common situations: A chatflow whose first node is a SystemMessage paired with a setting that converts system to human content; misconfigured system-message handling after a memory clear; edge case where a leading system message and the alternate-messages check interact to leave content empty before merge.

Related errors


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