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

Install dependencies

Install the workflow package:
2

Configure Astro

Add the Workflow integration to your Astro config:
astro.config.mjs
The integration automatically:
  • Adds Vite plugins for workflow transformation and hot reloading
  • Builds workflow bundles during development
  • Generates Vercel functions during production builds (when deployed to Vercel)
3

Enable TypeScript support (Optional)

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

How it works

The Astro integration:
  • Uses @workflow/rollup for code transformation
  • Uses @workflow/vite for hot module replacement
  • Builds workflow bundles during the astro:config:setup hook
  • Generates Vercel-specific functions during the astro:build:done hook
  • Automatically discovers workflows in your project

Example workflow

src/workflows/newsletter.ts

Triggering workflows

Start workflows from API routes:
src/pages/api/newsletter.ts

Deployment

When deploying to Vercel with the Astro Vercel adapter:
The Workflow integration automatically generates the required Vercel functions during the build process.

Next steps

Core Concepts

Learn about workflows and steps

API Reference

View the full Astro API reference