{"record":{"id":"b36e61eb8e53936a","repo":"FlowiseAI/Flowise","slug":"worker-prompt-is-required","errorCode":null,"errorMessage":"Worker prompt is required!","messagePattern":"Worker prompt is required!","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/multiagents/Worker/Worker.ts","lineNumber":99,"sourceCode":"                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\n        const workerInputVariables = getInputVariables(workerPrompt)\n\n        if (!workerInputVariables.every((element) => Object.keys(workerInputVariablesValues).includes(element))) {","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/multiagents/Worker/Worker.ts#L81-L117","documentation":"Thrown by Worker.init immediately after the workerName check, when `workerPrompt` is falsy. The worker prompt is the system prompt fed to createAgent; without it the agent has no instructions.","triggerScenarios":"Worker node configured with a name but no prompt template; prompt field cleared accidentally; chatflow JSON missing the workerPrompt key.","commonSituations":"Quickly adding workers and forgetting the prompt; relying on a default that does not exist.","solutions":["Fill in the workerPrompt field on the Worker node.","Provide a sensible default prompt template in the node's input schema.","Validate at flow-save time."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const workerPrompt = (nodeData.inputs?.workerPrompt as string)?.trim()\nif (!workerPrompt) throw new Error('Worker prompt is required!')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provide a default prompt template in the schema.","Block empty prompts at flow-save time."],"tags":["validation","multiagent","required-field","prompt"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}