
A template for building your own workflow automation platform. Built on top of Workflow DevKit, this template provides a complete visual workflow builder with real integrations and code generation capabilities.
You can deploy your own version of the workflow builder to Vercel with one click:
What happens during deployment:
"use workflow" directiveCreate a .env.local file with the following:
# DatabaseDATABASE_URL=postgresql://user:password@localhost:5432/workflow_builder# Better AuthBETTER_AUTH_SECRET=your-secret-keyBETTER_AUTH_URL=http://localhost:3000# AI Gateway (for AI workflow generation)AI_GATEWAY_API_KEY=your-openai-api-key
# Install dependenciespnpm install# Run database migrationspnpm db:push# Start development serverpnpm dev
Visit http://localhost:3000 to get started.
Workflows can be converted to executable TypeScript code with the "use workflow" directive:
export async function welcome(email: string, name: string, plan: string) {"use workflow";const { subject, body } = await generateEmail({name,plan,});const { status } = await sendEmail({to: email,subject,body,});return { status, subject, body };}
# Via APIGET /api/workflows/{id}/generate-code
The generated code includes:
GET /api/workflows - List all workflowsPOST /api/workflows - Create a new workflowGET /api/workflows/{id} - Get workflow by IDPUT /api/workflows/{id} - Update workflowDELETE /api/workflows/{id} - Delete workflowPOST /api/workflows/{id}/execute - Execute a workflowGET /api/workflows/{id}/executions - Get execution historyGET /api/workflows/executions/{executionId}/logs - Get detailed execution logsGET /api/workflows/{id}/generate-code - Generate TypeScript codePOST /api/workflows/{id}/generate-code - Generate with custom optionsPOST /api/ai/generate-workflow - Generate workflow from promptuser - User accountssession - User sessionsworkflows - Workflow definitionsworkflow_executions - Execution historyworkflow_execution_logs - Detailed node execution logs# Developmentpnpm dev# Buildpnpm build# Type checkingpnpm type-check# Lintingpnpm lint# Formattingpnpm format# Databasepnpm db:generate # Generate migrationspnpm db:push # Push schema to databasepnpm db:studio # Open Drizzle Studio
Send transactional emails with Resend's API.
import { sendEmail } from "@/lib/integrations/resend";await sendEmail({to: "user@example.com",subject: "Welcome!",body: "Welcome to our platform",});
Create and manage Linear issues.
import { createTicket } from "@/lib/integrations/linear";await createTicket({title: "Bug Report",description: "Something is broken",priority: 1,});
Direct database access for queries and updates.
import { queryData } from "@/lib/integrations/database";await queryData("users", { email: "user@example.com" });
Make HTTP requests to any API.
import { callApi } from "@/lib/integrations/api";await callApi({url: "https://api.example.com/endpoint",method: "POST",body: { data: "value" },});
This template is built on top of Workflow DevKit, a powerful workflow execution engine that enables:
"use workflow" directiveLearn more about Workflow DevKit at workflow.dev
Apache 2.0