example.workflow-system
Workflow and approval system example for ContractSpec - State machine with role-based transitions
@lssm-tech/example.workflow-systembun add @lssm-tech/example.workflow-systemManifest declarations describe the current workspace; they do not verify registry publication or runtime execution.
Package guide
Website: https://contractspec.io
Workflow and approval system example for ContractSpec - State machine with role-based transitions.
What This Demonstrates
- Rich Landing Screen: Product introduction explaining workflow orchestration concepts, demo path, and navigation.
- Navigation Rail: Clear sidebar navigation between Overview, Templates, Instances, Approvals, and Analytics.
- State Machine Pattern: Workflow transitions with defined states and allowed transitions.
- Approval Flow: Role-based access control for approval decisions.
- Multi-Entity Domain: Workflow definitions, instances, steps, and approvals.
- React UI: WorkflowDashboard with templates, instances, and visualizations.
- Contract-Backed Visualizations: Status, throughput, and workload analysis.
- Demo Scenarios: Expense Approval, Vendor Onboarding, and Policy Exception workflows with sample data.
Canonical Demo Path
- Landing Screen - Start on the product introduction explaining workflow orchestration.
- Navigation - Use the sidebar rail to explore Templates, Instances, and Approvals.
- Templates - View workflow definitions (Expense Approval, Vendor Onboarding, Policy Exception).
- Instances - See running workflows with their current states.
- Approvals - Review pending approvals and role-based access.
- Analytics - View throughput metrics and workload analysis.
New Features
- LandingScreen: Product-style introduction with value proposition and demo path.
- WorkflowSystemPreviewV2: Enhanced preview with sidebar navigation.
- WorkflowNav: Navigation rail for moving between workflow sections.
- Demo Scenarios: Three complete workflow examples with sample instances.
Running Locally
From examples/workflow-system:
bun run devbun run buildbun run testbun run typecheck
Usage
Use @lssm-tech/example.workflow-system as a reference implementation, or import its exported surfaces into a workspace that composes ContractSpec examples and bundles.
Architecture
src/approvalis part of the package's public or composition surface.src/docs/contains docblocks and documentation-facing exports.src/entities/contains domain entities and value objects.src/example.tsis the runnable example entrypoint.src/handlers/contains handlers or demo adapters wired to contract surfaces.src/index.tsis the root public barrel and package entrypoint.src/instanceis part of the package's public or composition surface.
Public Entry Points
- Export
.resolves through./src/index.ts. - Export
./approvalresolves through./src/approval/index.ts. - Export
./approval/approval.enumresolves through./src/approval/approval.enum.ts. - Export
./approval/approval.eventresolves through./src/approval/approval.event.ts. - Export
./approval/approval.handlerresolves through./src/approval/approval.handler.ts. - Export
./approval/approval.operationsresolves through./src/approval/approval.operations.ts. - Export
./approval/approval.schemaresolves through./src/approval/approval.schema.ts. - Export
./docsresolves through./src/docs/index.ts. - Export
./docs/workflow-system.docblockis an alias of./docsand resolves through./src/docs/index.ts. - Export
./entitiesresolves through./src/entities/index.ts. - The package publishes 44 total export subpaths; keep docs aligned with
package.json.
Local Commands
bun run dev— contractspec-bun-build devbun run build— contractspec-bun-build buildbun run lint— bun lint:fixbun run lint:check— biome check .bun run lint:fix— biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .bun run typecheck— tsgo --noEmitbun run publish:pkg— bun publish --tolerate-republish --ignore-scripts --verbosebun run publish:pkg:canary— bun publish:pkg --tag canarybun run clean— rimraf dist .turbobun run build:bundle— contractspec-bun-build transpilebun run build:types— contractspec-bun-build typesbun run prebuild— contractspec-bun-build prebuildbun run test— bun test
Recent Updates
- UI Improvements: Added LandingScreen, WorkflowNav, and WorkflowSystemPreviewV2 with enhanced navigation.
- Demo Scenarios: Complete workflow examples with Expense Approval, Vendor Onboarding, and Policy Exception.
- Replace eslint+prettier by biomejs to optimize speed.
Notes
- Works alongside
@lssm-tech/lib.contracts-spec,@lssm-tech/lib.design-system,@lssm-tech/lib.example-shared-ui,@lssm-tech/lib.runtime-sandbox,@lssm-tech/lib.schema, ...
Relationships
Arrows point from a package to its direct dependency. Counts are derived from captured workspace manifests.
9 declarations
@lssm-tech/lib.schemaworkspace:^
Read the package manual ↗@lssm-tech/lib.contracts-specworkspace:^
Read the package manual ↗@lssm-tech/lib.example-shared-uiworkspace:^
Read the package manual ↗@lssm-tech/lib.design-systemworkspace:^
Read the package manual ↗@lssm-tech/lib.runtime-sandboxworkspace:^
Read the package manual ↗lucide-reactcatalog:ui
Declared capabilities
This manifest does not declare a capability catalogue. Use the guide, import map and source to assess the package.
Scripts
publish:pkgbun publish --tolerate-republish --ignore-scripts --verbosepublish:pkg:canarybun publish:pkg --tag canarybuildcontractspec-bun-build buildbuild:bundlecontractspec-bun-build transpilebuild:typescontractspec-bun-build typesdevcontractspec-bun-build devcleanrimraf dist .turbolintbun lint:fixlint:fixnode ../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../scripts/biome.cjs check --write .lint:checknode ../../scripts/biome.cjs check .prebuildcontractspec-bun-build prebuildtestbun testtypechecktsgo --noEmit