Displayable nodes are nodes that can be displayed and edited in the Vellum UI. They support complete push and pull operations allowing you to edit the node’s configuration in either the Vellum UI or as code and have those changes reflected in the other.

Search Node

vellum.workflows.nodes.SearchNode

Used to perform a hybrid search against a Document Index in Vellum.

Attributes

document_index
Union[UUID, str]Required

Either the UUID or name of the Vellum Document Index that you’d like to search against

query
strRequired

The query to search for

options
SearchRequestOptionsRequest

Runtime configuration for the search

chunk_separator
str

The separator to use when joining the text of each search result

Outputs

text
str

The concatenated text output from the search

results
List[SearchResult]

The raw results from the search

Inline Prompt Node

vellum.workflows.nodes.InlinePromptNode

Used to execute a prompt directly within a workflow, without requiring a prompt deployment.

Attributes

prompt_inputs
EntityInputsInterfaceRequired

The inputs for the Prompt

blocks
List[PromptBlock]Required

The blocks that make up the Prompt

ml_model
strRequired

The model to use for execution (e.g., “gpt-4o”, “claude-3.5-sonnet”)

functions
Optional[List[FunctionDefinition]]

The functions to include in the prompt

parameters
Optional[PromptParameters]

Model parameters for execution. Defaults to:

  • temperature: 0.0
  • max_tokens: 1000
  • top_p: 1.0
  • top_k: 0
  • frequency_penalty: 0.0
  • presence_penalty: 0.0
  • logitBias:
  • customParameters:
expand_meta
Optional[PromptDeploymentExpandMetaRequest]

Expandable execution fields to include in the response. See more here.

request_options
RequestOptions

Additional options for request-specific configuration when calling APIs via the SDK. This is used primarily as an optional final parameter for service functions.

  • timeout_in_seconds: The number of seconds to await an API call before timing out
  • max_retries: The max number of retries to attempt if the API call fails
  • additional_headers: A dictionary containing additional parameters to spread into the request’s header dict
  • additional_query_parameters: A dictionary containing additional parameters to spread into the request’s query parameters dict
  • additional_body_parameters: A dictionary containing additional parameters to spread into the request’s body parameters dict

Outputs

text
str

The generated text output from the prompt execution

results
List[PromptOutput]

The array of results from the prompt execution. PromptOutput is a union of the following types:

  • StringVellumValue
  • JsonVellumValue
  • ErrorVellumValue
  • FunctionCallVellumValue

Inline Subworkflow Node

vellum.workflows.nodes.InlineSubworkflowNode

Used to execute a Subworkflow defined inline within your workflow. This allows you to modularize and reuse workflow logic.

Attributes

subworkflow
Type[BaseWorkflow[WorkflowInputsType, InnerStateType]]Required

The Subworkflow class to execute

subworkflow_inputs
Dict[str, Any]Required

The inputs to pass to the subworkflow

Outputs

The outputs of this node are determined by the outputs defined in the subworkflow. Each output from the subworkflow will be streamed through this node.

Prompt Deployment Node

vellum.workflows.nodes.PromptDeploymentNode

Used to execute a Prompt Deployment and surface a string output for convenience.

Attributes

deployment
Union[UUID, str]Required

Either the Prompt Deployment’s UUID or its name

prompt_inputs
EntityInputsInterfaceRequired

The inputs for the Prompt

release_tag
strDefaults to LATEST

The release tag to use for the Prompt Execution

external_id
Optional[str]

Optionally include a unique identifier for tracking purposes. Must be unique within a given Prompt Deployment.

expand_meta
Optional[PromptDeploymentExpandMetaRequest]

Expandable execution fields to include in the response. See more here.

raw_overrides
Optional[RawPromptExecutionOverridesRequest]

The raw overrides to use for the Prompt Execution

expand_raw
Optional[Sequence[str]]

Expandable raw fields to include in the response

metadata
Optional[Dict[str, Optional[Any]]]

The metadata to use for the Prompt Execution

request_options
Optional[RequestOptions]

The request options to use for the Prompt Execution

Outputs

text
str

The generated text output from the prompt execution

results
List[PromptOutput]

The array of results from the prompt execution. PromptOutput is a union of the following types:

  • StringVellumValue
  • FunctionCallVellumValue

Subworkflow Deployment Node

vellum.workflows.nodes.SubworkflowDeploymentNode

Used to execute a deployed Workflow as a subworkflow within another workflow. This allows you to compose workflows from other deployed workflows.

Attributes

deployment
Union[UUID, str]Required

Either the Workflow Deployment’s UUID or its name

subworkflow_inputs
Dict[str, Any]Required

The inputs for the Subworkflow. Supports:

  • Strings
  • Numbers (float)
  • Chat History (List[ChatMessage])
  • JSON objects (Dict[str, Any])
release_tag
strDefaults to LATEST

The release tag to use for the Workflow Execution

external_id
Optional[str]

The external ID to use for the Workflow Execution

expand_meta
Optional[WorkflowExpandMetaRequest]

An optionally specified configuration used to opt in to including additional metadata about this workflow execution in the API response. Corresponding values will be returned under the execution_meta key within NODE events in the response stream. See Execute Workflow: Expand Meta.

