Skip to main content

Usage

workflow build [options]
Or using the short alias:
wf build [options]

Options

--target
string
default:"standalone"
Build target for deployment.Alias: -tOptions:
  • standalone - Standalone deployment
  • vercel-build-output-api - Vercel Build Output API
Example:
workflow build --target standalone
workflow build -t vercel-build-output-api
--workflow-manifest
string
default:""
Output location for workflow manifest.Must end in .json, .js, .cjs, or .mjs.Alias: -mExample:
workflow build --workflow-manifest ./dist/manifest.json
workflow build -m ./output/workflows.js

Positional Arguments

target
string
Build target (deprecated, use --target flag instead).Example:
workflow build standalone  # deprecated
workflow build --target standalone  # preferred

Examples

Default Build

workflow build
Builds with standalone target.

Vercel Build

workflow build --target vercel-build-output-api

Custom Manifest Location

workflow build --workflow-manifest ./dist/manifest.json

Combined Options

workflow build --target standalone --workflow-manifest ./build/workflows.json

Build Targets

standalone

Builds workflows for standalone deployment:
  • Creates workflow bundles
  • Generates manifest
  • Suitable for custom hosting
Output:
.workflow/
├── workflows.mjs
├── steps.mjs
├── webhook.mjs
└── manifest.json

vercel-build-output-api

Builds workflows for Vercel deployment:
  • Creates Vercel Build Output API compatible functions
  • Configures serverless functions
  • Sets up edge routes
Output:
.vercel/output/
└── functions/
    ├── .well-known/workflow/v1/flow.func/
    ├── .well-known/workflow/v1/step.func/
    └── .well-known/workflow/v1/webhook/[token].func/

Output

Successful build:
$ workflow build --target standalone

Using target: standalone
Building with StandaloneBuilder
Build completed successfully!
With warnings:
$ workflow build --target invalid

Invalid target "invalid". Using default "standalone".
Valid targets: standalone, vercel-build-output-api
Using target: standalone
Building with StandaloneBuilder
Build completed successfully!
Build error:
$ workflow build

Using target: standalone
Building with StandaloneBuilder
Error: Build failed: Unable to find workflow files

Error Handling

Invalid Manifest Extension

$ workflow build --workflow-manifest ./manifest.txt

Error: Invalid --workflow-manifest provided, must end in .json or .js. 
Received: ./manifest.txt

Invalid Target

Automatically falls back to standalone with a warning.

Build Failures

Displays detailed error message:
Error: Build failed: [error details]

Configuration

The build command uses getWorkflowConfig() to load configuration:
  • Discovers workflow files in the project
  • Applies build target settings
  • Configures output paths
  • Sets up bundler options

Workflow Discovery

Automatically discovers workflows from:
  • workflows/ directory
  • Source directories configured by framework integrations
  • Files with "use workflow" or "use step" directives

Manifest Output

The manifest contains:
{
  "workflows": {
    "workflowId": {
      "id": "workflowId",
      "name": "Workflow Name",
      "steps": [...]
    }
  },
  "steps": {
    "stepId": {
      "id": "stepId",
      "name": "Step Name"
    }
  },
  "classes": {...}
}

Exit Codes

  • 0 - Build succeeded
  • 1 - Build failed

Build docs developers (and LLMs) love