Vellum Workflow Server

raw JSON →
1.14.7 verified Sat May 09 auth: no python

The Vellum Workflow Server is a Python library for building and hosting AI workflows. It provides a framework to define, execute, and serve complex LLM-based pipelines with features like node-based DAGs, retries, observability, and API endpoints. Current version: 1.14.7. Release cadence: frequent updates (weekly/biweekly). Requires Python >=3.9, <4.

pip install vellum-workflow-server
error ModuleNotFoundError: No module named 'vellum'
cause Installed 'vellum-workflow-server' but trying to import 'vellum' (old package name).
fix
Use 'from vellum_workflow_server import ...' instead of 'from vellum import ...'.
error TypeError: 'NoneType' object is not subscriptable
cause API key not provided, causing prompt node to fail internally.
fix
Set environment variable (e.g., OPENAI_API_KEY) before running workflow.
error ValueError: Node 'prompt' has unconnected input 'text'
cause Output of one node not properly connected to input of another.
fix
Specify 'depends_on' and map input names correctly, e.g., node.inputs['text'] = previous_node.outputs['result'].
breaking Library was renamed from 'vellum' to 'vellum-workflow-server' in v2.0. Old 'pip install vellum' installs a different package. Must update imports and dependencies.
fix Replace 'from vellum import ...' with 'from vellum_workflow_server import ...'. Also update requirements.txt.
gotcha API keys must be set via environment variables or passed explicitly. The library does not auto-read .env files.
fix Use os.environ.get('VARIABLE_NAME') or set keys in code (not recommended for production).
deprecated Node base class 'Node' is deprecated in favor of specific node types (e.g., PromptNode, CodeNode). Direct subclassing of Node may break in future releases.
fix Use provided node classes or extend their subclasses.
gotcha Workflow.run() is synchronous and blocking. For async execution, use Workflow.arun() but requires async environment.
fix For async, ensure event loop is running and use await workflow.arun().

Defines a simple workflow with input, prompt (GPT-4), and output nodes, then executes it.

from vellum_workflow_server import Workflow
from vellum_workflow_server.nodes import PromptNode, InputNode, OutputNode
import os

workflow = Workflow()
input_node = InputNode(name="input")
prompt_node = PromptNode(
    name="prompt",
    prompt_template="Hello {{ input.text }}",
    model="gpt-4",
    api_key=os.environ.get("OPENAI_API_KEY", "")
)
output_node = OutputNode(name="output")

workflow.add_node(input_node)
workflow.add_node(prompt_node, depends_on=[input_node])
workflow.add_node(output_node, depends_on=[prompt_node])

result = workflow.run(input={"text": "world"})
print(result)