@f8synapse/nodes-core
v0.1.1
Published
Built-in workflow node library — HTTP, logic, data transform, code execution, and integration nodes.
Readme
@f8synapse/nodes-core
Built-in workflow node library — HTTP, logic, data transform, code execution, and integration nodes.
Installation
npm install @f8synapse/nodes-core
# or
pnpm add @f8synapse/nodes-coreUsage
import { createWorkflowEngine, NodeRegistry } from '@f8synapse/engine';
import { createConfiguredNodeRegistry } from '@f8synapse/nodes-core';
// Get a registry pre-loaded with all core nodes
const registry = createConfiguredNodeRegistry();
const engine = createWorkflowEngine({ nodeRegistry: registry });
const execution = await engine.executeWorkflow({
id: 'wf-001',
name: 'HTTP + Transform',
nodes: [
{ id: 'n1', type: 'http_request', config: { url: 'https://api.example.com/users' } },
{ id: 'n2', type: 'data_transform', config: { expression: 'data.users.map(u => u.name)' } },
{ id: 'n3', type: 'end', config: {} },
],
edges: [
{ from: 'n1', to: 'n2' },
{ from: 'n2', to: 'n3' },
],
});API
Functions
| Export | Description |
| ------------------------------ | ------------------------------------------------------------ |
| createConfiguredNodeRegistry | Creates a NodeRegistry pre-loaded with all core node types |
Node Classes (selective imports)
| Node Class | Type Key | Description |
| -------------------- | ----------------- | ----------------------------------------------------------------- |
| HttpRequestNode | http_request | Makes HTTP/HTTPS requests with configurable method, headers, body |
| DataTransformNode | data_transform | Transforms data using JavaScript expressions |
| ConditionalNode | conditional | Branches execution based on boolean conditions |
| LoopNode | loop | Iterates over arrays or until condition met |
| SwitchNode | switch | Routes to one of N branches based on a value |
| ParallelNode | parallel | Executes multiple branches concurrently |
| TextProcessNode | text_process | String manipulation (trim, split, join, replace) |
| TemplateRenderNode | template_render | Renders Handlebars/Mustache templates |
| WaitNode | wait | Pauses execution for a specified duration |
| AssertNode | assert | Asserts a condition, failing the workflow if false |
| SetNode | set | Sets variables in the execution context |
| LogNode | log | Emits a log message during execution |
| EndNode | end | Terminates workflow execution |
| CodeNode | code | Executes arbitrary JavaScript in an isolated VM |
| SubworkflowNode | subworkflow | Invokes another workflow as a child execution |
| QueuePublishNode | queue_publish | Publishes a message to a queue (Redis/etc.) |
| QueueConsumeNode | queue_consume | Consumes a message from a queue |
License
MIT
