Skip to main content
A workflow is a file in workflows/ that declares ordered steps. Each step runs an agent or a tool. The workflow runtime passes outputs between steps. Use workflows for multi-step work that needs ordering, branching, parallelism, retries, timeouts, or approvals. Workflow files are definitions. Starting a workflow creates a workflow run. On the Veryfront platform, that workflow run is backed by a runtime adapter so it can be queued, retried, canceled, logged, and observed in the Runs panel.

Prerequisites

  • A Veryfront project with the workflows/ directory available (see Create project).
  • Any agents or tools referenced by a step are defined in agents/ or tools/ (see Agents and Tools).
  • A provider configured for any agents the workflow uses (see Providers).

Define a workflow

Create a file in workflows/:
Steps run in order. Each step’s output is available to the next step via the workflow context.

Start a workflow

Define workflows in workflows/, then start them from the surface that owns the user or system event. Use createWorkflowClient() to register and start a workflow from server code:
Ensure every agent and tool used by the workflow exists in agents/ or tools/, then call the route:
The route returns the workflow run ID:
Inside an agent tool, start the workflow from execute:
Use handle.result() only when the caller should wait for completion. Return the runId when the workflow can continue in the background.

Schedule a workflow

Use a schedule with a workflow:<workflow-id> target when a workflow must run on a schedule. See Runs for run creation and event monitoring. Each scheduled trigger creates a workflow run backed by the selected runtime adapter.

Steps

A step runs an agent or a tool:

Step options

Parallel execution

Run steps concurrently:
All three analysis steps run at the same time. The "compile" step waits for all of them to finish.

Parallel strategies

Branching

Use branch for conditional paths:
Shorthand helpers:

Human-in-the-loop

Pause a workflow until a human approves or rejects:
The workflow pauses at waitForApproval and resumes when an approver responds. If the timeout expires, the workflow fails.

Wait for events

Pause until an external event arrives:

Workflow configuration

Verify it worked

Start the workflow from the start route, then poll the run state until it reaches a terminal status:
A working run reaches status: "completed" and exposes a nodeStates map with one completed entry per step. If status ends in failed, inspect the matching node entry in nodeStates for the underlying error.