FlowiseAI/Flowise · error · Error

AWS Bedrock retry limit reached:

Error message

AWS Bedrock retry limit reached: 

What it means

Thrown by processInBatches after the in-loop retry counter exhausts maxRetries while AWS Bedrock keeps raising ThrottlingException. Each retry re-runs the same batchSize chunk (i = i - batchSize) and adds 100ms of backoff (sleepTime += 100). Non-throttling errors bypass retries entirely and throw at the else branch.

Source

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

): Promise<number[][]> => {
    let sleepTime = 0
    let retryCounter = 0
    let result: number[][] = []
    for (let i = 0; i < documents.length; i += batchSize) {
        let chunk = documents.slice(i, i + batchSize)
        try {
            let chunkResult = await Promise.all(chunk.map(processFunc))
            result.push(...chunkResult)
            retryCounter = 0
        } catch (e) {
            if (retryCounter < maxRetries && e.name.includes('ThrottlingException')) {
                retryCounter = retryCounter + 1
                i = i - batchSize
                sleepTime = sleepTime + 100
            } else {
                // Split to distinguish between throttling retry error and other errors in trance
                if (e.name.includes('ThrottlingException')) {
                    throw new Error('AWS Bedrock retry limit reached: ' + e)
                } else {
                    throw new Error(e)
                }
            }
        }
        await new Promise((resolve) => setTimeout(resolve, sleepTime))
    }
    return result
}

module.exports = { nodeClass: AWSBedrockEmbedding_Embeddings }

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Lower the node's batchSize (e.g. from 50 to 10) so each chunk stays under the model TPS limit.
  2. Request a Bedrock model quota increase in the AWS console for the target region/model.
  3. Increase maxRetries and/or pre-throttle the call rate from the caller so retries have room to succeed.
  4. Reduce concurrency by processing documents sequentially instead of Promise.all over the chunk.

Example fix

// before
const emb = await processInBatches(texts, 50, 3, embedOne)
// after
const emb = await processInBatches(texts, 10, 6, embedOne)
Defensive patterns

Strategy: retry

Validate before calling

// Estimate per-batch request count vs model TPS quota before embedding
const TPS_LIMIT = Number(process.env.BEDROCK_TPS_LIMIT ?? 5)
function safeBatchSize(desired: number, concurrency: number): number {
  return Math.max(1, Math.min(desired, Math.floor(TPS_LIMIT / Math.max(1, concurrency))))
}
const batchSize = safeBatchSize(50, 1)

Try / catch

// Wrap the embedding call; on retry-limit-exhausted, shrink batch and retry once
try {
  await processInBatches(texts, batchSize, maxRetries, embed)
} catch (e) {
  if (e instanceof Error && /retry limit reached/i.test(e.message)) {
    await processInBatches(texts, Math.max(1, Math.floor(batchSize / 2)), maxRetries, embed)
  } else {
    throw e
  }
}

Prevention

When it happens

Trigger: Embedding a large document set through AWSBedrockEmbedding where concurrent InvokeModel calls per batch exceed the model/region TPS quota for more than maxRetries consecutive attempts. Sustained 429 ThrottlingException from the Bedrock runtime on amazon.titan-embed-text-v2 / cohere.embed payloads.

Common situations: batchSize set too high for the account quota; burst traffic in a shared AWS account; quota increase never requested for the region/model; high concurrency from multiple chatflows hitting the same credentials.

Related errors


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