# How do I access the serverless requestId in cron initiated lambdas?

**URL:** <https://forum.serverless.com/t/how-do-i-access-the-serverless-requestid-in-cron-initiated-lambdas/9465>\
**Category:** Serverless Framework\
**Tags:** lambda\
**Created:** [September 26, 2019, 8:38pm UTC](https://forum.serverless.com/t/how-do-i-access-the-serverless-requestid-in-cron-initiated-lambdas/9465 "2019-09-26T20:38:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dutzi](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/dutzi/32/3644_2.png) [@dutzi](https://forum.serverless.com/u/dutzi)\
**Post date:** [September 26, 2019, 8:38pm UTC](https://forum.serverless.com/t/how-do-i-access-the-serverless-requestid-in-cron-initiated-lambdas/9465/1 "2019-09-26T20:38:42Z")

</div>

When the trigger for a lambda is Api Gateway, the event object has `event.requestContext.requestId`, when triggering the same lambda from a cron job, there is not `requestContext` and no `requestId`.

Is there a way to pass the requestId to the lambda?

---

<div class="post-metadata">

**Author:** ![bfieber](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/bfieber/32/653_2.png) [@bfieber](https://forum.serverless.com/u/bfieber)\
**Post date:** [September 27, 2019, 3:32pm UTC](https://forum.serverless.com/t/how-do-i-access-the-serverless-requestid-in-cron-initiated-lambdas/9465/2 "2019-09-27T15:32:36Z")

</div>

That’s because requestId is a property of the API Gateway event type and not the Cloudwatch event type.

See [Using AWS Lambda with Other Services](https://docs.aws.amazon.com/lambda/latest/dg/lambda-services.html) for examples of event payloads you can expect from the various other services.  
For this comparison, look at:

- [Using AWS Lambda with Amazon API Gateway](https://docs.aws.amazon.com/lambda/latest/dg/with-on-demand-https.html)  
vs.
- [Using AWS Lambda with Amazon CloudWatch Events](https://docs.aws.amazon.com/lambda/latest/dg/with-scheduled-events.html)

---

<div class="post-metadata">

**Author:** ![dutzi](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/dutzi/32/3644_2.png) [@dutzi](https://forum.serverless.com/u/dutzi)\
**Post date:** [September 27, 2019, 4:14pm UTC](https://forum.serverless.com/t/how-do-i-access-the-serverless-requestid-in-cron-initiated-lambdas/9465/3 "2019-09-27T16:14:23Z")

</div>

I think I get what you mean. Just to make sure, are you talking about the requestId used by Serverless? e.g., the one highlighted here:

[https://dashboard.serverless.com/tenants/my-username/applications/my-project/services/my-service/stage/dev/region/us-east-1/invocations-explorer/](https://dashboard.serverless.com/tenants/my-username/applications/my-project/services/my-service/stage/dev/region/us-east-1/invocations-explorer/) **`5709fc64-7d8b-46fb-a56d-b9765aee5318`**

Also, if that’s the case, is there any way to map AWS’s requestId to Serverless’s requestId?
