Workflow Onboarding Drip banner
vercel-labs vercel-labs

Workflow Onboarding Drip

Productivity community

Description

onboarding-drip — Workflow DevKit Example

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Onboarding Drip Campaign

A multi-day email drip campaign workflow built with Vercel Workflow DevKit. This example demonstrates how to use `sleep()` to schedule emails over the course of a week without consuming compute resources during wait periods.

What This Example Demonstrates

  • Durable sleep: Using sleep() with duration strings like "1d", "2d", "4d" to pause workflow execution for days without consuming resources
  • Multi-step workflows: Breaking down the campaign into discrete steps with "use step" directive
  • Workflow orchestration: Using "use workflow" directive to define the main workflow function
  • API integration: Starting workflows from a Next.js API route using start()

Email Schedule

Day Email Type Description
0 Welcome Immediate welcome email when user signs up
1 Getting Started Tips and guidance for new users
3 Feature Highlights Showcase key features
7 Follow-up Request feedback and offer help

Project Structure

01-onboarding-drip/
├── app/
│   ├── api/
│   │   └── onboarding/
│   │       └── route.ts      # API endpoint to start the workflow
│   ├── globals.css
│   ├── layout.tsx
│   └── page.tsx
├── workflows/
│   └── onboarding-drip.ts    # The drip campaign workflow
├── next.config.ts            # Uses withWorkflow() wrapper
├── package.json
└── tsconfig.json

Getting Started

  1. Install dependencies:
pnpm install
  1. Run the development server:
pnpm dev
  1. Start an onboarding drip campaign:
curl -X POST http://localhost:3000/api/onboarding \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com"}'

API Reference

POST /api/onboarding

Start a new onboarding drip campaign for a user.

**Request Body:**

{
  "email": "user@example.com"
}

**Response:**

{
  "message": "Onboarding drip campaign started",
  "runId": "run_abc123",
  "em