Skip to main content

Process Design with SoftyFlow

SoftyFlow's Process Modeler provides powerful tools to design, build, and test business workflows using BPMN 2.0 standards. This guide covers everything you need to create effective process flows.

Before you begin, ensure you've completed your project setup and created your web interfaces that will connect to your processes.

Overview

Process design in SoftyFlow involves creating workflows that combine activities, gateways, and events to automate business logic. Each process consists of interconnected process components that define the execution path and business rules.

Key Components

  • Activities: Tasks that perform work (User Tasks, Send Tasks, Service Tasks, Sub Processes)
  • Gateways: Decision points that control process flow
  • Events: Triggers and endpoints (Start, End, Timer, Error events)
  • Sequence Flow: Connections that define execution order

Activities & Components

User Tasks (Manual Tasks)

Human-performed tasks that appear in user baskets.

Configuration:

  • Assignment: Users, roles, or dynamic assignment using variables
  • Interface: Select UI screen for task execution
  • Notifications: Email notifications with customizable templates
  • Due Dates: Task deadlines and priority levels
  • Observers: Read-only access for specific users/roles
// Dynamic user assignment
{{ userEmails }} // Variable containing user emails
{{ SF_initiator }} // Process initiator

Send Tasks (Email Tasks)

Automated email sending without human interaction.

Configuration:

  • Recipients: Users, roles, or variable-based targeting
  • Templates: Visual email editor with variable support
  • Providers: Multiple email service providers
  • Attachments: File attachments from project resources

Service Tasks

Automated API calls and external service integrations using our integration system.

Configuration:

  • Service Selection: Choose from available connectors
  • Authentication: OAuth2, API Key, Basic Auth support
  • Parameters: Method-specific configuration
  • Error Handling: Built-in retry and error management

Sub Processes

Execute other processes within the current workflow.

Key Features:

  • Process Selection: Choose any process from your project
  • Variable Passing: Automatic variable inheritance
  • Parallel Execution: Multi-instance support with arrays
  • Result Collection: Aggregated results from parallel instances
// Parallel sub-process execution
let userList = [
{ name: "John", email: "john@email.com" },
{ name: "Jane", email: "jane@email.com" }
];
// Each element starts a separate sub-process instance

Gateways & Flow Control

Exclusive Gateway (XOR)

Creates decision points where only one path is taken.

// Gateway conditions on outgoing flows
{{ orderAmount }} > 1000 // High-value path
{{ priority }} == 'urgent' // Urgent processing path

Parallel Gateway

Splits execution into multiple parallel paths or joins them back together.

Use Cases:

  • Simultaneous task execution
  • Parallel approvals
  • Multi-step processing

Input/Output Parameters

Configure data transformation before and after task execution. Available for User Tasks, Send Tasks, and Sub Processes. For detailed configuration, see our Input/Output Parameters guide.

Parameter Types

Scripts (JavaScript)

Complex server-side logic with full SoftyFlow SDK access.

// Calculate order totals
let subtotal = orderItems.reduce((sum, item) => sum + (item.price * item.quantity), 0);
let tax = subtotal * 0.08;
return { subtotal, tax, total: subtotal + tax };

Available SDK Functions:

SF.collection.find('users', {status: 'active'})  // Database queries
SF.file.upload(fileData) // File operations
SF.user.getUserById(userId) // User management
SF.instance.launchProcess(processId, variables) // Process control

Learn more about the complete SDK in our Node.js SDK reference.

Expressions

Simple variable assignments and string operations.

{{ firstName }} + ' ' + {{ lastName }}  // String concatenation

Actions

Visual function builder for UI operations and database queries.

Available Actions:

  • Database operations (Find, Insert, Update, Delete)
  • Process management (Launch, Validate, Get tasks)
  • User management (Find users, Update metadata)
  • Utilities (Generate PDF, Send email, API calls)

For detailed Input/Output configuration, see the Input/Output Parameters guide.

Scheduled Tasks & Timers

Timer Events

Time-based triggers for process automation.

Boundary Timer Events

Attached to activities for timeout handling.

Interrupting Timers:

  • Start in: Delay before triggering (minutes)
  • Action: Interrupts main activity and follows alternative path

Non-Interrupting Timers:

  • Every: Recurring interval (minutes)
  • Action: Runs parallel to main activity
// Variable-based delays
{{ delayMinutes }} // Dynamic timing based on process data

Use Cases

  • SLA Monitoring: Automatic escalation after delays
  • Reminders: Periodic notifications for pending tasks
  • Cleanup: Scheduled maintenance activities

