The workflow-automation engine of the iMBrace platform — build, manage and deploy stateful DAG workflows that combine AI, deterministic logic, integrations and human approval.
Based on Activepieces (upstream v0.72.4). See About for what iMBrace changed and the License.
- About / Based on Activepieces
- Quick Start
- Local Development Setup
- Building Pieces
- Builtin Pieces Sync
- Documentation
- Contributing
- License
iMBrace Workflow is a fork of Activepieces,
tracking upstream v0.72.4. The enterprise-only code (packages/ee/) has been
removed, so this repository ships the MIT-licensed core only.
- iMBrace ecosystem integration — replaces Activepieces auth with iMBrace
auth (auto-login, sidebar hidden); the organization is resolved from the
account context instead of a selector; all API calls are routed through the
iMBrace app-gateway (migrated off the legacy backend); the dashboard
validates the
x-organization-idheader. - Custom pieces (the largest change) — iMBrace-built pieces under
packages/pieces/community/:automate-data-board,document-ai,ask-a-question,record-linker,assign-team-and-end-flow,end-flow,clip-and-cache,prep-and-send,databoard, plus an AI connector (v2 with custom instructions, suggestions and a document provider). - Kafka integration — Kafka trigger, CRM topic, offset commits, retry and rebalance handling, SSL config.
- Internationalization — Chinese (zh/cn) translations for pieces and the right panel.
- Infrastructure — split
Dockerfile.backend/Dockerfile.engine/Dockerfile.frontend, production/staging nginx configs, CI/CD, DB migration/init and worker-scaling docs.
Get up and running in minutes:
- Node.js v18 or higher
- npm v9 or higher
- Docker (for PostgreSQL and Redis)
-
Clone the repository (if you haven't already):
git clone https://github.com/imbrace-co/workflow.git cd workflow -
Set up environment files:
cp .env.example .env cp .env packages/server/api/.env
-
Start infrastructure (PostgreSQL and Redis):
docker-compose -f docker-compose.infra.yml up -d
-
Set up the development environment:
node tools/setup-dev.js
-
Run database migrations (required on first run and after pulling new migrations):
npm run db:migrate
This applies pending TypeORM migrations and seeds, then exits. The API server no longer migrates on boot — see docs/HORIZONTAL_WORKER_SCALING.md.
-
Start the application:
npm start
-
Access the application:
- Option 1: Open http://localhost:4200 and login with:
- Email:
dev@ap.com - Password:
12345678
- Email:
- Option 2: Use direct URL with token from iMBrace webapp:
Example:
http://localhost:4200/projects/?token=<YOUR_TOKEN>&organizationId=<YOUR_ORG_ID>http://localhost:4200/projects/?token=acc_ba7b7672-ae89-4e4f-a48a-159b3ab9ebb8&organizationId=org_imbrace
- Option 1: Open http://localhost:4200 and login with:
Ensure you have the following installed:
The project requires environment configuration in two locations:
Copy the example file to create your local configuration:
cp .env.example .envThe .env file contains:
- Database Configuration: PostgreSQL connection settings
AP_POSTGRES_DATABASE,AP_POSTGRES_HOST,AP_POSTGRES_PORT,AP_POSTGRES_USERNAME,AP_POSTGRES_PASSWORD
- Redis Configuration: Redis connection settings for caching and queuing
AP_REDIS_HOST,AP_REDIS_PORT,AP_REDIS_DB
- Security Configuration: Encryption and JWT secrets
AP_ENCRYPTION_KEY,AP_JWT_SECRET
- Pieces Configuration: Controls which pieces are loaded
AP_PIECES_SOURCE=BUILTIN(use builtin pieces)AP_DEV_PIECES(comma-separated list of pieces to load during development)
- Kafka Configuration (optional): For event streaming
KAFKA_ENABLED,KAFKA_ENDPOINT, credentials, etc.
- AWS Credentials (optional): For AWS services integration
The server API also needs a copy of the environment file:
cp .env packages/server/api/.envQuick command to set up both files:
cp .env.example .env && cp .env packages/server/api/.envThe project uses Docker Compose to run PostgreSQL and Redis locally.
docker-compose -f docker-compose.infra.yml up -dThis starts:
- PostgreSQL 14.4 on port
5432 - Redis 7.0.7 on port
6379
docker-compose -f docker-compose.infra.yml downdocker-compose -f docker-compose.infra.yml logs -fThe API server no longer runs migrations on boot. Run them explicitly with:
npm run db:migrateThis connects to the database configured in .env, applies all pending TypeORM migrations,
runs seeds (roles + dev data), then exits. Run it on first setup and any time you pull new
migrations. See docs/HORIZONTAL_WORKER_SCALING.md.
- Make your code changes
- The application supports hot reloading - changes appear in ~7 seconds
- Test your changes at http://localhost:4200
Pieces are reusable workflow components (integrations, actions, triggers) built in TypeScript.
Building pieces is:
- ✅ Code-based: Built with TypeScript for type safety and flexibility
- ✅ Fast iteration: Hot reloading shows changes within seconds
- ✅ Open source: Explore and contribute to existing pieces
- ✅ Community-driven: ask questions and collaborate in GitHub Discussions
- ✅ AI-powered: Universal AI SDK for multi-provider AI integration
- Fork the repository (for contributions)
- Set up your development environment (see above)
- Create a piece definition in
packages/pieces/community/{your-piece} - Add authentication (if needed)
- Create actions (operations your piece can perform)
- Create triggers (events your piece can listen to)
Create a new piece in the community folder:
packages/pieces/community/my-piece/
├── src/
│ ├── index.ts # Piece definition
│ ├── lib/
│ │ └── auth.ts # Authentication
│ └── actions/
│ └── my-action.ts # Actions
└── package.jsonFor detailed guides, see the Documentation section below.
The pieces-builtin package aggregates selected community pieces into a single optimized bundle for performance and deployment.
- Source:
packages/pieces/community/{piece} - Destination:
packages/pieces/builtin/src/pieces/{piece} - Versions:
packages/pieces/builtin/src/versions.ts(auto-generated) - Registry:
packages/pieces/builtin/src/registry.ts(dynamic loader)
The sync script copies source code, merges dependencies, and generates metadata files.
# Sync SAMPLE pieces only (default)
node scripts/sync-community-to-builtin.mjs sample
# Sync ALL community pieces
node scripts/sync-community-to-builtin.mjs all
# Sync SPECIFIC pieces by name (recommended for targeted updates)
node scripts/sync-community-to-builtin.mjs google-sheets cal-com
node scripts/sync-community-to-builtin.mjs document-aiWhat it does:
- Cleans
packages/pieces/builtin/src/pieces - Copies
src/from each community piece tobuiltin/src/pieces/{piece}⚠️ Note:package.jsonis NOT copied to keep the source tree clean
- Merges dependencies into
packages/pieces/builtin/package.json - Generates
packages/pieces/builtin/src/pieces/index.ts - Generates
packages/pieces/builtin/src/versions.ts(preserving original versions)
After syncing, rebuild the builtin package:
npx nx build pieces-builtinGenerate the metadata JSON files used by the UI/Backend:
node scripts/generate-builtin-metadata.mjsThis creates:
dist/packages/pieces/builtin/known/pieces.jsondist/packages/pieces/builtin/types/pieces.json
- Create the piece in
packages/pieces/communityas usual - Run the sync script:
node scripts/sync-community-to-builtin.mjs all - Rebuild
pieces-builtin:npx nx build pieces-builtin - Generate metadata:
node scripts/generate-builtin-metadata.mjs - Commit changes to:
packages/pieces/builtin/src/piecespackages/pieces/builtin/package.jsonpackages/pieces/builtin/src/versions.ts
PIECE_NOT_FOUND error:
- Ensure
packages/pieces/builtin/src/versions.tsexists and contains your piece - Check that
registry.tscorrectly infers the piece name
Build Errors:
- Check for version conflicts in
package.json - Verify all dependencies are included in the consolidated package
- Run
npm installinpackages/pieces/builtin
Detailed documentation is available in the docs/developers/ folder:
- Getting Started - Overview of setup options
- Local Environment - Local development setup
- Codespaces - Quick setup with GitHub Codespaces
- Dev Container - Remote development setup
- Overview - Introduction to building pieces
- Start Building - Step-by-step tutorial
- Setup Fork - Fork the repository
- Piece Definition - Define your piece structure
- Piece Authentication - Add authentication
- Create Action - Build actions
- Create Trigger - Build triggers
- Properties - Input/output properties
- Properties Validation - Validate user input
- Authentication - Authentication patterns
- Custom API Calls - Make HTTP requests
- External Libraries - Use npm packages
- Files - Work with files
- Flow Control - Conditional logic
- Persistent Storage - Store data
- Piece Versioning - Version your pieces
- i18n - Internationalization
- AI Providers - AI integration
- Examples - Code examples
- BUILTIN Mode Build Script - Building pieces for
AP_PIECES_SOURCE=BUILTIN
Contributions are welcome — most pieces in this project are community-contributed.
- 🐛 Open issues and pull requests on github.com/imbrace-co/workflow
- 💬 Ask questions and collaborate in GitHub Discussions
iMBrace Workflow is licensed under the MIT License — see LICENSE.
The enterprise-only code from the upstream project has been removed, so this repository contains only MIT-licensed code. As required by the MIT license, the original copyright notice of the upstream project (Activepieces Inc.) is retained in LICENSE.
Happy building! 🚀