Displayable Nodes
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
Either the UUID or name of the Vellum Document Index that you’d like to search against
The query to search for
Runtime configuration for the search
The separator to use when joining the text of each search result
Outputs
The concatenated text output from the search
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
The inputs for the Prompt
The blocks that make up the Prompt
The model to use for execution (e.g., “gpt-4o”, “claude-3.5-sonnet”)
The functions to include in the prompt
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:
Expandable execution fields to include in the response. See more here.
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
The generated text output from the prompt execution
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
The Subworkflow class to execute
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
Either the Prompt Deployment’s UUID or its name
The inputs for the Prompt
The release tag to use for the Prompt Execution
Optionally include a unique identifier for tracking purposes. Must be unique within a given Prompt Deployment.
Expandable execution fields to include in the response. See more here.
The raw overrides to use for the Prompt Execution
Expandable raw fields to include in the response
The metadata to use for the Prompt Execution
The request options to use for the Prompt Execution
Outputs
The generated text output from the prompt execution
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
Either the Workflow Deployment’s UUID or its name
The inputs for the Subworkflow. Supports:
- Strings
- Numbers (float)
- Chat History (List[ChatMessage])
- JSON objects (Dict[str, Any])
The release tag to use for the Workflow Execution
The external ID to use for the Workflow Execution
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.
The metadata to use for the Workflow Execution
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
The URL to send the request to.
The HTTP method to use for the request.
The headers to send in the request.
The data to send in the request body.
The JSON data to send in the request body.
The type of authorization to use for the API call.
The header key to use for the API key authorization.
The bearer token value to use for the bearer token authorization.
Outputs
The HTTP status code of the response
The response headers
The raw text response body
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
Path to the Python script file to execute
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
The runtime to use for the custom script
The packages to use for the custom script
The request options to use for the custom script
Outputs
The result returned by the executed code, type depends on the node’s generic type parameter
The execution logs from the code run
Templating Node
vellum.workflows.nodes.TemplatingNode
Used to render text templates using Jinja2 syntax
Attributes
The Jinja2 template to render
The values to substitute into the template for the specified variables.
Outputs
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
Either the Metric Definition’s UUID or its name
The inputs for the Metric
The release tag to use for the Metric
The request options to use for the Metric execution
Outputs
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
The list of items to map over. Each item will be processed by the subworkflow.
The Subworkflow class to execute for each item
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.
BaseNode.Trigger
directly instead of using MergeNode. Read more on TriggersAttributes
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
The error to raise. Can be either:
- A string message
- A VellumError object with a
message
and errorcode
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
The value to be output. The type is inferred by the type of the node connected to this attribute.
Outputs
The output value, with the same type as the input value