Unique Execution Id for Idempotency?

Hello there!

I have a NodeJS function scheduled as a cron job that has been executing multiple times. I learned recently that serverless functions should be idempotent. My question is if there’s some sort of id that’s shared across multiple executions if they’re trying to execute a function at a certain time. I have assumed that the awsRequestId from the context parameter is shared across multiple executions, but I wanted to confirm that assumption. Today I integrated my AWS account with a observability dashboard called Kloudmate and from what I can see from that, there is an id called “executionId” which is shared across multiple executions. If awsRequestId isn’t that, is there a way I can access this “executionId” to use it for idempotency purposes?

Thanks!

Looks like awsRequestId and executionId are the same thing. So you can use the awsRequestId as an idempotency id for a cron job.