Skip to content

JavaScript SDK

The official JavaScript/TypeScript SDK for Ironflow, organized as a monorepo of specialized packages published under the @ironflow organization on npm. All packages are public and install without authentication.

For building Ironflow and the SDKs from source, see the Local Development guide.

PackageUse CaseEnvironment
@ironflow/browserReal-time subscriptions, workflow triggers, event emissionBrowser
@ironflow/nodeWorkers, serve handlers, step executionNode.js
@ironflow/coreShared types, schemas, utilitiesBoth
@ironflow/langgraphLangGraph checkpoint saver — durable agent state backed by entity streamsNode.js

Use @ironflow/browser for:

  • Subscribing to real-time events
  • Triggering workflows from the frontend
  • Monitoring run status
  • Emitting events
Terminal window
npm install @ironflow/browser
import { ironflow } from '@ironflow/browser';
ironflow.configure({ serverUrl: 'https://ironflow.example.com' });
// Subscribe to events
const sub = await ironflow.subscribe('events:order.*', {
onEvent: (event) => console.log('Order:', event),
});
// Invoke a function
const run = await ironflow.invoke('process-order', {
data: { orderId: '123' },
});

Use @ironflow/node for:

  • Defining functions
  • Creating serverless handlers (push mode)
  • Running long-lived workers (pull mode)
  • Executing durable steps
Terminal window
npm install @ironflow/node

Push Mode (Serverless):

import { serve, ironflow } from '@ironflow/node';
const processOrder = ironflow.createFunction(
{ id: 'process-order', triggers: [{ event: 'order.placed' }] },
async ({ event, step }) => {
const result = await step.run('process', async () => {
return { processed: true };
});
return result;
}
);
// Next.js App Router
export const POST = serve({ functions: [processOrder] });

Pull Mode (Worker):

import { createWorker, ironflow } from '@ironflow/node';
const worker = createWorker({
serverUrl: 'http://localhost:9123',
functions: [processOrder],
maxConcurrentJobs: 10,
});
await worker.start();

@ironflow/core is automatically included as a dependency of both browser and node packages. You typically don’t need to install it directly, but you can import types and utilities from it:

import type { Run, IronflowEvent, FunctionConfig } from '@ironflow/core';
import { RunStatusSchema, isRetryable } from '@ironflow/core';

The SDK supports two execution modes:

ModeDescriptionBest For
PushIronflow sends HTTP requests to your endpointServerless (Vercel, Lambda), short tasks
PullYour worker connects via gRPC and pulls jobsLong-running tasks, no timeout limits

Both modes use the same function definition syntax. See Execution Modes for details.

  • Node.js 20+ for @ironflow/node
  • Modern browsers (Chrome 80+, Firefox 75+, Safari 13.1+, Edge 80+) for @ironflow/browser