metadata
Optional[Dict[str, Optional[Any]]]

The metadata to use for the Workflow Execution

request_options
Optional[RequestOptions]

The request options to use for the Workflow Execution

Outputs

The outputs of this node are determined by the outputs defined in the deployed workflow. Each output from the workflow will be streamed through this node.

API Node

vellum.workflows.nodes.APINode

Used to make HTTP requests to external APIs.

Attributes

url
strRequired

The URL to send the request to.

method
APIRequestMethodRequired

The HTTP method to use for the request.

headers
Optional[Dict[str, Union[str, VellumSecret]]]

The headers to send in the request.

data
Optional[str]

The data to send in the request body.

json
Optional[JsonObject]

The JSON data to send in the request body.

authorization_type
Optional[AuthorizationType]

The type of authorization to use for the API call.

api_key_header_key
Optional[str]

The header key to use for the API key authorization.

bearer_token_value
Optional[str]

The bearer token value to use for the bearer token authorization.

Outputs

status_code
int

The HTTP status code of the response

headers
Dict[str, str]

The response headers

text
str

The raw text response body

json
Optional[Dict[str, Any]]

The parsed JSON response body (if the response is JSON)

Code Execution Node

vellum.workflows.nodes.CodeExecutionNode

Used to execute arbitrary Python code within your workflow. Supports custom package dependencies and any Python or TypeScript runtimes.

Attributes

filepath
strRequired

Path to the Python script file to execute

code_inputs
EntityInputsInterfaceRequired

The inputs for the custom script. Supports:

  • Strings
  • Numbers (float)
  • Arrays
  • Chat History (List[ChatMessage])
  • Search Results (List[SearchResult])
  • JSON objects (Dict[str, Any])
  • Function Calls
  • Errors
  • Secrets
runtime
CodeExecutionRuntimeDefaults to PYTHON_3_12

The runtime to use for the custom script

packages
Optional[Sequence[CodeExecutionPackage]]

The packages to use for the custom script

request_options
Optional[RequestOptions]

The request options to use for the custom script

Outputs

result
_OutputType

The result returned by the executed code, type depends on the node’s generic type parameter

log
str

The execution logs from the code run

Templating Node

vellum.workflows.nodes.TemplatingNode

Used to render text templates using Jinja2 syntax

Attributes

template
strRequired

The Jinja2 template to render

inputs
EntityInputsInterfaceRequired

The values to substitute into the template for the specified variables.

Outputs

result
_OutputType

The rendered template in the appropriate type as specified by the type specified in the Templating Node subclass definition.

Guardrail Node

vellum.workflows.nodes.GuardrailNode

Used to execute a Metric Definition and surface a float output representing the score. This node is commonly used to implement quality checks and guardrails in your workflows.

Metrics are defined in the Vellum UI and can be reused across workflows.

Attributes

metric_definition
Union[UUID, str]Required

Either the Metric Definition’s UUID or its name

metric_inputs
EntityInputsInterfaceRequired

The inputs for the Metric

release_tag
strDefaults to LATEST

The release tag to use for the Metric

request_options
Optional[RequestOptions]

The request options to use for the Metric execution

Outputs

score
float

The score output from the metric execution (between 0 and 1)

Additional outputs may be available depending on the metric definition.

Map Node

vellum.workflows.nodes.MapNode

Used to map over a list of items and execute a Subworkflow for each item. This enables parallel processing of multiple items through the same workflow logic.

Attributes

items
List[Any]Required

The list of items to map over. Each item will be processed by the subworkflow.

subworkflow
Type[BaseWorkflow[WorkflowInputsType, InnerStateType]]Required

The Subworkflow class to execute for each item

concurrency
Optional[int]Defaults to None

The maximum number of concurrent subworkflow executions.

Outputs

The outputs are determined by the subworkflow’s outputs, with each output field becoming a list containing results from all iterations.

Conditional Node

vellum.workflows.nodes.ConditionalNode

Used to conditionally determine which port to invoke next. This node exists to be backwards compatible with Vellum’s Conditional Node, and for most cases, you should extend BaseNode.Ports directly.

Read more on ports here.

Merge Node

vellum.workflows.nodes.MergeNode

Used to merge the control flow of multiple nodes into a single node. This node exists primarily for backwards compatibility with Vellum’s Merge Node functionality.

For most cases, you should extend from BaseNode.Trigger directly instead of using MergeNode. Read more on Triggers

Attributes

This node doesn’t have any specific attributes as it’s a simple control flow node.

Outputs

This node passes through any outputs from its parent nodes without modification.

Error Node

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.

Final Output Node

vellum.workflows.nodes.FinalOutputNode

Used to directly reference the output of another node. This provides backward compatibility with Vellum’s Final Output Node functionality. In most cases, you should reference the Workflow Output directly to the output of a particular node, without adding a Final Output Node.

Attributes

value
_OutputTypeRequired

The value to be output. The type is inferred by the type of the node connected to this attribute.

Outputs

value
_OutputType

The output value, with the same type as the input value