mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 22:34:56 +00:00
- Python: class extending NodeExecutor + factory.py (80+ plugins) - TypeScript: class implements NodeExecutor + factory.ts (7 groups, 116 classes) - Go: struct with methods + factory.go (36 plugins) - Rust: struct impl NodeExecutor trait + factory.rs (54 plugins) - Mojo: struct + factory.mojo (11 plugins) All package.json files now include: - files array listing source files - metadata.class/struct field - metadata.entrypoint field This enables a unified plugin loading system across all languages with no import side effects (Spring-style DI pattern). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Go Workflow Plugins
Go plugins for MetaBuilder workflow engine. Follows the same interface pattern as Python plugins.
Plugin Interface
// All plugins implement this signature
func Run(runtime *plugin.Runtime, inputs map[string]interface{}) (map[string]interface{}, error)
The runtime object provides:
Store- Workflow state storage (persists between nodes)Context- Shared context (clients, configuration)Logger- Logging interface
Categories
| Category | Plugins | Purpose |
|---|---|---|
| convert | to_string, to_number, to_boolean, to_json, parse_json | Type conversion |
| list | concat, length, slice, reverse | List operations |
| logic | and, or, not, equals, gt, lt | Boolean logic |
| math | add, subtract, multiply, divide | Arithmetic |
| string | concat, split, replace, upper, lower | String manipulation |
| var | get, set, delete | Variable management |
Example Usage
In Workflow JSON
{
"version": "2.2.0",
"nodes": [
{
"id": "add-numbers",
"type": "operation",
"op": "go.math.add",
"params": {
"numbers": [1, 2, 3, 4, 5]
}
},
{
"id": "format-result",
"type": "operation",
"op": "go.string.concat",
"params": {
"strings": ["Sum: ", "{{ $nodes['add-numbers'].result }}"],
"separator": ""
}
}
],
"connections": [
{ "from": "add-numbers", "to": "format-result" }
]
}
Performance
Go plugins are compiled to native code, offering:
- 10-100x faster than Python for CPU-bound operations
- Low memory footprint for concurrent execution
- No GIL - true parallelism
Best for:
- High-throughput data processing
- Concurrent operations
- Memory-efficient batch operations