Documentation Index
Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
veryfront/workflow
DAG-based agentic workflows with human-in-the-loop support.
Import
import {
workflow,
step,
parallel,
branch,
waitForApproval,
createWorkflowClient,
} from "veryfront/workflow";
Examples
Simple sequential workflow
import { workflow, step } from "veryfront/workflow";
const pipeline = workflow({
id: "summarize",
steps: () => [
step("fetch", { tool: "webScraper" }),
step("summarize", { agent: "writer" }),
],
});
Parallel steps and human-in-the-loop
import { workflow, step, parallel, branch, waitForApproval } from "veryfront/workflow";
const contentPipeline = workflow({
id: "content-pipeline",
steps: ({ input }) => [
step("research", { agent: "researcher" }),
parallel("generate", [
step("write", { agent: "writer" }),
step("images", { tool: "imageGenerator" }),
]),
branch("review", {
condition: () => input.requiresApproval,
then: [waitForApproval("human-review", { timeout: "24h" })],
}),
step("publish", { agent: "publisher" }),
],
});
API
workflow(options)
Create a workflow definition.
| Property | Type | Description | Source |
|---|
id | string | Unique workflow identifier | source |
description? | string | Human-readable description | source |
version? | string | Semantic version string | source |
inputSchema? | Schema<TInput> | Zod schema for workflow input validation | source |
outputSchema? | Schema<TOutput> | Zod schema for workflow output validation | source |
retry? | RetryConfig | Retry configuration for failed steps | source |
timeout? | string | number | Max execution time (ms) | source |
introspect? | boolean | Enable runtime introspection for debugging | source |
steps | WorkflowNode[] | ((context: StepBuilderContext<TInput>) => WorkflowNode[]) | Workflow step definitions | source |
onError? | (error: Error, context: WorkflowContext) => void | Promise<void> | Error handler called when a step fails | source |
onComplete? | (result: TOutput, context: WorkflowContext) => void | Promise<void> | Callback fired after workflow completes | source |
Returns: Workflow<TInput, TOutput>
Type Reference
StepOptions
Options accepted by step.
| Property | Type | Description | Source |
|---|
agent? | string | Agent | Agent to run (by ID or instance) | source |
tool? | string | Tool | Tool to execute (by ID or instance) | source |
input? | string | Record<string, unknown> | ((context: WorkflowContext) => unknown) | Step input: static value or function of workflow context | source |
checkpoint? | boolean | Persist state after this step | source |
retry? | RetryConfig | Retry configuration for this step | source |
timeout? | string | number | Step timeout (ms) | source |
skip? | (context: WorkflowContext) => boolean | Promise<boolean> | Predicate: skip this step if returns true | source |
BranchOptions
Options accepted by branch.
| Property | Type | Description | Source |
|---|
condition | (context: WorkflowContext) => boolean | Promise<boolean> | Branch predicate function | source |
then | WorkflowNode[] | Steps when condition is true | source |
else? | WorkflowNode[] | Steps when condition is false | source |
checkpoint? | boolean | Persist state after this node | source |
retry? | RetryConfig | Retry configuration | source |
timeout? | string | number | Node timeout (ms or duration string) | source |
skip? | (context: WorkflowContext) => boolean | Promise<boolean> | Predicate: skip if returns true | source |
ParallelOptions
Options accepted by parallel.
| Property | Type | Description | Source |
|---|
strategy? | "all" | "race" | "allSettled" | Completion strategy ("all", "race", "allSettled") | source |
checkpoint? | boolean | Persist state after this node | source |
retry? | RetryConfig | Retry configuration | source |
timeout? | string | number | Node timeout (ms or duration string) | source |
skip? | (context: WorkflowContext) => boolean | Promise<boolean> | Predicate: skip if returns true | source |
Exports
Functions
| Name | Description | Source |
|---|
agentStep | Create a workflow step that runs an agent. | source |
branch | Create a conditional branch node. | source |
createWorkflowClient | Create workflow client. | source |
dag | Create a directed workflow graph. | source |
delay | Create a simple delay/sleep node. | source |
dependsOn | Declare workflow step dependencies. | source |
doWhile | Create a do-while workflow loop. | source |
generateId | Generate a unique workflow ID | source |
getWorkflowTenant | Get the current workflow tenant context. Returns undefined if not executing within a workflow step. | source |
hasWorkerSupport | Check whether worker support is present. | source |
loop | Create a loop workflow step. | source |
map | Create a mapped workflow step. | source |
parallel | Create a parallel node for concurrent execution of multiple steps. | source |
parseDuration | Parse duration string to milliseconds | source |
sequence | Create a sequential workflow definition. | source |
step | Create a workflow step definition. | source |
subWorkflow | Create a sub-workflow node for nested execution. | source |
times | Create a fixed-count workflow loop. | source |
toolStep | Create a workflow step that runs a tool. | source |
unless | Create a branch that only executes if condition is false. | source |
useApproval | Manage workflow approval interactions. | source |
useWorkflow | React hook for workflow. | source |
useWorkflowList | List and filter workflow runs. | source |
useWorkflowStart | React hook for workflow start. | source |
waitForApproval | Create a wait-for-approval node. Pauses until human approves/rejects. | source |
waitForEvent | Create a wait-for-event node. Pauses until external event is received. | source |
when | Create a branch that only executes if condition is true (no else). | source |
workflow | Create a workflow definition. | source |
Classes
| Name | Description | Source |
|---|
MemoryBackend | Implement memory backend. | source |
RedisBackend | Implement redis backend. | source |
WorkflowClient | Implement workflow client. | source |
WorkflowExecutor | Workflow Executor class | source |
Types
| Name | Description | Source |
|---|
BackendConfig | Configuration used by backend. | source |
BranchOptions | Options accepted by branch. | source |
CapturedTenantContext | Captured tenant context for multi-tenant workflow execution. Allows tools and framework utilities to access the current tenant without explicit parameter passing. | source |
LoopOptions | Options accepted by loop. | source |
MapOptions | Options accepted by map. | source |
ParallelOptions | Options accepted by parallel. | source |
RedisAdapter | Standardized Redis Adapter Interface Normalizes differences between Deno and Node Redis clients | source |
RedisBackendConfig | Redis backend configuration | source |
StepOptions | Options accepted by step. | source |
SubWorkflowOptions | Options accepted by sub workflow. | source |
UseApprovalOptions | Options accepted by use approval. | source |
UseApprovalResult | Result returned from use approval. | source |
UseWorkflowListOptions | Options accepted by use workflow list. | source |
UseWorkflowListResult | Result returned from use workflow list. | source |
UseWorkflowOptions | Options accepted by use workflow. | source |
UseWorkflowResult | Result returned from use workflow. | source |
UseWorkflowStartOptions | Options accepted by use workflow start. | source |
UseWorkflowStartResult | Result returned from use workflow start. | source |
WaitForApprovalOptions | Options accepted by wait for approval. | source |
WaitForEventOptions | Options accepted by wait for event. | source |
Workflow | Workflow instance | source |
WorkflowBackend | Public API contract for workflow backend. | source |
WorkflowClientConfig | Configuration used by workflow client. | source |
WorkflowContext | Workflow context - accumulates node outputs during execution | source |
WorkflowDefinition | Workflow definition | source |
WorkflowExecutorConfig | Workflow executor configuration | source |
WorkflowHandle | Controller for a running workflow. | source |
WorkflowNode | Workflow node | source |
WorkflowNodeConfig | Union of all workflow node configurations | source |
WorkflowOptions | Options accepted by workflow. | source |
WorkflowRun | Workflow run state | source |
WorkflowStatus | Public API contract for workflow status. | source |
Constants
| Name | Description | Source |
|---|
api | Context-aware API that automatically uses the current tenant. | source |
Deep imports
These import paths group focused functionality under this module. Each is a separate barrel; import only what you need.
veryfront/workflow/claude-code
Claude Agent SDK Integration Provides Claude Code agentic capabilities within Veryfront workflows. Uses your local Claude Code installation — no separate API key needed.
import { createAgent, createClaudeCodeTool, createEventPublisher } from "veryfront/workflow/claude-code";
Functions
| Name | Description | Source |
|---|
createAgent | Create a reusable agent function with preset configuration. | source |
createClaudeCodeTool | Create a customized Claude Code tool | source |
createEventPublisher | Create an event publisher based on environment | source |
createWebSocketHandler | Create a WebSocket handler for HTTP upgrade requests | source |
createWorkspaceSync | Create a workspace sync for a Claude Code run | source |
executeAgent | Execute a task using the Claude Agent SDK. | source |
withWorkspace | Execute a function with a synchronized workspace | source |
Classes
| Name | Description | Source |
|---|
AgentController | Agent controller for handling client commands | source |
CallbackEventPublisher | Simple callback-based publisher Calls a function for each event | source |
MemoryEventPublisher | In-memory event publisher using EventTarget Useful for testing or single-process deployments | source |
MultiEventPublisher | Publishes events to multiple publishers | source |
RedisEventPublisher | Implement redis event publisher. | source |
SSEEventPublisher | Server-Sent Events publisher Writes events directly to a ReadableStream controller | source |
WebSocketPublisher | WebSocket-based bidirectional publisher | source |
WorkspaceSync | Workspace manager for Claude Code execution | source |
Types
| Name | Description | Source |
|---|
AgentConfig | Agent configuration | source |
ApprovalRequestEvent | Approval request event (sent to client when tool needs approval) | source |
BidirectionalPublisher | Bidirectional publisher interface (WebSocket) | source |
CancelCommand | Cancel the running agent | source |
CancelledEvent | Cancelled event | source |
ClaudeCodeEvent | Union of all event types | source |
ClaudeCodeEventBase | Base event interface | source |
ClaudeCodeEventHandler | Event subscriber callback | source |
ClaudeCodeEventPublisher | Event publisher interface for streaming events | source |
ClaudeCodeEventSubscriber | Event subscriber interface for receiving events | source |
ClaudeCodeEventType | Event types for streaming Claude Code execution | source |
ClaudeCodeMode | Tool modes for Claude Code agent | source |
ClaudeCodeResult | Final result from agent execution | source |
ClaudeCodeToolInput | Input schema type for claude-code workflow tools | source |
ClientCommand | Union of all client commands | source |
ClientCommandHandler | Handler for client commands | source |
ClientCommandType | Client command types for WebSocket communication | source |
CompleteEvent | Complete event (agent finished) | source |
ErrorEvent | Error event | source |
FileChange | File change tracking | source |
InputCommand | Send user input to the agent | source |
InputRequestEvent | Input request event (sent to client when agent needs user input) | source |
IterationCompleteEvent | Iteration complete event | source |
IterationStartEvent | Iteration start event | source |
PingCommand | Keepalive ping | source |
PongEvent | Pong response to ping | source |
RedisEventPublisherConfig | Redis event publisher configuration | source |
TextCompleteEvent | Text complete event | source |
TextDeltaEvent | Text delta event (streaming text chunk) | source |
ThinkingCompleteEvent | Thinking complete event | source |
ThinkingDeltaEvent | Thinking delta event | source |
ThinkingStartEvent | Thinking start event (extended thinking) | source |
ToolApprovalConfig | Tool approval configuration | source |
ToolCallCompleteEvent | Tool call complete event | source |
ToolCallInputEvent | Tool call input delta (streaming input JSON) | source |
ToolCallStartEvent | Tool call start event | source |
ToolResultEvent | Tool result event | source |
UploadResult | Upload result | source |
WebSocketPublisherConfig | WebSocket publisher configuration | source |
WorkspaceConfig | Workspace configuration | source |
WorkspaceSyncResult | Workspace sync result | source |
Constants
| Name | Description | Source |
|---|
bugFixTool | Bug fix tool (code mode) | source |
claudeCodeTool | Claude Code tool for workflow steps | source |
codeReviewTool | Code review tool (analysis mode, read-only) | source |
docsTool | Documentation tool (code mode) | source |
refactorTool | Refactoring tool (code mode) | source |
veryfront/workflow/claude-code/react
React hooks for Claude Code streaming
import { useClaudeCodeStream, useClaudeCodeText, useClaudeCodeWebSocket } from "veryfront/workflow/claude-code/react";
Functions
| Name | Description | Source |
|---|
useClaudeCodeStream | React hook for streaming Claude Code execution | source |
useClaudeCodeText | Simplified hook that returns just the streaming text | source |
useClaudeCodeWebSocket | React hook for bidirectional Claude Code streaming | source |
Types
| Name | Description | Source |
|---|
PendingApproval | Pending approval state | source |
PendingInput | Pending input request state | source |
UseClaudeCodeStreamOptions | Options for useClaudeCodeStream hook | source |
UseClaudeCodeStreamState | State for Claude Code streaming | source |
UseClaudeCodeWebSocketActions | Actions returned by the hook | source |
UseClaudeCodeWebSocketOptions | Options for useClaudeCodeWebSocket hook | source |
UseClaudeCodeWebSocketState | State for Claude Code WebSocket | source |
veryfront/workflow/discovery
Workflow Discovery Module Provides utilities for discovering workflow definitions from user code.
import { createWorkflowRegistry, discoverWorkflows, findWorkflowById } from "veryfront/workflow/discovery";
Functions
| Name | Description | Source |
|---|
createWorkflowRegistry | Create a workflow registry from discovered workflows | source |
discoverWorkflows | Discover all workflows in a project | source |
findWorkflowById | Find a specific workflow by ID | source |
Types
| Name | Description | Source |
|---|
DiscoveredWorkflow | Discovered workflow info | source |
WorkflowDiscoveryOptions | Options for workflow discovery | source |
WorkflowDiscoveryResult | Result of workflow discovery | source |
veryfront/workflow/worker
Workflow Worker Module Provides distributed workflow execution support. Three modes available: 1. WorkflowWorker - In-process polling worker - Polls for stalled workflows and resumes them - Good for trusted code or single-tenant deployments - Simple setup, lower overhead 2. WorkflowJobManager + K8sJobExecutor - Kubernetes Job-based execution - Each workflow runs in an ephemeral container - Complete tenant isolation (no shared state) - Required for multi-tenant untrusted code execution 3. WorkflowJobManager + ProcessJobExecutor - Local process execution - Spawns child processes for each workflow - Good for local development without K8s/Docker - Mirrors production behavior
import { createDynamicJobEntrypoint, createJobEntrypoint, createWorkflowJobManager } from "veryfront/workflow/worker";
Components
| Name | Description | Source |
|---|
DYNAMIC_EXIT_CODES | Exit codes for the job | source |
EXIT_CODES | Exit codes for the job | source |
Functions
| Name | Description | Source |
|---|
createDynamicJobEntrypoint | Create dynamic job entrypoint. | source |
createJobEntrypoint | Create job entrypoint. | source |
createWorkflowJobManager | Create a workflow job manager | source |
createWorkflowWorker | Create a workflow worker | source |
isJobExecutor | Type guard to check if an object implements JobExecutor | source |
runDynamicWorkflowJob | Run a workflow job with dynamic discovery | source |
runWorkflowJob | Run the workflow job | source |
Classes
| Name | Description | Source |
|---|
K8sJobExecutor | Kubernetes Job Executor | source |
ProcessJobExecutor | Process Job Executor | source |
WorkflowJobManager | Workflow Job Manager | source |
WorkflowWorker | Implement workflow worker. | source |
Types
| Name | Description | Source |
|---|
CreateDynamicJobEntrypointOptions | Create a dynamic job entrypoint | source |
CreateJobEntrypointOptions | Create a simple job entrypoint script | source |
DynamicJobEntrypointConfig | Configuration for the dynamic job entrypoint | source |
JobConfig | Job configuration passed to executor | source |
JobEntrypointConfig | Configuration for the job entrypoint | source |
JobExecutor | Job Executor Interface | source |
JobInfo | Job information returned by executor | source |
JobStatus | Job execution status | source |
K8sClient | Kubernetes API client interface | source |
K8sJobExecutorConfig | K8s Job Executor configuration | source |
K8sJobSpec | K8s Job spec | source |
K8sJobStatusResponse | K8s Job status response | source |
ManagerStats | Manager statistics | source |
ManagerStatus | Manager status | source |
ProcessJobExecutorConfig | Process Job Executor configuration | source |
WorkerStats | Worker statistics | source |
WorkerStatus | Worker status | source |
WorkflowJobManagerConfig | Configuration for the Workflow Job Manager | source |
WorkflowWorkerConfig | Configuration for the workflow worker | source |
Reference modules:
User guides:
Architecture: