Include remaining query and mutation complexities in action payloads

It would be really useful if the current “after” query and mutation complexity values, along with the reset in x seconds, were sent in action payloads.

We know what our integration recipes will use minimally, to be able to get this information at our router (or before) means we can respond with an error to the event, causing monday to retry in 30 seconds with a new token (or better if we can specify a retry-after value).

While we can query for the complexity of the query pool, there is no way (at least that I know of) to get the complexity of the mutation pool without making a mutation - but monday could get this while sending to us, I expect.

Then we can make a decision based on the integrations minimum requirements and what is available, and stop it at the earliest point. While not 100% exact, this will let us cut down on having our worker environments invoked for long durations waiting for complexity limits to reset. It also means there is less chance of a series of mutations being paused halfway through execution. If a recipe requires changing columns, changing a group, and creating an update - we don’t know there may be a mutation complexity limit until the columns are changed. This way we can avoid a recipe appearing to fail halfway through before completing.

Additionally, if either query or mutation pool is below the minimum threshold to execute any query or mutation (10 or 30000) - then monday should just delay sending us the event entirely until the reset happens.

Hello @codyfrisch,

Thank you for sharing your request with us!

I have taken it to our team :slightly_smiling_face: