React Component
Use this approach when your target project is already a React app and you want to embed Workflow Builder directly as a feature. No separate build, no iframe, no web component.
Legend
Section titled “Legend”- 📦 source repository (this one)
- 🚩 target repository (your project)
Copy the Workflow Builder source
Section titled “Copy the Workflow Builder source”- Create
src/features/workflow-builder🚩 inside your project. - Copy the contents of
apps/frontend/src/app📦 intosrc/features/workflow-builder🚩 (skipnode_modulesanddist). - Rename the
Appcomponent toWorkflowBuilderinfeatures/workflow-builder/app.tsx🚩. - Import
<WorkflowBuilder />into the correct place in your application. You may also need to migrateapps/frontend/src/global.css📦 tosrc/features/workflow-builder/global.css🚩.
Fix icons and types
Section titled “Fix icons and types”- Copy
apps/types📦 andapps/icons📦 intosrc/features/workflow-builder/🚩 (skipnode_modulesanddist). - Replace all occurrences of
from '@workflow-builder'withfrom '@/features/workflow-builder'across the copied files. - Copy all
dependenciesanddevDependenciesfromapps/icons/package.json📦 into the rootpackage.json🚩. - Remove
package.jsonandtsconfig.jsonfromsrc/features/workflow-builder/icons🚩 - it will run from the rootpackage.jsonnow. - In
src/features/workflow-builder/icons/config.json🚩 change./assets→./src/features/workflow-builder/assets. - In
src/features/workflow-builder/icons/config.json🚩 change./dist→./src/features/workflow-builder/dist. - In root
package.json🚩 add a script to generate icons. If you already have a"prepare"script (e.g. for Husky), chain the commands:"generate-icons": "tsx src/features/workflow-builder/icons/src/generate-icons.ts","prepare": "husky && npm run generate-icons" - Run
npm run generate-iconsto verify. It should generate adistfolder insidesrc/features/workflow-builder/icons/dist🚩. - If you have a CI pipeline, add
npm run generate-iconsafter theinstallstep.
Set the integration strategy
Section titled “Set the integration strategy”In src/features/workflow-builder/features/integration/components/with-integration.tsx 🚩, change the exported strategy:
export const withIntegration = hocByStrategy.PROPS;See the Through Props integration page for details on passing data in and out of the editor.