When we first launched Workflow SDK, the goal was simple: write regular async JavaScript, and let the SDK keep it running through crashes, deployments, and long waits.
workflows/welcome-user.ts
import { sleep } from "workflow" ;
export async function welcomeUser ( email ) {
"use workflow" ;
const user = await createUser ( email ) ;
await sendWelcomeEmail ( user ) ;
// Survives crashes and deployments
// while it waits
await sleep ( "3d" ) ;
await sendCheckInEmail ( user ) ;
}
A basic durable workflow
Last year, we shipped just that , with the world-class developer experience Vercel is known for.…