Skip to content

End Node

What is an End Node?

The End Node is the final node in a workflow, used to return the results after workflow execution. Each workflow requires at least one end node, but can have multiple end nodes corresponding to different ending paths.

Image Description:

The end node interface mainly contains the "Output" configuration area, where you can define parameters that need to be returned when the workflow ends. The interface supports adding multiple output parameters, each requiring parameter name, display name, and parameter value settings. Parameter values can be expressions or fixed values, supporting references to data generated by other nodes in the workflow. End Node

Why Do We Need an End Node?

When building workflows, the end node solves the following key problems:

  1. Clarify Workflow Endpoint: The end node clearly marks the termination point of workflow execution, making the entire process logic clearer.
  2. Define Output Results: The end node can configure output parameters to determine which result data the workflow ultimately presents externally.
  3. Standardize Data Return: The end node formats and organizes output data to ensure consistency and usability of returned results.
  4. Support Complex Flows: In complex workflows with multiple possible endpoints, different end nodes can return different result data.

Application Scenarios

1. Intelligent Q&A Flow

In Q&A-type AI assistants, the end node can output the final processed answer content, along with possible related recommendations or reference materials.

2. Data Processing Workflow

In data analysis or processing flows, the end node returns processed data results, such as statistical reports, analysis conclusions, etc.

3. Subprocess Calls

When called as a subprocess by the main workflow, the end node defines the data that the subprocess needs to return to the main workflow, similar to function return values.

Node Parameter Description

Output Parameters

The core configuration of the end node is output parameters, where you can define the data that needs to be returned when the workflow ends:

Configuration ItemDescriptionRequired
Parameter NameIdentifier for output parameter, used to reference this parameter in the systemYes
Display NameFriendly display name for the parameter, used for interface displayYes
Parameter TypeSupports setting different parameter types, such as: string, array, etc.Yes
Parameter ValueActual value of the parameter, can be fixed value, expression, or variable referenceYes

Usage Instructions

Basic Configuration Steps

  1. Add End Node:
    1. Drag "End Node" from the node panel to the canvas
    2. Connect the output of the previous node to the end node
  2. Configure Output Parameters:
    1. Click "Add Parameter" button to add parameters that need to be output
    2. Set parameter name (e.g., "result") and display name (e.g., "Processing Result")
    3. Select parameter value type (expression or fixed value)
    4. If choosing expression, use ${variable_name} to reference variables in the workflow
  3. Save Configuration:
    1. Confirm all necessary output parameters have been configured
    2. Save node configuration to complete end node setup

Advanced Techniques

Multi-parameter Organization

When needing to return multiple related parameters, you can use the following organization methods:

  1. Related Parameter Grouping: Organize parameters by function or data type to make structure clearer
  2. Use Nested Structure: Use JSON format to organize complex data, such as {"data": ${result}, "meta": ${metadata}}
  3. Parameter Naming Convention: Use unified naming rules, such as result_main, result_details, etc.

Dynamic Output Processing

Return different results based on different process paths:

  1. Conditional Judgment Preprocessing: Use condition branch node before end node to connect to different end nodes based on different conditions
  2. Variable Packaging: Use code execution node to pre-package multiple possible results into a variable, then reference in end node

Notes

Parameter Naming Convention

  1. Avoid Special Characters: Parameter names should use letters, numbers, and underscores, avoid spaces and special characters
  2. Semantic Naming: Parameter names should reflect their content and purpose, such as search_result rather than simple data
  3. Maintain Consistency: Multiple end nodes in the same workflow should follow unified naming conventions

Data Type Handling

  1. Type Consistency: Ensure output parameter data types meet caller's expectations
  2. Format Conversion: Use code execution node for data format conversion when necessary
  3. Null Value Handling: Consider cases where parameters may be null, provide reasonable default values

Multi-end Node Management

  1. Clear Identification: Add clear labels or comments to different end nodes
  2. Path Planning: Ensure each possible execution path has a corresponding end node
  3. Result Consistency: Even for different end nodes, maintain consistency in key parameter structure

Common Issues

Why aren't my set output parameters showing in the results?

  1. Check Parameter Names: Confirm parameter names are spelled correctly
  2. Check Expressions: If using expressions, confirm syntax is correct and referenced variables exist
  3. Check Process Execution: Confirm workflow actually executed to this end node
  4. Check Variable Scope: Confirm referenced variables are accessible within end node's scope

How to return complex data structures?

  1. Use JSON Format: Use JSON format in expressions to organize complex data, such as {"items": ${list}, "count": ${count}}
  2. Preprocess Data: Use code execution node before end node to build complex data structures
  3. Structured Naming: Use hierarchical parameter naming, such as result_header, result_body, result_footer

How to ensure each path in a workflow with multiple paths has appropriate ending?

  1. Path Analysis: Sort out all possible execution paths in the workflow
  2. Corresponding End Nodes: Set independent end nodes for each main path
  3. Unified Return Structure: Maintain consistent core parameter structure across all end nodes
  4. Status Identification: Include status identifiers (such as status, code) in output to facilitate identifying results from different paths

Common Node Combinations

Node TypeCombination Reason
Condition Branch NodeConnect to different end nodes based on different conditions, return different results
Code Execution NodeOrganize and format final output data before ending
Large Model Call NodeGenerate structured answer content, then return through end node
Message Reply NodeSend message to user before ending, end node then records operation result

Released under the Apache 2.0 License