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

Inline Subworkflow Node

1from vellum.workflows.nodes import InlineSubworkflowNode
2from vellum.workflows.inputs.base import BaseInputs
3from vellum.workflows.state import BaseState
4from vellum.workflows import BaseWorkflow
5
6class SubworkflowInputs(BaseInputs):
7 query: str
8 max_results: int
9
10class SubworkflowState(BaseState):
11 pass
12
13class MySubworkflow(BaseWorkflow[SubworkflowInputs, SubworkflowState]):
14 # Define your subworkflow logic here
15 pass
16
17class MyInlineSubworkflowNode(InlineSubworkflowNode):
18 subworkflow = MySubworkflow
19 subworkflow_inputs = {
20 "query": "search term",
21 "max_results": 10
22 }
1# Outputs depend on the subworkflow's defined outputs
2MyInlineSubworkflowNode.Outputs(
3 search_results=["Result 1", "Result 2", "Result 3"],
4 metadata={
5 "total_found": 100,
6 "processing_time": 0.5
7 }
8)
Was this page helpful?
Previous

Prompt Deployment Node

Next
Built with

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.