Input Templating System
ℹ️ Note: Workflow nodes generate output fields at runtime. The templating system manages these dynamic values and their relationships between nodes.
Block Definition Model
Block Structure
interface Block {
// Input field definitions
inputs: {
[key: string]: {
type: string;
required: boolean;
description: string;
};
};
// Output field definitions
outputs: {
[key: string]: {
type: string;
description: string;
};
};
}Frontend Implementation
Workflow Hierarchy
The system uses a graph-based structure to manage node relationships:
Field Discovery
Performs BFS (Breadth-First Search) on ascendant nodes
Collects available output fields
Maps fields to their source nodes
Template Generation
Creates template strings for each field
Format:
{{node_id-value}}Example:
{{node-123-output_field}}
Backend Processing
Kafka Workflow Task
Template Resolution Process
Value Collection
Template Replacement
Implementation Example
Sample Workflow
⚠️ Warning: Remember to handle cases where template values might not be available yet, as nodes execute asynchronously.
Best Practices
Tips for Template Usage
Unique Node IDs
Ensure node IDs are unique across the workflow
Use descriptive IDs for better debugging
Error Handling
Validate template syntax before execution
Handle missing or undefined values gracefully
Performance
Cache template resolution results when possible
Minimize template string parsing operations
Last updated


