I've seen similar issues where long-running Node processes slow down after many calls. Can you check the following:
HTTP Agent Settings: The AWS SDK uses Node’s built-in HTTP/HTTPS agent, which by default enables keep-alive. Over time, stale connections might build up. One workaround is to turn off keep-alive:
const https = require('https');
const agent = new https.Agent({ keepAlive: false });
Resource Leaks: A long-lived process might suffer from minor memory or socket leaks that add up. I’d suggest profiling your application to see if memory usage or the number of open sockets increases over time.
SDK Version: Make sure you’re using the latest version of the AWS SDK. Older versions have had issues with connection handling that might be causing this slowdown.
SWF Workflow History: If your workflows accumulate a large number of events, it can slow down processing. Could you check if limiting the history size improves the response time?