Skip to main content
This guide shows you how to install Workflow DevKit in a SvelteKit project.
1

Install dependencies

Install the workflow package:
2

Configure Vite

Add the Workflow plugin to your Vite config:
vite.config.ts
The plugin automatically:
  • Adds the Rollup transform plugin for workflow code transformation
  • Configures hot module replacement for workflow files
  • Builds workflow bundles before SvelteKit starts
  • Generates Vercel functions during production builds (when using Vercel adapter)
3

Enable TypeScript support (Optional)

Add the Workflow TypeScript plugin to your tsconfig.json for IntelliSense:
tsconfig.json

How it works

The SvelteKit integration:
  • Uses @workflow/rollup for code transformation
  • Uses @workflow/vite for hot module replacement
  • Builds workflows synchronously on startup (before SvelteKit initialization)
  • Automatically discovers workflows in your project
  • Generates route handlers at .well-known/workflow/v1/*
  • Configures Vercel queue triggers when deploying to Vercel

Example workflow

src/lib/workflows/subscription.ts

Triggering workflows

Start workflows from API routes:
src/routes/api/subscribe/+server.ts

Development

Run the development server:
Trigger a workflow:

Production

Build for production:

Vercel deployment

When using the Vercel adapter, the plugin automatically:
  • Patches Vercel function configurations
  • Configures queue triggers for workflow and step execution
  • Sets retry policies (max 64 deliveries, 5s retry delay)
Install the Vercel adapter:
Configure it in svelte.config.js:
svelte.config.js

Next steps

Core Concepts

Learn about workflows and steps

API Reference

View the full SvelteKit API reference