Workflows

A workflow engine you embed, extend and hand to an agent.

Draw the steps once and they run the same way every time. A model decides only inside its own node. Build flows in the visual editor, as JSON, or let an agent build them from the chat.

Node types and configs follow the kit's schemas; names are illustrative.

Every step is a node kind.

src/run.ts

import { coreNodeKinds, createWorkflowRuntime } from '@pilotoo/workflow';

const runtime = createWorkflowRuntime({
  kinds: coreNodeKinds,
  checkpointer,
  ports: { fetch },
  onEvent: (event) => console.log(event.type),
});

const outcome = await runtime.start({
  workflow,
  runId: 'run-1',
  threadId: 'thread-1',
  input: { userId: 7 },
});

Your own nodes, next to the built-in ones.

Register a kind on the server and it appears in the builder palette, validated like the rest.

Writing a node kind
export const slugify = defineNodeKind({
  type: 'slugify',
  category: 'transform',
  label: 'Slugify',
  config: z.object({ text: z.string() }),
  ports: { inputs: ['in'], outputs: ['out'] },
  execute: (_context, config) => ({
    output: config.text.toLowerCase().replace(/[^a-z0-9]+/g, '-'),
  }),
});

Wire it to the other blocks.

Turn on a block to see what a workflow gets from it.

WebDesktopMobileYour systems · HTTPAny MCP client

Draw your first workflow.