Overview
The Workflow Builder is the core feature for proposers to create structured workflow proposals. Workflows are sequential task sequences with role-based access control, bounty allocation, and evidence requirements. Each workflow goes through a voting process before becoming active. File Reference:frontend/app/proposer/page.tsx:172
Key Concepts
Workflow Lifecycle
Workflows progress through the following statuses:- pending - Awaiting voter approval
- approved - Voted approved, ready to start when
start_attime is reached - rejected - Denied by voters
- in_progress - Active, improvers can claim and complete steps
- completed - All steps done, awaiting payout
- paid_out - Finalized, all bounties distributed
- blocked - Series workflow waiting for prior instance to complete
- expired - Pending > 14 days without quorum
- deleted - Removed via deletion proposal
frontend/types/workflow.ts:107
Sequential Steps
Workflow steps unlock sequentially. Completing step N makes step N+1 available. Each step has:- Title & Description - Clear task definition
- Bounty - SFLUV token amount awarded on completion
- Role Assignment - Which improver role can claim this step
- Work Items - Evidence requirements (photos, text, dropdowns)
- Optional “Not Possible” Flag - Allow improvers to report when a step cannot be completed
frontend/types/workflow.ts:44-64
Roles & Credentials
Each workflow defines custom roles with credential requirements. Improvers must hold the required credentials to claim steps assigned to that role. Example:frontend/app/proposer/page.tsx:42-46
Creating a Workflow
Basic Information
Title - Clear, descriptive workflow name Description - Outcome, stakeholders, and acceptance criteria Recurrence - Choose from:one_time- Single executiondaily- Recurring dailyweekly- Recurring weeklymonthly- Recurring monthly
series_id. New instances are blocked until the prior one reaches paid_out.
Start Date & Time - When the workflow becomes active (datetime-local input)
Code Reference: frontend/app/proposer/page.tsx:1263-1294
Workflow Supervisor (Optional)
Assign an approved supervisor to oversee the workflow. Supervisors can:- Monitor workflow progress
- Export workflow data
- Receive optional completion bounty
- Enable supervisor checkbox
- Select from approved supervisors dropdown
- Optionally set supervisor bounty (SFLUV amount)
frontend/app/proposer/page.tsx:1296-1366
Defining Roles
Create one or more roles for your workflow. Each role requires:- Title - Role name (e.g., “Field Verifier”, “Data Analyst”)
- Required Credentials - Select one or more credentials improvers must hold
/credentials/types and include:
dpw_certified- DPW Certificationsfluv_verifier- SFLuv Verifier Status- Custom credentials created by issuers
frontend/app/proposer/page.tsx:1368-1406
Building Steps
Each step includes:Step Configuration
- Title - Step name
- Description - Detailed instructions
- Bounty - Token amount (must be ≥ 0)
- Role Assignment - Select which role can claim this step
- Allow “Not Possible” - Checkbox to enable improvers to report uncompleted steps
frontend/app/proposer/page.tsx:100-108
Work Items
Each step has one or more work items defining evidence requirements: Title & Description - What needs to be documented Optional Checkbox - Whether this item can be skipped Photo Requirements:- Enable photo requirement
- Camera capture only (prevents gallery uploads)
- Required photo count (or allow any count)
- Aspect ratio:
square,vertical, orhorizontal
- Option labels
- Optional follow-up text requirement per option
- Notification emails (receive alerts when option is selected)
frontend/app/proposer/page.tsx:85-98
Dropdown Options
Dropdown work items support:- Label - Option text displayed to improver
- Requires Written Response - Force text input when selected
- Notification Emails - List of emails to notify when selected
- Enter email in input field
- Press Enter or click Add
- Email is validated and added to list
frontend/app/proposer/page.tsx:401-425
Template Library
Save workflow configurations as templates for reuse.Using Templates
- Click template dropdown in workflow builder
- Search or browse available templates
- Click template to apply configuration
- Template fills roles, steps, work items, and recurrence
- Manually set workflow title and description
frontend/app/proposer/page.tsx:1165-1229
Saving Templates
From Builder:- Configure workflow fields (title/description optional for template)
- Enter template title (required)
- Enter template description (optional)
- Click “Save Personal Template” or “Save Default Template” (admin only)
- Open workflow details
- Click “Save as Template”
- Enter template title and description
- Template is created from approved workflow structure
frontend/app/proposer/page.tsx:658-704, 941-1078
Template Types
- Personal Templates - Created by proposer, visible only to creator
- Default Templates - Created by admin, visible to all proposers
frontend/app/proposer/page.tsx:681
Managing Workflows
Your Workflows Tab
View all your created workflows with:- Status Filter - Filter by workflow status
- Series Grouping - Recurring workflows grouped by
series_id - Workflow Details - Click any workflow to view full details
frontend/app/proposer/page.tsx:1124-1128
Workflow Actions
Delete Pending Workflow - Remove workflows that haven’t been voted on Propose Deletion - Create deletion proposal for approved/active workflows:- Workflow Deletion - Remove single workflow instance
- Series Deletion - Remove all workflows in recurring series
frontend/app/proposer/page.tsx:836-874
Validation Rules
Workflow Validation
- Title is required
- At least one role with title and credential
- At least one step with title, description, bounty ≥ 0, and role assignment
- Each step has at least one work item
- Each work item requires photo, text, or dropdown
- Photo items with fixed count must have count ≥ 1
- Dropdown items need at least one option with label
frontend/app/proposer/page.tsx:545-637
Template Validation
Same as workflow validation plus:- Template title is required
- Template description is optional
frontend/app/proposer/page.tsx:640-657
Voting System
Workflows require voter approval before becoming active:- Quorum - 50% of eligible voters must participate
- Countdown - 24-hour finalization period starts at quorum
- Early Finalization - If >50% of full voter body agrees before countdown
- Budget Check - Approval blocked if unallocated faucet balance < one week of workflow requirement
- Admin Override - Admin can force-approve (uses
admin_approvedecision)
backend/handlers/app_workflow.go (vote logic)
Bounty Calculation
Total workflow bounty includes:- Sum of all step bounties
- Supervisor bounty (if enabled)
frontend/app/proposer/page.tsx:217-221
UI Components
Cards & Layouts
- Card - Workflow builder container
- Tabs - “Create Workflow” and “Your Workflows” tabs
- Badge - Display draft bounty total, template count, workflow status
Input Components
- Input - Text fields for titles, descriptions, bounties
- Textarea - Multi-line descriptions
- Select - Dropdowns for recurrence, roles, supervisors
- Checkbox - Boolean flags (supervisor enable, optional items, allow not possible)
- Datetime-local - Workflow start time picker
Interactive Components
- Button - Submit, save, delete actions
- Popover - Template search and selection
- Dialog - Delete confirmation, save from workflow modal
- WorkflowDetailsModal - Full workflow view with step details
frontend/app/proposer/page.tsx:6-40 (imports)
API Endpoints
Workflow Operations
Template Operations
Supporting Data
frontend/app/proposer/page.tsx:276-319, 681, 810-833, 876-900
Best Practices
Workflow Design
- Clear Instructions - Write detailed step descriptions with acceptance criteria
- Appropriate Bounties - Set fair compensation for time/effort required
- Logical Sequencing - Order steps in natural workflow progression
- Evidence Balance - Don’t over-burden improvers with excessive photo/text requirements
- Template Reuse - Save well-designed workflows as templates
Role & Credential Strategy
- Specific Roles - Create roles matching skill requirements
- Credential Gating - Use credentials to ensure qualified improvers
- Role Reuse - Standardize role names across similar workflows
Recurring Workflows
- Series Planning - Plan for long-term recurring needs
- Budget Awareness - Ensure sufficient weekly budget for recurring bounties
- Template First - Save as template before creating recurring instances
- Monitoring - Track series completion and adjust as needed
Troubleshooting
Common Errors
“Every role needs a title and at least one required credential”- Ensure all roles have both title and at least one credential selected
- Check that all steps have complete configuration
- Verify bounty is a valid number ≥ 0
- At least one requirement type must be enabled per work item
- Add options to dropdown-enabled work items
- Check email format (must be valid email address)
- Clear pending email input before submitting
Validation Tips
- Review draft total bounty before submitting
- Use template preview to verify configuration
- Test workflow structure with single instance before creating recurring series
- Verify all notification emails are correct before submission
Screenshots
Workflow Builder Interface
The builder displays:- Template library dropdown with search
- Workflow title, description, recurrence, start date
- Optional supervisor configuration
- Role definitions with credential checkboxes
- Sequential step builder with work items
- Draft total bounty badge
- Submit button with loading state
Your Workflows Tab
Shows:- Status filter dropdown
- Series-grouped workflow cards
- Workflow status badges (pending, approved, in progress, etc.)
- Action buttons (view details, delete, propose deletion)
- Series indicators for recurring workflows
Template Library
Features:- Searchable template dropdown
- Template type badges (Default/Personal)
- Template title and description preview
- Delete button for owned templates
- Apply button to load template