UNPKG

workflow

Version:

Workflow DevKit - Build durable, resilient, and observable workflows

143 lines (93 loc) 4.67 kB
--- title: Vercel World description: Fully-managed world for Vercel deployments with automatic storage, queuing, and authentication. type: integration summary: Deploy workflows to Vercel with fully-managed storage, queuing, and authentication. prerequisites: - /docs/deploying related: - /docs/deploying/world/local-world - /docs/deploying/world/postgres-world --- The Vercel World is a fully-managed workflow backend for applications deployed on Vercel. It provides scalable storage, distributed queuing, and automatic authentication with zero configuration. When you deploy to Vercel, workflows automatically use the Vercel World - no setup required. ## Usage Deploy your application to Vercel: ```bash vercel deploy ``` <FluidComputeCallout /> That's it. Vercel automatically: - Selects the Vercel World backend - Configures authentication using OIDC tokens - Provisions storage and queuing infrastructure - Isolates data per environment (production, preview, development) ## Observability Workflow observability is built into the Vercel dashboard on your project page. It respects your existing authentication and project permission settings. The `workflow` CLI commands open a browser window deeplinked to the Vercel dashboard: ```bash # List workflow runs (opens Vercel dashboard) npx workflow inspect runs --backend vercel # Launch the web UI (opens Vercel dashboard) npx workflow web --backend vercel ``` The CLI automatically retrieves authentication from the Vercel CLI (`vercel login`) and infers project/team IDs from your local Vercel project linking. To use the local observability UI instead of the Vercel dashboard: ```bash npx workflow web --backend vercel --localUi ``` To override the automatic configuration: ```bash npx workflow inspect runs \ --backend vercel \ --env production \ --project my-project \ --team my-team \ --authToken <your-token> ``` Learn more in the [Observability](/docs/observability) documentation. ## Testing & Performance <WorldTestingPerformance /> ## Configuration The Vercel World requires no configuration when deployed to Vercel. For advanced use cases, you can override settings programmatically via `createVercelWorld()`. ### `WORKFLOW_VERCEL_ENV` The Vercel environment to use. Options: `production`, `preview`, `development`. Automatically detected. ### `WORKFLOW_VERCEL_AUTH_TOKEN` Authentication token for API requests. Automatically detected. ### `WORKFLOW_VERCEL_PROJECT` Vercel project ID for API requests. Automatically detected. ### `WORKFLOW_VERCEL_TEAM` Vercel team ID for API requests. Automatically detected. ### `WORKFLOW_VERCEL_BACKEND_URL` Custom base URL for the Vercel workflow API. Automatically detected. ### Programmatic configuration {/* @skip-typecheck: incomplete code sample */} ```typescript title="workflow.config.ts" lineNumbers import { createVercelWorld } from "@workflow/world-vercel"; const world = createVercelWorld({ token: process.env.WORKFLOW_VERCEL_AUTH_TOKEN, baseUrl: "https://api.vercel.com/v1/workflow", projectConfig: { projectId: "my-project", teamId: "my-team", environment: "production", }, }); ``` ## Versioning On Vercel, workflow runs are pegged to the deployment that started them. This means: - Existing workflow runs continue executing on their original deployment, even as new code is deployed - New workflow runs start on the latest deployment - Code changes won't break in-flight workflows This ensures long-running workflows complete reliably without being affected by subsequent deployments. ## How It Works The Vercel World uses Vercel's infrastructure for workflow execution: - **Storage** - Workflow data is stored in Vercel's cloud with automatic replication and encryption - **Queuing** - Steps are distributed across serverless functions with automatic retries - **Authentication** - OIDC tokens provide secure, automatic authentication For more details, see the [Vercel Workflow documentation](https://vercel.com/docs/workflow). ## Pricing and More See the [Vercel Workflow documentation](https://vercel.com/docs/workflow) for current pricing and to learn more. For self-hosted deployments, use the [Postgres World](/worlds/postgres). For local development, use the [Local World](/worlds/local). ## Limitations - **Single-region deployment** - The backend infrastructure is currently deployed only in `iad1`. Applications in other regions will route workflow requests to `iad1`, which may result in higher latency. For best performance, deploy your Vercel apps using Workflow to `iad1`. Global deployment is planned to colocate the backend closer to your applications.