Quickstart

Get a working Wayflow editor — mounted and running a workflow — in a few minutes.

By the end of this page you’ll have the full editor in your app — mounted, and running a workflow right in the browser — in about five minutes. No backend, no API key.

Install

Add the package. It has zero runtime dependencies, and the styles inject themselves — there’s no CSS file to import.

$ npm install wayflow

Mount the editor

Point createWorkflowEditor at a container, and that one call brings the whole thing: the canvas, the node palette, the config panel, and the run controls. The editor fills its container, so give that container a height — an empty <div> has none of its own.

index.html html
<div id="editor" style="height: 600px"></div>
editor.ts ts
import { createWorkflowEditor } from 'wayflow'

const editor = createWorkflowEditor(document.getElementById('editor'))

That’s the editor on screen. The height is the one thing it needs from you — the width comes from the page automatically. Editor setup covers sizing, theming, and the rest.

The Wayflow editor mounted in a page, showing an empty canvas with the node palette and run controls.
The full editor from that one call — canvas, node palette, config panel, and run controls.

Run a workflow

To execute a graph, hand the editor a runtime to call when someone presses Run. The mock provider runs everything in the browser — no key, no backend — so you can try it instantly and swap in a real model later.

editor.ts ts
import { createWorkflowEditor } from 'wayflow'
import { createLLMHandler, createMockProvider } from 'wayflow/models'
import { createRuntime } from 'wayflow/runtime'
import { runInBrowser } from 'wayflow/runtime/client'

const runtime = createRuntime({
  handlers: {
    llm: createLLMHandler(createMockProvider()),
  },
})

const editor = createWorkflowEditor(document.getElementById('editor'), {
  llm: { models: ['gpt-5.4-mini'] },
  onRun: ({ inputs, signal }) =>
    runInBrowser({ runtime, editor, inputs, signal }),
})

Now drag an Input, an LLM, and an Output from the palette, connect them, and press Run — the result streams into each node as it executes.

Building the graph from the palette and running it — results stream into each node.

Going to production?

Swap createMockProvider() for a real one (any OpenAI-compatible client) and run on your server instead of the browser. See Running workflows.

Next steps