Operations Guide
This comprehensive guide covers the different types of operations available in Raikoo, how to configure them, and best practices for using them effectively in your workflows.
Understanding Operations
Operations are the fundamental building blocks of Raikoo workflows. Each operation performs a specific task, from AI-based text generation to file manipulation or data transformation. When combined in workflows, operations form powerful automation chains that can accomplish complex tasks.
Operation Categories
Raikoo operations fall into several main categories:
AI-Based Operations
These operations leverage large language models (LLMs) to generate text, analyze content, answer questions, and perform other natural language tasks.
- Multi-step Assistant - Versatile operation for complex AI interactions
- Content Generator - Focused on creating various types of content
- Summarizer - Condenses longer texts into concise summaries
- Analyzer - Extracts insights and performs analysis on text
- Classifier - Categorizes content based on defined criteria
- Q&A - Answers questions based on provided context
Programmatic Operations
These operations perform deterministic, code-based tasks without necessarily using AI:
- Logic Operations - Implement conditional branching (if-else)
- Iterator Operations - Process collections of items (for loops, for each)
- System Operations - Execute code, manage files, perform format conversions
- Data Operations - Transform, filter, or manipulate data
Integration Operations
These operations connect with external systems and services:
- API Connector - Interacts with external APIs
- Database Operations - Query and manipulate database content
- File System Operations - Interact with files and directories
- Web Operations - Fetch and process web content
Anatomy of an Operation
Understanding the structure of operations helps you configure them effectively:
Common Operation Properties
Most operations in Raikoo share these configuration elements:
- Name - Identifier for the operation
- Description - Explanation of the operation's purpose
- Request - Input data or prompt for the operation
- Parameters - Additional configuration settings
- Dependencies - Operations that must complete before this one executes
- Output - Where results are stored in the workspace
AI Operation Specific Properties
AI-based operations include additional properties:
- Persona - The AI role or character to assume
- Model Selector - Which language model to use
- System Prompt - Instructions for the AI model
- Context - Additional information provided to the model
- Format - Expected output structure
Advanced Operation Properties
Some operations support additional advanced configuration:
- Error Handling - How to respond to failures
- Timeout - Maximum execution time
- Caching - Whether to store and reuse results
- Resource Limits - Constraints on memory or processing
Configuring Operations
Basic Configuration Steps
To configure an operation in the Workflow Builder:
- Drag the operation from the operations panel onto the canvas
- Click the operation to select it
- Use the Properties panel to configure settings
- Connect the operation to others by creating dependencies
Setting the Request
The request is the primary input for an operation. You can set it in several ways:
- Static Content - Directly entered text or values
- Workspace File Reference - Path to a file in the workspace
- Parameter Reference - Reference to a workflow parameter
- Output Reference - Reference to another operation's output
Example of using a text replacement to reference a workspace file:
{{Workspace.[/data/input.txt]}}
Configuring Parameters
Parameters provide additional configuration options for operations:
- Locate the Parameters section in the Properties panel
- Click "Add Parameter" to add custom parameters
- Set parameter name and value (static or reference)
- Use parameter references within the operation as needed
Setting the Output
Configure where the operation's results are stored:
- In the Properties panel, locate the Output section
- Select output type:
- File - Save to a specified file in the workspace
- Variable - Store in a variable for reference by other operations
- For file output, specify the path pattern
- Configure append mode and separator if needed
AI Operation Configuration
Selecting a Persona
Choose the right persona for your AI operation:
- In the Properties panel, locate the Persona selector
- Choose from available personas or create a new one
- Consider the task requirements when selecting a persona:
- Content creation vs. analysis
- Technical vs. creative
- Domain-specific knowledge needed
Crafting Effective Prompts
For AI operations, the prompt is critical to getting good results:
- Be specific about what you want the AI to do
- Provide examples of desired output format
- Use clear instructions rather than vague requests
- Include context that helps the AI understand the task
- Structure the prompt with clear sections
Example of a well-structured prompt:
Review the following customer feedback and categorize the sentiment as positive, neutral, or negative.
Then identify the main topics mentioned and any specific product features discussed.
CUSTOMER FEEDBACK:
{{Workspace.[/feedback/latest.txt]}}
Please format your response as:
Sentiment: [positive/neutral/negative]
Main Topics: [comma-separated list]
Product Features: [comma-separated list]
Summary: [brief 1-2 sentence summary]
Managing Context
Provide additional context to improve AI operation results:
- In the Properties panel, locate the Context section
- Add context items, which can be:
- Files from the workspace
- Text content
- Output from previous operations
- Order context items by importance
Output Formatting
Control the format of AI operation outputs:
- Use examples in the prompt to guide formatting
- Consider using structured output formats (JSON, YAML, etc.)
- For consistent formatting, use template files as reference
System Operations Configuration
System operations require specific configuration based on their function:
Code Execution Operations
For operations that execute code:
- Select the appropriate language operation (JavaScript, Python, etc.)
- Enter or reference the code to execute
- Configure any required parameters (libraries, timeout, etc.)
- Set the output path for the results
File Conversion Operations
For operations that convert between formats:
- Provide the source file as the request
- Set any format-specific parameters
- Configure the output path with appropriate extension
Data Processing Operations
For operations that transform data:
- Provide the data source as the request
- Configure transformation parameters
- Set the output format and location
Iterator Operations Configuration
Iterator operations process collections of items:
For Each Loop
Configure For Each Loop operations:
- Set the request to the collection of files to process
- Add child operations inside the loop
- Reference loop variables in child operations:
{{WrapperOperation.FilePath}}{{WrapperOperation.Content}}{{WrapperOperation.Current}}
- Configure parallel/serial execution mode
Data Loop
Configure Data Loop operations:
- Set the request to the data file to iterate over
- Configure the data type (CSV, JSON, YAML, etc.)
- Add child operations that process each data item
- Reference data in child operations using:
{{WrapperOperation.Content}}(for the current data item)- Parse helpers for structured data
Best Practices
Operation Naming
Use clear, descriptive names for operations:
- Include the primary function in the name
- Use consistent naming patterns
- Consider prefixing with operation type for clarity
- "AI: Generate Product Description"
- "System: Convert to PDF"
- "Iterator: Process Customer Records"
Organizing Complex Workflows
For workflows with many operations:
- Group related operations visually
- Use clear dependencies to show flow
- Consider breaking into multiple workflows for very complex processes
- Add comments to explain operation groups
Optimizing Performance
Improve workflow execution speed:
- Use parallel execution when operations are independent
- Minimize file operations for large files
- Use appropriate caching strategies
- Consider chunking large datasets
Error Handling
Build robust workflows with proper error handling:
- Add validation operations before critical processing
- Include fallback paths for common failure points
- Use conditional operations to check intermediate results
- Log detailed error information
Advanced Operation Techniques
Chaining Operations
Create sophisticated processes by chaining operations:
- Output from one operation becomes input to another
- Build progressive refinement chains
- Create feedback loops with conditions
Example chain:
Data Source → Initial Analysis → Content Generation → Quality Check → Final Formatting
Conditional Operation Execution
Control which operations execute based on conditions:
- Add a condition operation before the conditional operation
- Set the condition logic in JavaScript or using simple expressions
- Connect the condition to different operations based on result (true/false)
Custom Operation Development
For specialized needs, create custom operations:
- Use the Execute JavaScript or Execute Python operations
- Implement specific functionality in code
- Package frequently used custom operations as reusable tools
Operation Reference
For detailed information on specific operations, refer to:
- System Operations - Documentation on all built-in system operations
- Iterator Operations - Guide to working with collection operations
- Files and Documents - Specific operations for document handling
- Text Replacements - Using dynamic text in operations
Conclusion
Operations are the heart of Raikoo workflows. By understanding the different types available and how to configure them effectively, you can build powerful AI-driven processes that automate complex tasks. Experiment with different combinations and configurations to find the best approach for your specific needs.