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.
| Concept | Meaning |
|---|---|
| Workflow | The definition stored in workflows/. |
| Workflow run | The canonical public execution record for a started workflow. |
| Runtime adapter | The implementation detail that dispatches the workflow run to a runtime target or infrastructure worker. |
| Schedule | A trigger definition that creates workflow runs over time when its target starts with workflow:. |
Prerequisites
- A Veryfront project with the
workflows/directory available (see Create project). - Any agents or tools referenced by a step are defined in
agents/ortools/(see Agents and Tools). - A provider configured for any agents the workflow uses (see Providers).
Define a workflow
Create a file inworkflows/:
Start a workflow
Define workflows inworkflows/, then start them from the surface that owns the user or system event.
| Start point | Use when |
|---|---|
| API route | A user action or webhook starts the run. |
| Agent tool | An agent decides whether to start the run. |
| Task | Background work starts the run. |
| Client UI | The UI calls an API route that starts the run. |
createWorkflowClient() to register and start a workflow from server code:
agent and tool used by the workflow exists in agents/ or tools/, then call the route:
execute:
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 aworkflow:<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
| Property | Type | Description |
|---|---|---|
agent | string | Agent | Agent to run (by ID or instance) |
tool | string | Tool | Tool to execute (by ID or instance) |
input | string | object | (ctx) => unknown | Step input |
checkpoint | boolean | Persist state after this step |
retry | RetryConfig | Retry on failure |
timeout | string | number | Step timeout |
skip | (ctx) => boolean | Skip this step conditionally |
Parallel execution
Run steps concurrently:"compile" step waits for all of them to finish.
Parallel strategies
Branching
Usebranch for conditional paths:
Human-in-the-loop
Pause a workflow until a human approves or rejects: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: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.