Skip to main content

Hello everyone,


I’m building an Integration with the monday Apps Framework and deploying my webhook handler via mapps code:push into the monday-code serverless environment. My /monday/execute_action function does the following on each status-change event:



  1. Creates a new item on a target board

  2. Copies over connected-board column relations

  3. Fetches & recreates subitems (including mapping their columns)

  4. Sends GraphQL mutations back to monday.com


This works fine when users “Approve” a handful of items, but if they trigger the same recipe on ~100 items simultaneously, I start seeing:



  • “Complexity budget exhausted” errors

  • Timeouts or retries from monday.com

  • Intermittent “itemId not found” errors when creating subitems


Questions:


Can I safely enqueue jobs from within monday-code? For example, pushing payloads to AWS SQS / Redis-Bull and using another Lambda or container to process them with controlled concurrency (e.g. p-limit(5))—or is that discouraged?


Are there any pure-serverless patterns (monday-code + SQS event mappings, DynamoDB dedupe, etc.) that people have successfully used to avoid spinning up dedicated servers?


Token-refresh & dedupe: How do others handle OAuth token expiry in a long-running job queue, and persist de-duplication state across many parallel executions?


Thanks for all the insights!

Take a look at the monday code queue

Apps Framework

The “Need help” AI button says:


—-


The monday code queue is a built-in message queue system based on a simple publish-subscribe (pub/sub) model, available for apps hosted on monday code. Each minor and major app version has its own queue.


Key features:




  • Publishing messages: Use the JavaScript SDK to publish messages to the queue. Messages are sent as POST requests to your app’s /mndy-queue endpoint.


    import { Queue } from "@mondaycom/apps-sdk";
    const queue = new Queue();

    const messageContent = JSON.stringify({ content: "This is a message" });
    const messageId = await queue.publishMessage(messageContent);



  • Receiving messages: Your app should listen for POST requests at /mndy-queue. When a message is received, process it and respond with HTTP 200 within 10 minutes. If not, monday code will retry up to 9 more times.


    app.post(
    "/mndy-queue",
    async (req, res) => {
    try {
    const { body, query } = req;
    readQueueMessage({ body, query });
    return res.status(200).send({});
    } catch (err) {
    logger.error(err.error);
    return res.status(500).send({ message: "internal server error" });
    }
    }
    );



  • Security: Each message includes a random secret in the query parameters. Use validateMessageSecret to ensure the message is authentic.


    const queryParams = req.query;
    if (!queue.validateMessageSecret(queryParams.secret)) {
    logger.info("Queue message received is not valid, since secret does not match. This message could come from an attacker.");
    throw new Error('not allowed');
    }



  • Retries: If your endpoint does not respond with HTTP 200 within 10 minutes, the message will be retried up to 10 times before being dropped.




For more details and code samples, see the official documentation: Queue SDK.


Is there a way for the queue to provide a way to control the queue’s concurrency or rate? Once tasks enter the queue, they seem to execute simultaneously, leading to complexity issues. Is there a mechanism to regulate execution flow?"


Reply