Email Triggers & Notifications

Automatic Email Triggers

Configured through Send Tasks and User Task notifications.

Email Features:

  • Variable Integration: Dynamic content using process variables
  • Template Editor: Visual email design with drag-and-drop
  • Multi-Provider: Support for different email services
  • Attachment Support: Include files from project resources
// Email subject with variables
'Order #{{ orderNumber }} - {{ customerName }}'

// Conditional email content
{{ status == 'approved' ? 'Your order has been approved' : 'Your order requires review' }}

Notification Strategies

  • Task Assignment: Notify users of new tasks
  • Status Updates: Inform stakeholders of progress
  • Error Alerts: Automatic error notifications
  • Escalation: Time-based escalation emails

Measures & KPIs

Process measures enable real-time tracking and reporting by calculating KPIs during process execution.

Measure Configuration

Each measure requires:

  • Label: Descriptive name for reports
  • Type: String, Number, Boolean, Date, or Any
  • Field: JavaScript expression for calculation

Calculation Examples

// Performance metrics
{{ completedTasks }} / {{ totalTasks }} * 100 // Completion percentage

// Financial calculations
{{ orderAmount }} + {{ shippingCost }} + {{ taxAmount }} // Total cost

// Duration tracking
(new Date() - new Date(startDate)) / (1000 * 60 * 60 * 24) // Days elapsed

// Status categorization
{{ amount }} > 1000 ? 'High Value' : 'Standard' // Risk category

System Measures

Automatically provided for every process:

  • SF_last_activity_name: Current activity name
  • SF_involved_users: Participating users
  • SF_status: Process status
  • SF_createdAt: Process start time

For comprehensive measure configuration, see the Measures documentation.

Error Handling

Error Boundary Events

Catch and handle errors from attached activities.

Configuration:

  • Attach to Activities: User tasks, service tasks, sub-processes
  • Error Types: Specific error handling or catch-all
  • Recovery Actions: Alternative execution paths

Error Handling Strategies

// Robust error handling in scripts
try {
let result = complexCalculation(inputData);
return result;
} catch (error) {
console.error('Calculation failed:', error);
return { error: true, message: error.message };
}

Best Practices:

  • Always provide fallback paths for critical processes
  • Log errors for debugging and monitoring
  • Implement retry mechanisms for transient failures
  • Use timeout events for long-running operations

Security & Access Control

Task-Level Security

  • User Assignment: Direct user or role-based assignment
  • Observers: Read-only access control
  • reCAPTCHA: Prevent spam in public tasks
  • Dynamic Assignment: Variable-based security rules

Process-Level Security

  • Role Restrictions: Control who can access processes using role management
  • View Permissions: Separate viewing and execution rights
  • Variable Security: Protect sensitive data in process variables
// Dynamic role assignment
{{ userRole == 'manager' ? 'managers' : 'employees' }}

// Conditional access
{{ department == 'finance' && clearanceLevel >= 3 }}

Security Best Practices

  • Use principle of least privilege
  • Implement proper role hierarchies
  • Audit process access and modifications
  • Secure sensitive variables and API credentials
  • Validate all user inputs in scripts and expressions

Best Practices

Process Design

  1. Modularity: Use sub-processes for reusable components
  2. Error Handling: Always provide error paths and timeouts
  3. Performance: Minimize complex calculations in critical paths
  4. Documentation: Use descriptive names and comments

Variable Management

  1. Naming Conventions: Use consistent, descriptive variable names
  2. Type Safety: Ensure expressions match expected data types
  3. Null Checking: Always validate variable existence
  4. Security: Protect sensitive data from exposure

Testing & Validation

  1. Unit Testing: Test individual components before integration
  2. End-to-End Testing: Validate complete process flows
  3. Performance Testing: Monitor execution times and resource usage
  4. User Acceptance: Involve business users in testing

Getting Started

  1. Start Simple: Begin with basic user tasks and gateways
  2. Add Complexity Gradually: Introduce advanced features step by step
  3. Test Frequently: Validate each component as you build
  4. Monitor Performance: Track measures and optimize as needed
  5. Document Processes: Maintain clear documentation for maintenance

This foundation will enable you to build robust, scalable business processes that effectively automate your organization's workflows while maintaining security and performance standards.


Next Steps

Now that you understand process design, continue building your application:

For hands-on experience, try our step-by-step tutorials or watch our process and reports video tutorials.

For advanced features, explore our Process Components, Input/Output Parameters, Measures, and Sub Processes documentation.