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

Install dependencies

Install the workflow package:
2

Configure Nitro

Add the Workflow module to your Nitro config:
nitro.config.ts
The Workflow module automatically:
  • Adds the Rollup transform plugin to process workflow directives
  • Builds workflow bundles during development and production
  • Generates route handlers at .well-known/workflow/v1/*
  • Supports hot module replacement in development

Configuration Options

You can configure the TypeScript plugin:
nitro.config.ts
3

Enable TypeScript support (Optional)

The TypeScript plugin can be enabled via Nitro config (shown above) or directly in tsconfig.json:
tsconfig.json

How it works

The Nitro integration:
  • Transform plugin: Uses @workflow/rollup to transform workflow and step functions
  • Build hooks: Builds workflows during build:before and supports HMR via dev:reload
  • Route generation: Creates virtual handlers for workflow endpoints:
    • /.well-known/workflow/v1/webhook/:token - Webhook handling
    • /.well-known/workflow/v1/step - Step execution
    • /.well-known/workflow/v1/flow - Workflow execution
    • /.well-known/workflow/v1/manifest.json - Manifest (when WORKFLOW_PUBLIC_MANIFEST=1)
  • Vercel integration: Automatically generates Vercel functions when deploying with preset: 'vercel'
  • Externalization: Excludes generated workflow bundles from dev reloads for better performance

Example workflow

server/workflows/order-processing.ts

Triggering workflows

Start workflows from API routes:
server/api/orders.post.ts

Development

Run the development server:
The Workflow module will:
  • Build workflows on startup
  • Watch for changes and rebuild automatically
  • Provide HMR for workflow files

Production

Build for production:
For Vercel deployment, the module automatically:
  • Generates Vercel function configurations
  • Sets up queue triggers for workflow execution
  • Configures retry policies

Advanced usage

Exposing the manifest

Set the WORKFLOW_PUBLIC_MANIFEST environment variable to expose the workflow manifest:
The manifest will be available at /.well-known/workflow/v1/manifest.json.

Using with other frameworks

The Nitro integration is used internally by:
  • Express: Via custom routes configuration
  • Fastify: Via custom routes configuration
  • Hono: Via custom routes configuration
  • Nuxt: Via the Nuxt module which wraps Nitro

Next steps

Core Concepts

Learn about workflows and steps

API Reference

View the full Nitro API reference