M
Mastra•6d ago
april

Workflow run stuck in `running` state

We have a workflow run that appears to be orphaned - it's stuck in a running state, but it's not actually running. We started this workflow at Mon, 01 Dec 2025 00:49:22 GMT This workflow is still currently returning "status": "running" over 24 hours later. This workflow with this input typically takes between 1-5 minutes at most. Our current working theory: - We think the current state is that this workflow is set as running in the database, but the server that was running the workflow is no longer up. - This was executing in Azure App Services with autoscaling, so we think the instance might have possibly been scaled down during execution, but we don't know that for sure. We can't provide a reproduction (at least not yet), but we have the database and I can get the current execution status from our backend and see it still "running", so if I can query the DB to get any useful information for this please let me know. Some questions from us: - What does the mastra dev team think is happening here? Is this a known issue? - How could we avoid this? - More importantly, since it may be caused by our infra in some way, how can we recover from this kind of issue? - Is there a way to know if a task is actually being ran? - Can we time out tasks that are taking too long and have the mastra backend retry them later, maybe? The (modified) response from GET /api/workflows/{workflow}/runs/{runId}/execution-result describes none of the steps currently running, all show "status": "success", and there is no entry for the last step in the workflow at all - it seems to end at the second-to-last step.
3 Replies
Mastra Triager
Mastra Triager•6d ago
šŸ“ Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10752 šŸ” If you're experiencing an error, please provide a minimal reproducible example whenever possible to help us resolve it quickly. šŸ™ Thank you for helping us improve Mastra!
Taofeeq
Taofeeq•5d ago
Hi @april , thanks for opening it's likely the server closed just before it ran the last step, which is why it is stuck in running state We have a new restart api which ensures all active workflow runs are automatically restarted when the server starts. It will be in the next 0.x release
april
aprilOP•4d ago
Thank you! That sounds like it will be perfect for us, thanks for the quick response :)

Did you find this page helpful?