Skip to content

Workflows

Workflow Guide

Ironflow builds Continuous History systems — record every event, durably execute workflows, derive projections, and time-travel through execution history. Workflows survive crashes, retries, and restarts automatically, and every step is permanently recorded.

Key Concepts

ConceptDescription
FunctionA workflow definition that responds to events. Contains one or more steps.
StepA recorded fact within a function. Steps are memoized—if a workflow restarts, completed steps aren’t re-executed.
EventA permanent recorded fact that triggers a workflow (e.g., order.placed, user.signup).
RunA single execution of a function, triggered by an event.

How it works:

  1. You define functions with steps using the SDK
  2. Register functions with the Ironflow server (push or pull mode)
  3. Trigger events from your application
  4. Ironflow executes functions, recording each step result as a permanent fact — enabling replay, debugging, and history navigation

Real-time events: For subscribing to workflow events in real-time, see the Events & Pub/Sub guide.

Durable Workflow Execution — showing memoized steps, failure recovery, and parallel branches


Installation

The @ironflow/* npm packages are public and install without authentication. For building from source, see the Local Development guide.

Terminal window
npm install @ironflow/node
# or
pnpm add @ironflow/node

Local Development

Terminal window
# Start Ironflow server
./build/ironflow serve
# Dashboard: http://localhost:9123
# API: http://localhost:9123/api/v1

Register your function endpoint in the dashboard or via API, then trigger events to test.


Quick Start

Here’s a minimal workflow to get started:

import { ironflow } from "@ironflow/node";
export const helloWorld = ironflow.createFunction(
{
id: "hello-world",
triggers: [{ event: "hello.triggered" }],
},
async ({ event, step }) => {
const message = await step.run("create-message", async () => {
return `Hello, ${event.data.name}!`;
});
return { message };
},
);

Triggering Workflows

Workflows run when a matching event is sent. You can trigger events from your application code, the CLI, or the REST API.

import { createClient } from "@ironflow/node";
const client = createClient({ serverUrl: "http://localhost:9123" });
// Fire-and-forget
await client.emit("hello.triggered", { name: "Alice" });
// Wait for the run to complete
const result = await client.emitSync("hello.triggered", { name: "Alice" });

You can also invoke a function directly by ID, bypassing event matching — see the REST API reference for POST /functions/{id}/invoke.

The underlying gRPC IronflowService exposes the event-ingestion RPCs SDKs and tooling use directly: Trigger and Emit (fire-and-forget event publish), TriggerSync (publish and wait for matched runs to complete), TriggerBatch (atomic batch publish), and PatchStep (scoped injection — overwrite a completed step’s output and resume). See api/proto/ironflow/v1/ironflow.proto for the full service definition.

For more details on event types, namespaces, and pattern matching, see the Events guide. SDK-specific options (idempotency keys, metadata, timeouts) are covered in the Node.js SDK, Browser SDK, and Go SDK references.


What’s Next?