Assincronous Job
Is i possible to run a long task (30min-1hour) on a serverless endpoint, return the job id and when the job is completed hit a endpoint (to tell the job has finished)?
5 Replies
You can run long tasks you just need to disable Execution Timeout or set it for a larger amount of seconds. You can send a webhook URL in with your request and it will POST the results to that webhook once the job completes.
when i test it locally it does not send a webhook notificaiton about task completion. I wanted to check what is the notificaiton format that is sent
Yeah, you cannot test RUN endpoint locally only RUNSYNC. As the STATUS endpoint is not available locally. Also, webhook is not applied
i am not familiar with runpod almost at all but i need to figure out what is the output of the webhook request. Do you know what is the format of the post request sent to the webhook after task completion?
Yes, it is the same response you get when a job is completed. Whatever the output was from the request will be POST as JSON to your webhook URL.
Here is an example return from one of my endpoints. You're custom output will be in output. This is whatever you returned from the handler.