FlowiseAI/Flowise · error · Error

Agent name is required!

Error message

Agent name is required!

What it means

Thrown by Agent node init when nodeData.inputs.agentName is falsy. The agent name is lowercased and underscore-joined to form the agent's identifier within the sequential-agent graph, so an empty label makes the graph ambiguous and is rejected up front.

Source

Thrown at packages/components/nodes/sequentialagents/Agent/Agent.ts:480

        ]
    }

    async init(nodeData: INodeData, input: string, options: ICommonObject): Promise<any> {
        let tools = nodeData.inputs?.tools
        tools = flatten(tools)
        let agentSystemPrompt = nodeData.inputs?.systemMessagePrompt as string
        agentSystemPrompt = transformBracesWithColon(agentSystemPrompt)
        let agentHumanPrompt = nodeData.inputs?.humanMessagePrompt as string
        agentHumanPrompt = transformBracesWithColon(agentHumanPrompt)
        const agentLabel = nodeData.inputs?.agentName as string
        const sequentialNodes = nodeData.inputs?.sequentialNode as ISeqAgentNode[]
        const maxIterations = nodeData.inputs?.maxIterations as string
        const model = nodeData.inputs?.model as BaseChatModel
        const promptValuesStr = nodeData.inputs?.promptValues
        const output = nodeData.outputs?.output as string
        const approvalPrompt = nodeData.inputs?.approvalPrompt as string

        if (!agentLabel) throw new Error('Agent name is required!')
        const agentName = agentLabel.toLowerCase().replace(/\s/g, '_').trim()

        if (!sequentialNodes || !sequentialNodes.length) throw new Error('Agent must have a predecessor!')

        let agentInputVariablesValues: ICommonObject = {}
        if (promptValuesStr) {
            try {
                agentInputVariablesValues = typeof promptValuesStr === 'object' ? promptValuesStr : JSON.parse(promptValuesStr)
            } catch (exception) {
                throw new Error("Invalid JSON in the Agent's Prompt Input Values: " + exception)
            }
        }
        agentInputVariablesValues = handleEscapeCharacters(agentInputVariablesValues, true)

        const startLLM = sequentialNodes[0].startLLM
        const llm = model || startLLM
        if (nodeData.inputs) nodeData.inputs.model = llm

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Set a non-empty agentName on the Agent node (e.g. 'researcher', 'writer').
  2. If using a variable, ensure it resolves to a non-empty string at runtime.
  3. Avoid names that become empty after .toLowerCase().replace(/\s/g,'_').trim() - i.e. do not use a whitespace-only label.

Example fix

// before: agentName = '' (or whitespace)
// after: agentName = 'research_agent'
Defensive patterns

Strategy: validation

Validate before calling

function deriveAgentName(label: unknown): string {
  if (typeof label !== 'string' || label.trim().length === 0) {
    throw new Error('Agent name is required and must be non-empty.')
  }
  const name = label.toLowerCase().replace(/\s/g, '_').trim()
  if (name.length === 0) throw new Error('Agent name resolves to empty after normalization.')
  return name
}

Type guard

function isNonEmptyAgentName(label: unknown): label is string {
  if (typeof label !== 'string') return false
  return label.toLowerCase().replace(/\s/g, '_').trim().length > 0
}

Try / catch

try {
  await agentNode.init(nodeData, input, options)
} catch (e) {
  if (e instanceof Error && e.message === 'Agent name is required!') {
    // highlight the agentName field
  }
  throw e
}

Prevention

When it happens

Trigger: Agent node's 'agentName' field left blank; the field bound to a variable resolving to empty; node duplicated without renaming.

Common situations: User drags an Agent node but never fills the name; relying on a template variable that was not injected; whitespace-only name (trimmed to empty).

Related errors


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