Skip to main content
The mount API lets you embed FlowDrop into any HTML container, regardless of framework.

mountFlowDropApp()

Mounts the full FlowDrop application (sidebar, editor, config panel) into a container.

Options

The mode option controls canvas interaction: 'edit' (the default) allows editing; 'readonly' and 'locked' disable all canvas interaction.
When you omit instanceId, the first mount on the page becomes the default instance (id default); additional mounts get auto-generated ids (fd-1, fd-2, …). Every instance scopes its draft and panel storage keys by id (flowdrop:draft:<id>:…).Pass an explicit instanceId whenever you mount more than one editor with drafts enabled, so the keys stay stable across page loads.

Feature flags (FlowDropFeatures)

See Auto-Save & Drafts for practical examples. See Core Types for FlowDropEventHandlers and FlowDropFeatures.

Return value

instance is the state container — workflow, history, playground, interrupts, categories, and the rest. Call into it to drive the editor programmatically, e.g. app.instance.workflow.addNode(...) or app.instance.history.undo().
Call clearAllDrafts() on logout.Otherwise drafts persist across user sessions on shared devices. It clears the configured draft storage (localStorage unless changed via the draftStorage option).

mountWorkflowEditor()

Mounts just the editor canvas — no navbar, no sidebar. Useful for embedding a minimal editor.
Returns the same MountedFlowDropApp interface as mountFlowDropApp(). instanceId follows the same default-instance semantics as mountFlowDropApp() above.

mountPlayground()

Mounts the interactive playground for workflow testing.
instanceId follows the same default-instance semantics as mountFlowDropApp().
Live polling is page-global.Playground state (sessions, messages, interrupts) is isolated per instance, but only one playground can actively poll at a time. Drive a non-polling playground via pushMessages() instead.

Playground return value

unmountFlowDropApp() / unmountPlayground()

Clean up a mounted instance. Equivalent to calling .destroy() on the returned object.

Lifecycle

  1. Mount — Call mountFlowDropApp() with a container element
  2. Interact — Use the returned API to control the editor programmatically
  3. Destroy — Call .destroy() or the unmount function to clean up
Registration of custom nodes and fields can happen before or after mounting. The node and field registries are instance-scoped — resolve them via getInstance() inside the component tree, or the mount handle’s .instance outside it.
Each registry tracks a version counter that invalidates dependent reactive reads. When you register a node or field after mount, that counter bumps and the editor re-resolves, so late registrations take effect.