Optimized for: Gemini / ChatGPT / Claude
Advanced AI Prompt for External API Call Timeout and Retry Optimization
Use this engineered prompt to drastically optimize your workflow and output.
Required Variables
- ✦
[EXTERNAL_API_LATENCY] - ✦
[RETRY_STRATEGY] - ✦
[MAX_LAMBDA_TIMEOUT]
lambda-api-timeout-retry-optimization.txt
Review a Lambda function's interaction with external services having [EXTERNAL_API_LATENCY]. Optimize the [RETRY_STRATEGY] using exponential backoff and jitter to prevent 'deadlock' scenarios that waste execution time. Suggest an optimal [MAX_LAMBDA_TIMEOUT] that balances user experience with cost protection. Propose an asynchronous architectural pattern (e.g., using EventBridge) to handle slow third-party responses without keeping the Lambda active.
Example Output
"The AI would design a decoupled architecture using SQS and a callback URL to handle 30+ second API responses without incurring Lambda idle costs."