Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

398
Vistas
Serverless Express Lambda async invoke not working

I have a basic Serverless Express app in a lambda, with a route set to async true. I want to trigger this route asynchronously from a different application, and expect it to run in the background without having to wait for the response.

The route in serverless.yml

- http:
    path: foo/{any+}
    method: post
    async: true
- http:
    path: another/sync-route
    method: post

Note: I have other routes in here that are not invoked asynchronously.

When I call this method, it correctly returns a 200 response immediately. But the actual code is never run, I have a DB insert in there, and it doesn't happen. In the API Gateway I can see the X-Amz-Invocation-Type header is correctly being passed as Event type.

Integration Request HTTP headers

What am I missing here? The route controller is a test and the code is very simple

 testAsync: async (req, res) => {
    console.log("In Test Async");  // Does not display in Cloudwatch
    try {
      const { value } = req.body;
      const resp = await updateTest(value);  // This just inserts an entry in the DB with value
      return res.send(resp);
    } catch (err) {
      return res.status(500).send(err);
    }
  },

Is there any other setting I'm missing here? I'm not an AWS expert, so any help would be highly appreciated. Thanks!

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda