Code-first Approach
The instructions below will guide you through creating a Workflow using a starter template with the Vellum CLI.
Initialize a new Workflow from a template
Before using vellum workflows init
, make sure you have set your VELLUM_API_KEY
environment variable. See the installation guide for instructions on how to set this up.
Use the Vellum CLI to clone a starter template:
You’ll see available templates. For this example, we’ll use the Prompt Chaining template:

Select Prompt Chaining (option 1). When it completes succesfully, you’ll get a message like: Successfully pulled Workflow into ~/.../prompt_chaining
Understanding the Prompt Chaining template
The Prompt Chaining template generates blog topics, outlines, and full posts tailored to specific industries and audiences. It demonstrates key concepts like:
- Workflow Inputs: Parameters that customize the workflow behavior
- Connecting Nodes: How nodes pass data between each other
- Scenarios: Test cases for experimentation
The cloned Workflow includes these core files:
The display/
directory contains UI-specific files that are useful when pushing back to the Vellum UI later. You don’t need to modify these files.
Run your Workflow
Test your Workflow using the sandbox file:
The sandbox.py
file contains test cases that you can use as a “vibe-check” while experimenting. For more rigorous testing, use our Evaluations product.
Configuration files
Your project will include configuration files:
vellum.lock.json
: Tracks the state of your Workflow for push/pull operationspyproject.toml
: Alternative configuration approach (learn more)
Push to Vellum UI
Once you’ve built and tested your Workflow locally, you can push it to the Vellum UI for debugging, collaboration, or to let subject matter experts help with prompt optimization.
Create a new Workflow Sandbox
- Go to app.vellum.ai/workflow-sandboxes
- Click “Create Workflow” to make a new Workflow Sandbox

Get the push command
From your Sandbox, click:
- The “Command Line” button
- The “Push” tab
- “Copy” to get the CLI snippet

The snippet will look like:
Next Steps
- Core Concepts - Learn about BaseWorkflow, BaseNode, and control flow
- Defining Control Flow - Master workflow graph patterns
- Configuration - Set up your development environment
- Examples - Explore real-world Workflow examples
- Evaluations - Test your Workflows rigorously