# Calling a lambda within a NestJS project

**URL:** https://forum.serverless.com/t/calling-a-lambda-within-a-nestjs-project/18762
**Category:** Serverless Architectures
**Created:** [April 13, 2023, 3:30pm UTC](https://forum.serverless.com/t/calling-a-lambda-within-a-nestjs-project/18762 "2023-04-13T15:30:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![damianlluch](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/damianlluch/32/7371_2.png) [@damianlluch](https://forum.serverless.com/u/damianlluch)
#### Post date: [April 13, 2023, 3:30pm UTC](https://forum.serverless.com/t/calling-a-lambda-within-a-nestjs-project/18762/1 "2023-04-13T15:30:33Z")

</div>

Calling a lambda within a NestJS project

Hi, I have a project with NestJS, Lambda, Serverless architecture. So each Nest application is a lambda.

The problem I have, is that I need to call inside a lambda, to another lambda of the same project.  
I am doing it with invoke. The call goes in fine, I see it in the logs, but the problem is that I get an empty client-context. So I am failing in the parameters issue.

If anyone has done it and has a suggestion.

Thanks!

---

<div class="post-metadata">

### Author: ![ktwbc](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/ktwbc/32/764_2.png) [@ktwbc](https://forum.serverless.com/u/ktwbc)
#### Post date: [April 16, 2023, 12:41am UTC](https://forum.serverless.com/t/calling-a-lambda-within-a-nestjs-project/18762/2 "2023-04-16T00:41:56Z")

</div>

You have each nest application as a Lambda? That sounds strange.

Regardless, we use an npm package [GitHub - peak-ai/ais-service-discovery-js](https://github.com/peak-ai/ais-service-discovery-js) and put the lambdas in cloudmap, and this library does both in one shot (looks up the lambda by name via cloudmap then invokes it) and greatly simplifies things rather than doing manual invoke commands.

```auto
const ServiceDiscovery = require('@peak-ai/ais-service-discovery');
await ServiceDiscovery.request('namespace.service->handler', body);

```

They also have a serverless plugin [GitHub - peak-ai/serverless-cloudmap: Serverless plugin for Cloudmap](https://github.com/peak-ai/serverless-cloudmap) whicih is how you get your lambda functions registered into cloudmap in the first place.
