A Step Functions workflow coordinates three Lambdas: A (writes to DynamoDB), B (calls an external API), and C (writes final result). Lambda A sometimes succeeds but times out near completion; the external API should not be invoked unless A’s write is committed. What is the most robust approach?
Answer
In Step Functions, add retry with long intervals for A and only transition to B after verifying DynamoDB write completion via a conditional check
Explanation
If A’s final output is ambiguous due to timeout, verifying the committed state avoids invoking B prematurely. Conditional state checks make the workflow safe against partial failures.
Last reviewed: October 2026
Reviewed by FirstInTest Editorial Team
Related questions
You need to process an S3 upload event and write derived metadata to DynamoDB. Occasionally S3 notifications arrive more than once. Which combination is the best way to guarantee idempotent writes and handle failures reliably?
View question →
A Lambda function is invoked behind API Gateway. To minimize cold starts without breaking least-privilege, what is the best approach for accessing credentials for a single DynamoDB table and one SQS queue?
View question →
In DynamoDB, you use a GSI to query by customerId and filter by status. Query latency is high, and the filter expression is broad. Which redesign most likely reduces read cost and latency while keeping updates consistent?
View question →
A service uses API Gateway + Lambda. The Lambda function needs to call an external API and also publish events to SNS. For compliance, you must prevent clients from invoking the function directly and restrict the SNS topic permissions. What is the most appropriate access-control pattern?
View question →
You are developing a Java-based AWS Lambda function behind API Gateway using the AWS SDK. You want to reduce latency and avoid thread starvation during high concurrency. Which approach is best?
View question →
A team uses API Gateway with Lambda proxy integration. They want to attach a WAF policy but also ensure that only authenticated users can access endpoints. The team considers moving authentication into Lambda but still wants centralized request throttling and request validation. Which setup best meets the goals?
View question →