Skip to content

Commit 204c8ee

Browse files
docs: lead onboarding with the npm SDK install path (#37)
1 parent 6618d3f commit 204c8ee

7 files changed

Lines changed: 56 additions & 29 deletions

File tree

.changeset/wb-217-actions-hook.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
'@workflowbuilder/sdk': minor
33
---
44

5-
feat: add `useWorkflowBuilderActions()`. Gives custom layouts that omit `<WorkflowBuilder.TopBar />` imperative save / import / export / settings / read-only / theme / layout-direction actions. Also exports the `WorkflowBuilderActions`, `LayoutChangeOptions`, and `Theme` types. See [Custom layout without the app bar](https://www.workflowbuilder.io/docs/get-started/quick-start/wb-as-react-component/#custom-layout-without-the-app-bar).
5+
feat: add `useWorkflowBuilderActions()`. Gives custom layouts that omit `<WorkflowBuilder.TopBar />` imperative save / import / export / settings / read-only / theme / layout-direction actions. Also exports the `WorkflowBuilderActions`, `LayoutChangeOptions`, and `Theme` types. See [Custom toolbar without the app bar](https://www.workflowbuilder.io/docs/guides/configuring-the-editor/#custom-toolbar-without-the-app-bar).

CLAUDE.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ Visual workflow editor SDK (React) with a reference backend and Temporal-based e
44

55
## Quick Reference
66

7-
Three onboarding paths (A, B local-run; C docs-only). README "Get started" is the canonical guide for A and B. Path C ("Embed the SDK") lives in the [docs site](https://www.workflowbuilder.io/docs/get-started/quick-start/wb-as-react-component/) and has no local-stack commands.
7+
Three onboarding paths (A installs from npm; B, C run the repo locally). README "Get started" covers all three. Path A ("Embed the SDK") installs `@workflowbuilder/sdk` from npm; the README has install + a minimal snippet, and the full guide lives in the [docs site](https://www.workflowbuilder.io/docs/get-started/quick-start/wb-as-react-component/).
88

99
| Command | Path | What it does |
1010
| ---------------------------- | ---- | --------------------------------------------------------------------------- |
11-
| `pnpm preflight` | both | Verify Node / pnpm / Docker / ports / `.env` files. Add `--json` for agents |
12-
| `pnpm dev` / `pnpm dev:demo` | A | Demo (UI only, port 4200). No backend, no Docker |
13-
| `pnpm infra:up` | B | Start Postgres + Temporal in Docker. Required before backend/worker |
14-
| `pnpm -F backend db:migrate` | B | Apply Drizzle migrations. First run, or after schema changes |
15-
| `pnpm dev:ai-studio` | B | Full stack: infra + backend (3001) + worker + AI Studio frontend (4201) |
16-
| `pnpm dev:backend` | B | Backend only (debug). Needs infra up |
17-
| `pnpm dev:worker` | B | Execution worker only (debug). Needs infra up |
18-
| `pnpm infra:down` | B | Stop the Docker stack |
11+
| `pnpm preflight` | B/C | Verify Node / pnpm / Docker / ports / `.env` files. Add `--json` for agents |
12+
| `pnpm dev` / `pnpm dev:demo` | B | Demo (UI only, port 4200). No backend, no Docker |
13+
| `pnpm infra:up` | C | Start Postgres + Temporal in Docker. Required before backend/worker |
14+
| `pnpm -F backend db:migrate` | C | Apply Drizzle migrations. First run, or after schema changes |
15+
| `pnpm dev:ai-studio` | C | Full stack: infra + backend (3001) + worker + AI Studio frontend (4201) |
16+
| `pnpm dev:backend` | C | Backend only (debug). Needs infra up |
17+
| `pnpm dev:worker` | C | Execution worker only (debug). Needs infra up |
18+
| `pnpm infra:down` | C | Stop the Docker stack |
1919
| `pnpm dev:docs` | - | Docs site (Astro + Starlight) |
2020
| `pnpm build:lib` | - | Build the SDK package (`packages/sdk`) |
2121
| `pnpm build` | - | Build the demo app |
2222
| `pnpm test` | - | Run tests in `packages/sdk` and `packages/execution-core` |
2323
| `pnpm check` | - | Lint + typecheck + format + knip |
2424

25-
Path A is UI-only and does not need Docker. Path B requires `pnpm infra:up` before backend/worker can start, and `db:migrate` on the first run.
25+
Path B is UI-only and does not need Docker. Path C requires `pnpm infra:up` before backend/worker can start, and `db:migrate` on the first run.
2626

2727
### Agent signals
2828

@@ -123,7 +123,7 @@ If you're new to this repo and want to build your own consumer app or POC, follo
123123
| `/wb.create-plugin <name>` | Scaffold a new SDK plugin — asks for target app (default `demo`) |
124124
| `/wb.create-template <name>` | Scaffold a new diagram template — asks for target app (default `demo`) |
125125
| `/wb.add-execution-handler <type>` | Wire a node type into execution-core + worker registry (global pipeline, no target) |
126-
| `/wb.run-locally` | Bring up the stack — Path A (`pnpm dev:demo`) or Path B (infra + backend + worker + AI Studio frontend) |
126+
| `/wb.run-locally` | Bring up the stack — Path B (`pnpm dev:demo`) or Path C (infra + backend + worker + AI Studio frontend) |
127127
| `/wb.task` | Fetch assigned ClickUp tasks via MCP and recommend one to pick up |
128128
| `/wb.task WB-42` | Pick up a specific task with an inline plan |
129129
| `/wb.changeset <bump> "<summary>"` | Add a changeset for SDK changes (`patch` / `minor` / `major`) — required before merging consumer-visible changes to `packages/sdk/**` |

README.md

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<a href="https://www.workflowbuilder.io/"><img alt="Workflow Builder" src="https://cdn.synergycodes.com/workflow-builder-logo-solid.svg" width="201" height="40"></a>
44

5-
[Live Demo](https://app.workflowbuilder.io/) &nbsp;|&nbsp; [Documentation](https://www.workflowbuilder.io/docs/overview/) &nbsp;|&nbsp; [Website](https://www.workflowbuilder.io/)
5+
[Live Demo](https://app.workflowbuilder.io/) &nbsp;|&nbsp; [Documentation](https://www.workflowbuilder.io/docs/overview/) &nbsp;|&nbsp; [npm](https://www.npmjs.com/package/@workflowbuilder/sdk) &nbsp;|&nbsp; [Website](https://www.workflowbuilder.io/)
66

77
**Workflow Builder**
88

@@ -38,16 +38,47 @@ Three onboarding paths. Pick one based on what you want to evaluate.
3838

3939
| Goal | Path | Setup time | Docker |
4040
| ------------------------------------------------------ | ------------------------------------------------------------- | ---------- | ------ |
41-
| See the editor running in your browser | [A. Try the demo](#path-a-try-the-demo) | ~2 min | no |
42-
| Run the full reference stack (editor + execution + AI) | [B. Run the full stack demo](#path-b-run-the-full-stack-demo) | ~10 min | yes |
43-
| Use the SDK inside your own React app | [C. Embed the SDK](#path-c-embed-the-sdk) | see docs | no |
41+
| Use the SDK inside your own React app | [A. Embed the SDK](#path-a-embed-the-sdk) | ~1 min | no |
42+
| See the editor running in your browser | [B. Try the demo](#path-b-try-the-demo) | ~2 min | no |
43+
| Run the full reference stack (editor + execution + AI) | [C. Run the full stack demo](#path-c-run-the-full-stack-demo) | ~10 min | yes |
4444

45-
Want to skip the clone entirely? [Try the live demo](https://app.workflowbuilder.io) first.
45+
Don't want to install or clone anything yet? [Try the live demo](https://app.workflowbuilder.io) in your browser first.
46+
47+
### Path A. Embed the SDK
48+
49+
Use Workflow Builder inside your own React app. No clone, no Docker. Install the SDK and its peer dependencies from npm:
50+
51+
```bash
52+
npm install @workflowbuilder/sdk \
53+
react react-dom \
54+
@xyflow/react \
55+
@jsonforms/core @jsonforms/react \
56+
i18next react-i18next i18next-browser-languagedetector \
57+
immer zustand
58+
```
59+
60+
Render the editor:
61+
62+
```tsx
63+
import { WorkflowBuilder } from '@workflowbuilder/sdk';
64+
65+
import '@workflowbuilder/sdk/style.css';
66+
67+
export function App() {
68+
return <WorkflowBuilder.Root name="my-workflow" />;
69+
}
70+
```
71+
72+
It mounts the default layout (top bar, palette, canvas, properties panel) and persists to `localStorage` out of the box. The palette is empty until you pass `nodeTypes`.
73+
74+
Full guide (props, persistence strategies, theming, plugins, and the API reference): [React Component on the docs site](https://www.workflowbuilder.io/docs/get-started/quick-start/wb-as-react-component/).
75+
76+
The two paths below run this repository locally (demo and full stack). They share the requirements and preflight check that follow. Path A needs neither.
4677

4778
### Requirements
4879

4980
- Node `22.12.0` and pnpm `10.9.0`. Both pinned in `package.json`. Use `nvm`, `fnm`, or `corepack` to match.
50-
- Docker Desktop. Only required for Path B.
81+
- Docker Desktop. Only required for Path C.
5182

5283
Works the same on macOS, Linux, and Windows. No platform-specific steps.
5384

@@ -81,11 +112,11 @@ Workflow Builder preflight
81112
Ready to go. Pick a path in README.md "Get started".
82113
```
83114

84-
The two `.env` warnings are expected on a fresh clone. They are only required for Path B and get created by `pnpm setup:env` in step 1 of that path. After that they switch to `✅ present`.
115+
The two `.env` warnings are expected on a fresh clone. They are only required for Path C and get created by `pnpm setup:env` in step 1 of that path. After that they switch to `✅ present`.
85116

86117
Fix any red (``) items before continuing. The script also has a `--json` mode for tooling: `pnpm preflight --json`.
87118

88-
### Path A. Try the demo
119+
### Path B. Try the demo
89120

90121
UI only. No backend, no Docker. The fastest way to see the editor in action.
91122

@@ -104,7 +135,7 @@ Expected output:
104135

105136
Open `http://localhost:4200`. The editor loads with the default plugin set and a starter template. That's it.
106137

107-
### Path B. Run the full stack demo
138+
### Path C. Run the full stack demo
108139

109140
Full reference product: editor, Hono backend, Temporal worker, Postgres. The frontend on port 4201 is the **AI Studio** reference product (`apps/ai-studio`). Demonstrates end-to-end workflow execution.
110141

@@ -180,10 +211,6 @@ AI_MODEL=anthropic/claude-3.5-haiku
180211

181212
If the key is missing the worker fails to start with `OPENROUTER_API_KEY is required`. If the model id is wrong the first AI node fails at runtime and the error surfaces in the UI log panel.
182213

183-
### Path C. Embed the SDK
184-
185-
To build your own React app on top of `@workflowbuilder/sdk`, follow the [React Component guide on the docs site](https://www.workflowbuilder.io/docs/get-started/quick-start/wb-as-react-component/). It covers installation, peer deduplication (for local-path builds until npm publish), usage, persistence strategies, theming, and the full API reference.
186-
187214
### Troubleshooting
188215

189216
| Symptom | Cause | Fix |

apps/ai-studio/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Reference frontend for the Workflow Builder AI Studio product. Consumes `@workfl
44

55
> ⚠️ Local development only. Depends on the reference backend, which has no auth/authz. See [apps/backend/README.md](../backend/README.md).
66
7-
> **Note:** setup is in [root README "Path B. Run the full stack demo"](../../README.md#path-b-run-the-full-stack-demo).
7+
> **Note:** setup is in [root README "Path C. Run the full stack demo"](../../README.md#path-c-run-the-full-stack-demo).
88
99
## What this is
1010

apps/backend/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
>
66
> Seams for consumers to plug in: [`AuthPort`](./auth-port.decision-log.md) for authn/authz, [`TenantContextPort`](./tenant-context-port.decision-log.md) for multi-tenant identity propagation (wiring guide: [`multi-tenancy.md`](./multi-tenancy.md)).
77
8-
> **Note:** setup is in [root README "Path B. Run the full stack demo"](../../README.md#path-b-run-the-full-stack-demo). This file documents the backend's internals, not how to start it.
8+
> **Note:** setup is in [root README "Path C. Run the full stack demo"](../../README.md#path-c-run-the-full-stack-demo). This file documents the backend's internals, not how to start it.
99
1010
Backend execution layer for Workflow Builder AI Studio plugin. Runs AI workflows defined on the canvas via Temporal + OpenRouter.
1111

apps/execution-worker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# @workflow-builder/execution-worker
22

3-
> **Note:** setup is in [root README "Path B. Run the full stack demo"](../../README.md#path-b-run-the-full-stack-demo). This file documents the worker's internals.
3+
> **Note:** setup is in [root README "Path C. Run the full stack demo"](../../README.md#path-c-run-the-full-stack-demo). This file documents the worker's internals.
44
55
Background process that executes workflow graphs submitted by the backend. Currently backed by Temporal; structured so other engines (in-memory, BullMQ, …) can slot in without touching domain logic.
66

packages/sdk/src/features/integration/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ By default, Workflow Builder is a standalone app. You can build the application
1616

1717
Workflow Builder can function as a component within an existing React application. This allows you to integrate its functionality directly into your app rather than hosting it separately.
1818

19-
How to embed Workflow Builder in an existing React codebase: see the [React component quick-start](https://www.workflowbuilder.io/docs/get-started/quick-start/wb-as-react-component/), which covers installation, peer deduplication (local-path build until npm publish), usage, and configuration.
19+
How to embed Workflow Builder in an existing React codebase: see the [React component quick-start](https://www.workflowbuilder.io/docs/get-started/quick-start/wb-as-react-component/), which covers installation from npm, usage, and configuration.
2020

2121
You can also build your application as an npm package and then simply consume it in your application.
2222

0 commit comments

Comments
 (0)