Expand description
WebAssembly bindings for dataflow-rs workflow engine.
This crate provides WASM bindings that allow using dataflow-rs from JavaScript/TypeScript.
§Usage
import init, { WasmEngine } from 'dataflow-wasm';
await init();
// Define workflows
const workflows = JSON.stringify([{
id: "example",
name: "Example Workflow",
priority: 1,
tasks: [{
id: "task1",
name: "Transform Data",
function: {
name: "map",
input: {
mappings: [{
path: "data.result",
logic: { "var": "payload.input" }
}]
}
}
}]
}]);
// Create engine
const engine = new WasmEngine(workflows);
// Process a payload directly
const payload = JSON.stringify({ input: "hello" });
const result = await engine.process(payload);
console.log(JSON.parse(result));Structs§
- Wasm
Engine - A WebAssembly-compatible workflow engine.
Functions§
- create_
message - Create a message JSON string from data and metadata.
- init
- Initialize the WASM module.
- process_
message - Process a payload through a one-off engine (convenience function).