FlowiseAI/Flowise · error · Error

Model ID is required

Error message

Model ID is required

What it means

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.

Source

Thrown at packages/components/nodes/embeddings/AWSBedrockEmbedding/AWSBedrockEmbedding.ts:133

    }

    loadMethods = {
        async listModels(): Promise<INodeOptionsValue[]> {
            return await getModels(MODEL_TYPE.EMBEDDING, 'AWSBedrockEmbeddings')
        },
        async listRegions(): Promise<INodeOptionsValue[]> {
            return await getRegions(MODEL_TYPE.EMBEDDING, 'AWSBedrockEmbeddings')
        }
    }

    async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
        const iRegion = nodeData.inputs?.region as string
        const iModel = nodeData.inputs?.model as string
        const customModel = nodeData.inputs?.customModel as string
        const inputType = nodeData.inputs?.inputType as string
        const endpointHost = (nodeData.inputs?.endpointHost as string)?.trim()
        const effectiveModel = customModel || iModel
        if (!effectiveModel) throw new Error('Model ID is required')

        if (effectiveModel.startsWith('cohere') && !inputType) {
            throw new Error('Input Type must be selected for Cohere models.')
        }

        const obj: BedrockEmbeddingsParams = {
            model: effectiveModel,
            region: iRegion
        }

        /**
         * Long-term credentials specified in embedding configuration are optional.
         * Bedrock's credential provider falls back to the AWS SDK to fetch
         * credentials from the running environment.
         * Supports STS AssumeRole when a Role ARN is configured in the credential.
         */
        const credentialConfig = await getAWSCredentialConfig(nodeData, options, iRegion)
        if (credentialConfig.credentials) {

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Select a model in the node's model input, or fill customModel with a valid Bedrock modelId (e.g. amazon.titan-embed-text-v1).
  2. If loading from saved JSON, ensure the model field is persisted.
  3. Add a default at the boundary: `const effectiveModel = customModel || iModel || 'amazon.titan-embed-text-v1'`.
  4. Validate nodeData.inputs.model presence in the editor before allowing save.

Example fix

// before
const effectiveModel = customModel || iModel
if (!effectiveModel) throw new Error('Model ID is required')

// after
const effectiveModel = (customModel || iModel || '').trim()
if (!effectiveModel) throw new Error('Model ID is required: set `model` or `customModel`.')
Defensive patterns

Strategy: validation

Validate before calling

const effectiveModel = (customModel || iModel || '').trim()
if (!effectiveModel) throw new Error('Bedrock embeddings: set `model` or `customModel`')

Type guard

function hasModelId(v: unknown): boolean {
    const o = v as any
    return typeof o?.model === 'string' && o.model.length > 0 || typeof o?.customModel === 'string' && o.customModel.length > 0
}

Prevention

When it happens

Trigger: 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.

Common situations: Migrated/imported flow missing the model field, UI bug clearing the selection, or programmatic node construction that omits model.

Related errors


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