Call function/process after POST API call is completed

Is there a way to call a function after an API call has been completed? I have a content-type locations that once posted will look up weather data and add 365 rows to another content-type weather-logs. Currently, I have the weather-logs query and population in the locations controller, but this means that the POST request to locations takes upwards of 5 seconds due to the weather-logs population requiring querying an external API. Ideally I’d be able to return the response from the POST request immediately and make the weather-logs process asynchronous from the original POST request. Is this possible?

This topic has been created from a Discord post (1236378343583252581) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

Hey, did you found the solution for this problem? i want to do something similar

Hi <@151106389828304896> sorry about the very late response, I didn’t get any notification from your message. I did not figure out anything for this and am just dealing with the latency. I think I could set up a separate serverless function that i call asynchronously, but I was hopeful for a solution “in platform”