Skip to content

Workflow Steps Don't Run After Sleep #634

@tjunxiang92

Description

@tjunxiang92

I have a workflow that sleeps and on random occasions, the workflow does not resume. The sleep duration usually ranges from 50 - 9000ms. When I rounded to the nearest second, it seems to reduce the issue but it occured at around 30 minutes mark of my workflow. In Vercel logs, there is a timeout log observed everytime the error occurs

async function sleepIfRequired(startTime: number, delayMs: number) {
	// BUG: Rounded to the nearest thousand seem to not lead to any issues
	const timeTaken = Date.now() - startTime;
	const sleepTime = Math.ceil((delayMs - timeTaken) / 1000) * 1000;
	if (sleepTime >= 1000) {
		await sleep(sleepTime);
	}
}

I am using: "workflow": "4.0.1-beta.32"

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions