Prompt
How do I build a workflow app that business users can edit later?
Latest observation
To build a workflow app that business users can edit later, design it as a configuration-driven system rather than hardcoding workflows in application logic.
1) Separate “workflow definition” from “workflow execution”
You want two layers:
- Workflow designer / editor: lets users create and change steps, rules, conditions, assignments, approvals, etc.
- Workflow engine: reads the saved definition and executes it for each case/task.
This means the app runs on metadata like:
- steps
- transitions
- conditions
- roles/assignees
- forms
- SLA timers
- notifications
Instead of code like:
if department == "Finance" then send to manager
store something like:
{
"from": "Submit",
"to": "ManagerApproval",
"condition": "department == 'Finance'"
}
2) Use a visual workflow editor
Business users usually need a drag-and-drop UI.
Common UI patterns:
- Flowchart canvas: nodes and connectors
- Form-based editor: simpler for non-technical users
- Hybrid: drag-and-drop plus property panel
Each node should expose editable properties like:
- name
- type (approval, task, decision, timer, notification)
- assignee rules
- form fields
- completion criteria
- conditions for outgoing transitions
3) Define a workflow schema
Create a stable data model that stores workflows in a database.
A minimal schema might include:
- Workflow
- id
- name
- version
- status (draft/published/archived)
- Node
- id
- workflow_id
- type
- label
- config JSON
- Edge / Transition
- id
- from_node_id
- to_node_id
- condition
- Execution instance
- id
- workflow_version_id
- current_node_id
- state
- Task
- id
- instance_id
- assignee
- status
- due_date
Store flexible config as JSON so you can extend later without schema changes.
4) Version workflows
This is critical.
Once a workflow is published, don’t overwrite the active version. Instead:
- save edits as a new version
- keep old instances running on the version they started with
- decide whether new instances use the latest published version
This avoids breaking in-flight work when business users edit a process.
Recommended lifecycle:
- Draft: editable
- Published: executable
- Archived: read-only
5) Build a rules layer for business logic
Business users often need rules without code changes.
Examples:
- if amount > 10,000, require director approval
- if region = EU, route to compliance
- if overdue, escalate after 48 hours
Ways to implement:
- simple expression language
- rule builder UI
- decision tables
- DMN-like approach
Keep rules separate from the UI so they can be edited independently.
6) Make forms configurable too
Workflows usually need input forms at each step.
Use:
- reusable form fields
- conditional visibility
- validation rules
- computed values
Again, store form definitions as metadata rather than hardcoding every screen.
7) Add permissions and governance
Business-editable systems need guardrails.
Include:
- role-based access control
- draft approval before publishing
- audit logs of changes
- change history and rollback
- environment separation if needed
Useful pattern:
- business users can edit draft workflows
- admins or process owners approve publishing
- all changes are tracked
8) Make execution engine stateless where possible
The engine should:
- load workflow definition
- evaluate current state and rules
- create/update tasks
- move instance to next node
Keep execution state in the database so the app can restart safely and scale horizontally.
9) Use event-driven components
For notifications, timers, escalations, and integrations, use events:
- task created
- task completed
- SLA expired
- workflow started
- workflow finished
This keeps the engine modular and easier to extend.
10) Build for safe editing
When users edit workflows, they can accidentally break them. Add safeguards:
- validate graph connectivity
- prevent dead ends unless intended
- detect loops or unreachable nodes
- check missing assignees
- test run / simulation mode
- preview of affected instances
A “simulate workflow” feature is especially valuable.
Practical architecture
A solid stack looks like this:
Frontend
- React / Vue / Angular
- canvas library for diagram editing
- form builder UI
- rule editor UI
Backend
- API for workflow CRUD
- execution engine service
- rules evaluator
- task service
- notification service
Storage
- relational DB for core entities
- JSON columns for workflow configs
- audit log table
- optional cache/queue for async processing
Integrations
- email, Slack, Teams
- ERP/CRM via APIs
- webhooks
Recommended MVP
If you’re starting small, build this first:
- Create workflow as a simple sequence of steps
- Add branching with conditions
- Store definitions in JSON
- Add versioning
- Add a basic drag-and-drop editor
- Add task assignment and approvals
- Add audit logs and publishing flow
Then expand into:
- parallel paths
- timers/escalations
- decision tables
- reusable sub-workflows
- advanced forms
Best practice summary
To make workflows editable by business users later:
- model workflows as data
- use a visual editor
- version every published workflow
- separate execution from design
- keep rules and forms configurable
- add validation, audit, and governance
If you want, I can also give you:
- a database schema
- a sample JSON workflow format
- a system architecture diagram
- or a step-by-step MVP implementation plan