Architecture

    Gamification

    How ProcessFlow motivates users through experience points, coins, badges, and challenges tied to workflow execution.

    Gamification System

    ProcessFlow rewards users for completing workflow tasks. Each process node can be configured to grant experience points, coins, and badges when its task is completed. Rewards are tracked per user per team in the statistics table.


    Reward Types

    TypeDescription
    Experience (XP)Cumulative score representing overall activity in a team
    CoinsCurrency earned through task completion
    BadgesOne-time achievement markers awarded under specific conditions

    Badge Types

    BadgeAwarded when…
    Explorer BadgeUser completes a node for the first time
    Completion BadgeUser completes a process instance
    Speed BadgeUser completes a task within a time challenge threshold

    Challenges

    ChallengeDescription
    Time ChallengeTask must be completed within a configured time limit

    Configuration per Node

    In the process editor, each activity node has a Gamification configuration section. The options (src/model/GamificationOptions.ts) include:

    FieldPurpose
    pointTypeWhether to award Experience or Coins
    pointsForSuccessNumber of points awarded on successful completion
    pointsApplicationMethodHow points are applied (e.g. add, multiply)
    hasConditionWhether an extra condition must be met to earn the reward
    comparisonComparison operator for the condition (value1 OP value2)
    value1 / value2Values used in the condition expression
    badgeTypeWhich badge (if any) to award on completion

    Statistics Storage

    Gamification state is stored in the statistics table — one row per user per team:

    statistics
    ├── profileId   (→ user)
    ├── teamId      (→ team)
    ├── experience  (BigInt, cumulative)
    ├── coins       (BigInt, cumulative)
    └── badges      (JSONB: { badges: string[] })

    A statistics row is automatically created when a user registers (handled in the sign-up Server Action). The /statistics page in each team workspace displays leaderboards and personal progress using Recharts.

    On this page

    Gamification