workflow

Returns an Astro integration that transforms workflow code ("use step"/"use workflow" directives) and builds the workflow bundles.

Usage

To enable "use step" and "use workflow" directives while developing locally or deploying to production, add workflow() to the integrations array of your Astro config.

astro.config.mjs
// @ts-check
import { defineConfig } from "astro/config";
import { workflow } from "workflow/astro";

// https://astro.build/config
export default defineConfig({
  integrations: [workflow()],
});

The integration registers the workflow Vite transform plugins during astro:config:setup and builds the workflow bundles: locally during config setup, or via the Vercel builder after astro:build:done when deploying to Vercel.

API signature

Parameters

ParameterTypeDescription
optionsWorkflowPluginOptionsOptional. Configures the workflow build.

WorkflowPluginOptions

OptionTypeDefaultDescription
sourcemapboolean | 'inline' | 'linked' | 'external' | 'both''inline' (dev) / false (prod)Controls source maps on generated workflow bundles. Accepts the same values as esbuild's sourcemap option. Defaults to 'inline' in development and false in production (smaller function bundles, which helps stay under the Vercel 250 MB function size limit). Set it explicitly, or use the WORKFLOW_SOURCEMAP environment variable, to override in either environment.

Returns

Returns an AstroIntegration object to include in the integrations array of your Astro config.