> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.vellum.ai/developers/workflows-sdk/api-reference/nodes/subworkflow-deployment-node/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.vellum.ai/_mcp/server. # Subworkflow Deployment Node > Execute deployed workflows as subworkflows within parent workflows. `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`** `str` — default: 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](/developers/client-sdk/workflows/execute-workflow#request.body.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. **`Example Usage`** ```python title="Example Usage" from vellum import ChatMessage, WorkflowExpandMetaRequest from vellum.workflows.nodes import SubworkflowDeploymentNode class MySubworkflowNode(SubworkflowDeploymentNode): deployment = "customer_support_workflow" # or UUID("...") subworkflow_inputs = { "user_query": "How do I reset my password?", "chat_history": [ ChatMessage(role="USER", text="Hi there"), ChatMessage(role="ASSISTANT", text="Hello! How can I help?") ], "user_metadata": { "user_id": "123", "account_type": "premium" }, "priority_score": 0.8 } release_tag = "production" external_id = "support-ticket-456" expand_meta = WorkflowExpandMetaRequest( include_inputs=True, include_outputs=True ) metadata = { "source": "mobile_app", "region": "us-west" } ``` **`Streaming Example`** ```python title="Streaming Example" # Outputs are streamed as they're generated by the workflow for output in node.run(): if output.is_streaming: print(f"Received partial output for {output.name}: {output.delta}") elif output.is_fulfilled: print(f"Received final output for {output.name}: {output.value}") ``` **`Error Handling Example`** ```python title="Error Handling Example" try: for output in node.run(): process_output(output) except NodeException as e: if e.code == VellumErrorCode.INVALID_INPUTS: print("Invalid input provided to workflow") elif e.code == VellumErrorCode.INTERNAL_ERROR: print("Internal workflow error occurred") else: raise ``` > Execute deployed workflows as subworkflows within parent workflows.