
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
dag-workflow-engine
Advanced tools
A production-grade, DAG-based API orchestration engine for Node.js.
fail-fast or continue execution on failures{{nodeId.path}} syntaxnpm install api-chainer
import { ApiChainer } from 'api-chainer';
const chainer = new ApiChainer({
concurrency: 5,
errorMode: 'fail-fast',
});
const result = await chainer.run({
tasks: [
// First task: fetch user data
{
id: 'getUser',
type: 'http',
request: {
method: 'GET',
url: 'https://api.example.com/users/123',
},
},
// Second task: fetch user's posts (depends on first task)
{
id: 'getPosts',
type: 'http',
dependsOn: ['getUser'],
request: {
method: 'GET',
url: 'https://api.example.com/users/{{getUser.data.id}}/posts',
},
},
// Third task: process results with a function
{
id: 'processData',
type: 'function',
dependsOn: ['getUser', 'getPosts'],
handler: async (inputs, results) => {
return {
user: results.getUser.data,
postCount: results.getPosts.data.length,
};
},
},
],
});
console.log(result.success); // true or false
console.log(result.results); // { getUser: {...}, getPosts: {...}, processData: {...} }
{
id: 'fetchData',
type: 'http',
request: {
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE',
url: 'https://api.example.com/data',
headers: { 'Authorization': 'Bearer {{inputs.token}}' },
params: { page: 1 },
body: { name: '{{inputs.name}}' },
responseType: 'json' | 'text' | 'blob',
},
policies: {
timeout: 5000,
retry: { attempts: 3, backoff: 'exponential', delayMs: 100 },
},
}
{
id: 'transform',
type: 'function',
dependsOn: ['fetchData'],
handler: async (inputs, results) => {
// inputs = original workflow input
// results = { fetchData: { status, data, ... } }
return transformedData;
},
}
Use {{path}} syntax to reference values:
{{inputs.propertyName}} - Access workflow input{{nodeId.data.path}} - Access result from completed node{
url: 'https://api.example.com/users/{{getUser.data.id}}',
headers: { 'Authorization': 'Bearer {{inputs.token}}' },
body: { userId: '{{getUser.data.id}}', name: '{{inputs.name}}' },
}
const chainer = new ApiChainer({
// Max concurrent task executions
concurrency: 10,
// Error handling: 'fail-fast' stops on first error, 'continue' runs independent branches
errorMode: 'fail-fast',
// Default timeout for all tasks (ms)
defaultTimeout: 30000,
// HTTP executor defaults
http: {
baseUrl: 'https://api.example.com',
defaultHeaders: { 'X-API-Key': 'your-key' },
},
// Observability
observability: {
logger: customLogger,
metrics: customMetrics,
tracer: customTracer,
},
});
chainer.lifecycle.on('workflow:start', (event) => {
console.log(`Workflow started: ${event.traceId}`);
});
chainer.lifecycle.on('node:success', (event) => {
console.log(`Node ${event.nodeId} completed in ${event.durationMs}ms`);
});
chainer.lifecycle.on('node:failure', (event) => {
console.error(`Node ${event.nodeId} failed:`, event.error);
});
chainer.lifecycle.on('workflow:end', (event) => {
console.log(`Workflow completed: success=${event.success}, duration=${event.durationMs}ms`);
});
import { Executor, DagNode, ContextSnapshot } from 'api-chainer';
class DatabaseExecutor implements Executor {
async execute(node: DagNode, context: ContextSnapshot, signal: AbortSignal) {
const config = node.config as { query: string };
// Execute database query...
return { rows: [...] };
}
}
chainer.registerExecutor('database', new DatabaseExecutor());
Stops workflow execution immediately when any task fails.
Continues executing independent branches even if some tasks fail. Dependent tasks are automatically skipped.
const result = await chainer.run(workflow);
if (!result.success) {
console.log('Failed nodes:', Object.keys(result.errors));
console.log('Skipped:', result.stats.skipped);
}
interface WorkflowResult {
success: boolean;
results: Record<string, unknown>;
errors?: Record<string, Error>;
durationMs: number;
traceId: string;
stats: {
total: number;
completed: number;
failed: number;
skipped: number;
};
}
MIT
FAQs
A production-grade DAG-based API orchestration engine for Node.js
The npm package dag-workflow-engine receives a total of 2 weekly downloads. As such, dag-workflow-engine popularity was classified as not popular.
We found that dag-workflow-engine demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.