Skip to main content

SDK

Our hosted run API is this SDK running on ZeroWidth's infrastructure — nothing more. So @zerowidth/workbench-sdk is a way to extract your flows and run them yourself, identically to our API: the same engine, the same execution, the same results. Your flows aren't locked to ZeroWidth.

npm install @zerowidth/workbench-sdk
import Workbench from "@zerowidth/workbench-sdk"

The package is on npm as @zerowidth/workbench-sdk (Apache-2.0). Design on Workbench, export the flow, and execute it inside your own Node.js process — byte-for-byte the same behavior you'd get from a POST /1.0/flows/.../runs.

When to reach for it

  • No lock-in. Your flows are portable. The day you want off our infrastructure — or just want a fallback — you already have the exact engine that runs them.
  • Your data shouldn't leave your network. Run the flow next to the data instead of sending it to a hosted endpoint.
  • Full control of the runtime — your own keys, your own model providers, your own logging and retries around each run.
  • Offline or air-gapped execution where calling a hosted API isn't an option.

If none of those apply, the hosted run API is the same engine with nothing to export or host — start there.

How it fits together

  1. Design on Workbench

    Build and test the flow on the canvas as usual. The behavior is the contract — the same flow runs identically under the SDK.

  2. Export the flow

    Export the flow's definition from Workbench. The export is the portable artifact the SDK ingests.

  3. Execute in your process

    Install the package, hand it the exported flow, and run it with your inputs. Event handlers give you per-node progress, timing, and cost — the same trace you see in the dev drawer.

The package's own README is the full API reference — installation, the Workbench instance, the input/output system, event handlers, error handling, and examples. Start there once you've installed it.

2 min read