{"record":{"id":"120c60781dea0b39","repo":"FlowiseAI/Flowise","slug":"worker-name-is-required","errorCode":null,"errorMessage":"Worker name is required!","messagePattern":"Worker name is required!","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/multiagents/Worker/Worker.ts","lineNumber":96,"sourceCode":"                label: 'Max Iterations',\n                name: 'maxIterations',\n                type: 'number',\n                optional: true\n            }\n        ]\n    }\n\n    async init(nodeData: INodeData, input: string, options: ICommonObject): Promise<any> {\n        let tools = nodeData.inputs?.tools\n        tools = flatten(tools)\n        let workerPrompt = nodeData.inputs?.workerPrompt as string\n        const workerLabel = nodeData.inputs?.workerName as string\n        const supervisor = nodeData.inputs?.supervisor as IMultiAgentNode\n        const maxIterations = nodeData.inputs?.maxIterations as string\n        const model = nodeData.inputs?.model as BaseChatModel\n        const promptValuesStr = nodeData.inputs?.promptValues\n\n        if (!workerLabel) throw new Error('Worker name is required!')\n        const workerName = workerLabel.toLowerCase().replace(/\\s/g, '_').trim()\n\n        if (!workerPrompt) throw new Error('Worker prompt is required!')\n\n        let workerInputVariablesValues: ICommonObject = {}\n        if (promptValuesStr) {\n            try {\n                workerInputVariablesValues = typeof promptValuesStr === 'object' ? promptValuesStr : JSON.parse(promptValuesStr)\n            } catch (exception) {\n                throw new Error(\"Invalid JSON in the Worker's Prompt Input Values: \" + exception)\n            }\n        }\n        workerInputVariablesValues = handleEscapeCharacters(workerInputVariablesValues, true)\n\n        const llm = model || (supervisor.llm as BaseChatModel)\n        const multiModalMessageContent = supervisor?.multiModalMessageContent || []\n\n        const abortControllerSignal = options.signal as AbortController","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/multiagents/Worker/Worker.ts#L78-L114","documentation":"Thrown by Worker.init when `nodeData.inputs?.workerName` is falsy. The worker name is required because it is normalized into a unique agent identifier (`workerLabel.toLowerCase().replace(/\\s/g, '_')`) used by the supervisor to route tasks.","triggerScenarios":"A Worker node placed on the canvas without filling in the workerName input, or a flow imported from JSON where workerName was omitted/empty.","commonSituations":"Authoring a new multi-agent flow and forgetting to label one worker; copy-pasting a worker node and clearing its name; programmatic chatflow creation that skips required fields.","solutions":["Open the Worker node config and supply a non-empty workerName.","If building chatflows programmatically, set `inputs.workerName` to a unique string per worker.","Add schema validation at flow-save so empty workerName is rejected in the UI."],"exampleFix":"// before\nconst workerLabel = nodeData.inputs?.workerName as string\n// after\nconst workerLabel = nodeData.inputs?.workerName as string\nif (!workerLabel?.trim()) throw new Error('Worker name is required!')","handlingStrategy":"validation","validationCode":"const workerLabel = (nodeData.inputs?.workerName as string)?.trim()\nif (!workerLabel) throw new Error('Worker name is required!')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Mark workerName as required in the node input schema.","Validate at flow-save time so the UI blocks publishing empty names.","Use unique names per worker to avoid routing collisions."],"tags":["validation","multiagent","required-field"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}