For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
BlogLog InRequest Demo
HomeProductDevelopersSelf-HostingChangelog
HomeProductDevelopersSelf-HostingChangelog
  • Getting Started
    • Overview
  • Workflows SDK
    • Introduction
    • Installation
    • Core Concepts
    • Defining Control Flow
    • Configuration
    • Custom Docker Images
      • Displayable Nodes
        • Agent Node
        • Inline Prompt Node
        • Inline Subworkflow Node
        • Prompt Deployment Node
        • Search Node
        • Subworkflow Deployment Node
        • API Node
        • Code Execution Node
        • Templating Node
        • Guardrail Node
        • Map Node
        • Conditional Node
        • Merge Node
        • Error Node
        • Final Output Node
      • Datasets
      • CLI
  • Client SDK
    • Introduction
    • Authentication
    • API Versioning
LogoLogo
BlogLog InRequest Demo
Workflows SDKAPI ReferenceDisplayable Nodes

Error Node

1from vellum.workflows import BaseWorkflow
2from vellum.workflows.nodes import ErrorNode
3from vellum.workflows.inputs.base import BaseInputs
4from vellum.workflows.state import BaseState
5
6class Inputs(BaseInputs):
7 threshold: int
8
9class StartNode(BaseNode):
10 class Ports(BaseNode.Ports):
11 success = Port.on_if(Inputs.threshold.greater_than(10))
12 fail = Port.on_else()
13
14class SuccessNode(BaseNode):
15 class Outputs(BaseNode.Outputs):
16 result = Inputs.threshold
17
18class FailNode(ErrorNode):
19 error = "Input threshold was too low"
20
21class BasicErrorNodeWorkflow(BaseWorkflow[Inputs, BaseState]):
22 graph = {
23 StartNode.Ports.success >> SuccessNode,
24 StartNode.Ports.fail >> FailNode,
25 }
26 class Outputs(BaseWorkflow.Outputs):
27 final_value = SuccessNode.Outputs.result
Was this page helpful?
Previous

Final Output Node

Next
Built with

vellum.workflows.nodes.ErrorNode

Used to raise an error to reject the surrounding Workflow and return custom error messages.

Attributes

error
Union[str, VellumError]Required

The error to raise. Can be either:

  • A string message
  • A VellumError object with a message and error code

Outputs

This node doesn’t produce outputs. However, Workflows that invoke this node will error and the error message will appear in the Vellum UI.