FlowiseAI/Flowise · error · Error

Failed to retrieve value: ${errorMessage}

Error message

Failed to retrieve value: ${errorMessage}

What it means

Thrown by DynamoDBRetrieveTool._call as a catch-all wrapper around any failure during a DynamoDB QueryCommand (send, item access, or field read). The original error message is interpolated, so the wrapped cause is always visible. It signals that a key-value retrieval against the configured table did not complete for a reason other than 'no item found' (which returns null JSON, not an error).

Source

Thrown at packages/components/nodes/tools/AWSDynamoDBKVStorage/AWSDynamoDBKVStorage.ts:178

            if (result.Items.length < nthLatestNum) {
                return JSON.stringify({
                    value: null,
                    timestamp: null
                })
            }

            const item = result.Items[nthLatestNum - 1]
            const value = item.value?.S || null
            const timestamp = item.timestamp?.S || item.sk?.S || null

            // Return JSON with value and timestamp
            return JSON.stringify({
                value: value,
                timestamp: timestamp
            })
        } catch (error) {
            const errorMessage = error instanceof Error ? error.message : String(error)
            throw new Error(`Failed to retrieve value: ${errorMessage}`)
        }
    }
}

/**
 * Node implementation for AWS DynamoDB KV Storage tools
 */
class AWSDynamoDBKVStorage_Tools implements INode {
    label: string
    name: string
    version: number
    type: string
    icon: string
    category: string
    description: string
    baseClasses: string[]
    credential: INodeParams
    inputs: INodeParams[]

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Read the interpolated errorMessage first — it names the real AWS SDK error (e.g. ResourceNotFoundException, AccessDeniedException, ValidationException) and dictates the fix.
  2. Verify the table exists in the selected region and that the IAM principal has dynamodb:Query on arn:aws:dynamodb:<region>:*:table/<tableName>.
  3. Confirm the table schema has a partition key 'pk' and a sort key 'sk' as the tool's QueryCommand assumes.
  4. Retry on transient AWS errors (ThrottlingException, 5xx) with exponential backoff rather than treating them as permanent.

Example fix

// before: credentials loaded once and never refreshed
const credentials = await getAWSCredentials(nodeData, options)
// after: validate the principal can actually query the table at init time
await dynamoClient.send(new DescribeTableCommand({ TableName: tableName }))
// surface a precise error before the tool ever runs
Defensive patterns

Strategy: try-catch

Validate before calling

// Before invoking the tool, confirm the table is queryable
import { DescribeTableCommand } from '@aws-sdk/client-dynamodb'
async function assertTableQueryable(client: DynamoDBClient, name: string) {
  try {
    await client.send(new DescribeTableCommand({ TableName: name }))
  } catch (e) {
    throw new Error(`Table ${name} not usable: ${(e as Error).message}`)
  }
}

Type guard

function isAwsSdkError(e: unknown): e is { name: string; message: string; Code?: string } {
  return typeof e === 'object' && e !== null && 'name' in e && typeof (e as any).name === 'string'
}

Try / catch

try {
  const out = await retrieveTool.invoke({ key: 'foo', nthLatest: '1' })
} catch (e) {
  const msg = e instanceof Error ? e.message : String(e)
  if (/Throttling|RequestLimitExceeded/.test(msg)) { /* backoff + retry */ }
  else if (/ResourceNotFound/.test(msg)) { /* table missing */ }
  else throw e
}

Prevention

When it happens

Trigger: Calling the retrieve tool with a key whose fullKey (prefix + '#' + key) exceeds DynamoDB limits, IAM/credentials lacking dynamodb:Query, a misconfigured table name, a malformed nthLatest value, or AWS throttling/network errors returned by dynamoClient.send().

Common situations: Wrong AWS region selected so the table does not exist; expired STS session token; the table was created without a sort key (sk) so the descending Query fails; a key containing characters that break KeyConditionExpression; rate limiting under heavy load.

Related errors


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