# Reply API Gateway with a second lambda function

**URL:** <https://forum.serverless.com/t/reply-api-gateway-with-a-second-lambda-function/5470>\
**Category:** Serverless Framework\
**Tags:** api-gateway\
**Created:** [August 15, 2018, 9:55pm UTC](https://forum.serverless.com/t/reply-api-gateway-with-a-second-lambda-function/5470 "2018-08-15T21:55:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luisdemarchi](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/luisdemarchi/32/2399_2.png) [@luisdemarchi](https://forum.serverless.com/u/luisdemarchi)\
**Post date:** [August 15, 2018, 9:55pm UTC](https://forum.serverless.com/t/reply-api-gateway-with-a-second-lambda-function/5470/1 "2018-08-15T21:55:57Z")

</div>

I would like to do the following:  
Create a lambda function that is trigger Gateway API, but this function will throw the main information in a queue (Aws SQS). By then a second lambda function execut the processing heavier.

Is it possible for the Gateway API return to wait for this second lambda function, without having to keep the first function alive?

---

<div class="post-metadata">

**Author:** ![buggy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/buggy/32/177_2.png) [@buggy](https://forum.serverless.com/u/buggy)\
**Post date:** [August 17, 2018, 4:46am UTC](https://forum.serverless.com/t/reply-api-gateway-with-a-second-lambda-function/5470/2 "2018-08-17T04:46:01Z")

</div>

This is a bad idea. Use SQS or SNS to trigger Lambdas for background tasks only. If your API response depends on those tasks completing then they should be done in the original Lambda
