Next.js Discord

Discord Forum

server actions execution timeout

Unanswered
Savannah posted this in #help-forum
Open in Discord
SavannahOP
What is the limit for server actions timeout? I know regular api routes are 300 seconds

13 Replies

proabibly vercel (at least i assume these days 😭 )
regular api is 10 second if ure on free tier in vercel....
@Savannah What is the limit for server actions timeout? I know regular api routes are 300 seconds
West African Crocodile
only pro plan have 300 seconds
thats why i host my APP on VPS 🆒 unlimited time
imo if your using server actions you shouldn't need that much time, and if you need more time then more advanced route handlers may be better
@Savannah did you find out the server action timeout?
Spectacled Caiman
@Savannah +1
@Tan what exactly is VPS?
West African Crocodile
UBUNTU
Tan
Spectacled Caiman
Since server actions run as serverless functions, it should be safe to assume they have the same restriction as well.

Maybe we can test it out using some code like this. Small overhead on start and end but it should be close enough.

const waitTime = 5 // 5 mins
const myAction = async () => {
  "use server"
  await new Promise((resolve) => setTimeout(resolve, waitTime * 60 *1000))
}