{"record":{"id":"8c84c0340257a289","repo":"FlowiseAI/Flowise","slug":"model-id-is-required","errorCode":null,"errorMessage":"Model ID is required","messagePattern":"Model ID is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/embeddings/AWSBedrockEmbedding/AWSBedrockEmbedding.ts","lineNumber":133,"sourceCode":"    }\n\n    loadMethods = {\n        async listModels(): Promise<INodeOptionsValue[]> {\n            return await getModels(MODEL_TYPE.EMBEDDING, 'AWSBedrockEmbeddings')\n        },\n        async listRegions(): Promise<INodeOptionsValue[]> {\n            return await getRegions(MODEL_TYPE.EMBEDDING, 'AWSBedrockEmbeddings')\n        }\n    }\n\n    async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {\n        const iRegion = nodeData.inputs?.region as string\n        const iModel = nodeData.inputs?.model as string\n        const customModel = nodeData.inputs?.customModel as string\n        const inputType = nodeData.inputs?.inputType as string\n        const endpointHost = (nodeData.inputs?.endpointHost as string)?.trim()\n        const effectiveModel = customModel || iModel\n        if (!effectiveModel) throw new Error('Model ID is required')\n\n        if (effectiveModel.startsWith('cohere') && !inputType) {\n            throw new Error('Input Type must be selected for Cohere models.')\n        }\n\n        const obj: BedrockEmbeddingsParams = {\n            model: effectiveModel,\n            region: iRegion\n        }\n\n        /**\n         * Long-term credentials specified in embedding configuration are optional.\n         * Bedrock's credential provider falls back to the AWS SDK to fetch\n         * credentials from the running environment.\n         * Supports STS AssumeRole when a Role ARN is configured in the credential.\n         */\n        const credentialConfig = await getAWSCredentialConfig(nodeData, options, iRegion)\n        if (credentialConfig.credentials) {","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/embeddings/AWSBedrockEmbedding/AWSBedrockEmbedding.ts#L115-L151","documentation":"init() guard in AWSBedrockEmbedding. effectiveModel is `customModel || iModel`; if both are absent the node cannot build a Bedrock embeddings request because modelId is mandatory for InvokeModelCommand.","triggerScenarios":"NodeData.inputs.model is empty AND customModel is empty — e.g. the model dropdown was cleared, the customModel input is hidden/empty, or the flow was imported without model metadata.","commonSituations":"Migrated/imported flow missing the model field, UI bug clearing the selection, or programmatic node construction that omits model.","solutions":["Select a model in the node's model input, or fill customModel with a valid Bedrock modelId (e.g. amazon.titan-embed-text-v1).","If loading from saved JSON, ensure the model field is persisted.","Add a default at the boundary: `const effectiveModel = customModel || iModel || 'amazon.titan-embed-text-v1'`.","Validate nodeData.inputs.model presence in the editor before allowing save."],"exampleFix":"// before\nconst effectiveModel = customModel || iModel\nif (!effectiveModel) throw new Error('Model ID is required')\n\n// after\nconst effectiveModel = (customModel || iModel || '').trim()\nif (!effectiveModel) throw new Error('Model ID is required: set `model` or `customModel`.')","handlingStrategy":"validation","validationCode":"const effectiveModel = (customModel || iModel || '').trim()\nif (!effectiveModel) throw new Error('Bedrock embeddings: set `model` or `customModel`')","typeGuard":"function hasModelId(v: unknown): boolean {\n    const o = v as any\n    return typeof o?.model === 'string' && o.model.length > 0 || typeof o?.customModel === 'string' && o.customModel.length > 0\n}","tryCatchPattern":null,"preventionTips":["Default the model field in the node UI to a valid Bedrock embed modelId.","Persist model metadata when exporting/importing flows.","Validate nodeData.inputs at save time in the editor.","Document the list of supported embed model ids per region."],"tags":["aws-bedrock","embeddings","validation","config"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}