Skip to main content

Input Output

Input/Output parameters allow you to process and transform data before and after task execution in your process workflows. This powerful feature supports three types of operations: Scripts, Expressions, and Actions.

Input/Output parameters are available for:

Parameter Types

TypeDescriptionUse Case
ScriptJavaScript code executed server-sideComplex logic, calculations, API calls
ExpressionString ValueVariable with a static string value
ActionVisual function builderUI operations, database queries, file handling
Input/Output Parameters Overview Interface

The Input/Output parameters interface provides a centralized location for managing data transformations before and after task execution, with support for scripts, expressions, and visual action builders.

Input Parameters

Input parameters are executed before the task runs, allowing you to:

  • Transform external data for task consumption
  • Set up task-specific variables
  • Prepare data from previous tasks
  • Initialize default values

Output Parameters

Output parameters are executed after the task completes, allowing you to:

  • Process task results
  • Transform data for the next steps
  • Update process variables
  • Save results to databases

Script Parameters

Scripts use JavaScript and run in a secure server-side environment with access to the Softyflow SDK.

Script Parameter Editor Interface

The script parameter editor offers a complete JavaScript development environment with syntax highlighting, variable access, and SDK integration for implementing complex business logic and data transformations.

Available Variables in Scripts:

  • Process Variables: All current process variables
  • SF_initiator: Process initiator information
  • SF_latestValidator: Latest task validator
  • volt: Global configuration variables
  • SF: Softyflow SDK instance

SDK Functions Available:

// Database operations
SF.collection.find("users", { status: "active" });
SF.collection.insertOne("orders", orderData);

// File operations
SF.file.upload(fileData);
SF.file.download(fileId);

// User operations
SF.user.getUserById(userId);
SF.user.updateUserMetadata(userId, "preference", value);

// Process operations
SF.instance.launchProcess(processId, variables);
SF.instance.validateTask(taskId, data);

Expression Parameters

Expressions are simple text expressions.

Expression Parameter Editor Interface

The expression parameter interface enables simple string value assignments without complex scripting, ideal for static values, basic variable mapping, and straightforward text assignments.

Action Parameters

Actions provide a visual interface for building complex functions without writing code.

Action Parameter Visual Builder Interface

The action builder provides a no-code visual interface for creating complex workflows by connecting pre-built operations like database queries, API calls, and file handling without JavaScript programming.

Available Action Categories:

Database Actions

  • Find Collection: Query database collections
  • Insert to Collection: Add new documents
  • Update Collection: Modify existing documents
  • Delete Document: Remove documents
  • Aggregate Collection: Complex database queries
  • SQL Operations: Direct SQL database operations

Process Actions

  • Launch Process: Start new process instances
  • Validate Task: Complete pending tasks
  • Get Pending Task: Retrieve task information
  • Update Instance Variables: Modify process data
  • Get Measures: Retrieve process metrics

User Management Actions

  • Find Users: Search user database
  • Find User By ID: Get specific user
  • Update User Metadata: Modify user preferences
  • Get User Metadata: Retrieve user data

Utility Actions

  • Get Next Value: Generate sequential numbers
  • Call API: External API integration
  • Generate PDF: Create PDF documents
  • Send Email: Email notifications

Configuration Interface

This comprehensive configuration panel offers drag-and-drop parameter management, real-time testing capabilities, and validation tools to ensure your data transformations work correctly before deployment.

Input/Output Configuration Panel

Adding Parameters

  1. Open Task Configuration: Select any task in the process modeler
  2. Access Input/Output Section: Scroll to the Input/Output section
  3. Add Parameters: Use the + buttons to add new parameters:
    • Add Script: For JavaScript code
    • Add Expression: For simple expressions
    • Add Action: For visual function building

Parameter Management

Drag & Drop Ordering

Parameters execute in order from top to bottom. Use the drag handle to reorder:

📋 Parameter 1 (executes first)
📋 Parameter 2 (executes second)
📋 Parameter 3 (executes last)

Best Practices

Performance Optimization

  • Use expressions for simple operations
  • Use scripts for complex logic
  • Use actions for database operations
  • Minimize external API calls in critical paths

Error Handling

// Robust script example
try {
let result = complexCalculation(inputData);
return result;
} catch (error) {
console.error("Calculation failed:", error);
return defaultValue;
}

Variable Naming

  • Use descriptive names: customerEmail vs email
  • Follow naming conventions: camelCase
  • Avoid system prefixes: Don't start with SF_

Advanced Features

Dynamic Variable Names

// Set variables dynamically
let variableName = "user_" + userId;
variables[variableName] = userData;

Conditional Execution

// Only execute if conditions are met
if (orderTotal > 1000) {
return applyDiscountLogic();
}
return orderTotal;

Multi-Instance Processing

For sub-processes with parallel instances:

// Access loop variables in sub-process
let currentItem = SF_loop_variables;
let itemIndex = SF_loop_index;

System Variables

Always available in scripts and expressions:

  • SF_initiator: Process starter information
  • SF_latestValidator: Last task validator
  • SF_mode: Current execution mode (test/prod)
  • SF_version: Process version
  • instanceId: Current process instance ID
  • projectId: Current project ID

Troubleshooting

Common Issues

Variable Not Found

Error: Cannot read property 'name' of undefined

Solution: Check variable names and ensure they exist in the process context.

Syntax Errors in Scripts

Error: Unexpected token

Solution: Validate JavaScript syntax and use the testing interface.

Action Parameter Errors

Error: Missing required parameter

Solution: Ensure all required action parameters are configured correctly.

Timeout Errors

Error: Operation timed out

Solution: Optimize scripts and actions, consider breaking into smaller operations.

Debugging Tips

  1. Use Console Logging: Add console.log() statements in scripts
  2. Test Incrementally: Start with simple expressions and build complexity
  3. Check Variable Values: Use the variable finder to verify available data
  4. Validate Data Types: Ensure variables contain expected data types
  5. Use Try-Catch: Wrap complex operations in error handling

This comprehensive input/output system provides powerful data transformation capabilities while maintaining simplicity for common use cases. Whether you need simple variable mapping or complex business logic, the combination of scripts, expressions, and actions covers all process automation needs.