Workspaces
Workspaces are a foundational element of the Raikoo platform, providing a virtual file system where workflows operate. This page explains what workspaces are, how they function, and best practices for using them effectively.
What is a Workspace?
A workspace in Raikoo is a virtual file system that serves as a shared environment for all operations within a workflow. It provides a consistent, isolated space where:
- Operations can read and write files
- Data can be stored and retrieved
- Results can be accumulated throughout the workflow execution
- Context and state can be maintained across multiple operations
Think of a workspace as a dedicated project folder that contains all the resources needed for a workflow to execute successfully.
Key Features of Workspaces
Virtual File System
Workspaces implement a complete virtual file system with:
- Directory structures
- File creation, reading, updating, and deletion
- File metadata management
- Path-based access to resources
Isolation
Each workflow execution gets its own workspace instance, ensuring:
- Data isolation between different workflow runs
- Protection from interference from other workflows
- Clean environment for each execution
Persistence
Workspaces preserve state throughout the entire workflow execution:
- Files created by early operations remain available to later operations
- Changes to files are tracked and maintained
- The final state can be saved or exported at the end of execution
Versioning
Workspaces support versioning capabilities:
- Tracking changes to files over time
- Allowing operations to reference specific versions of files
- Supporting branching for experimental or parallel workflows
Working with Workspaces
File Paths
Files in a workspace are referenced using path syntax:
- Absolute paths start with a forward slash (e.g.,
/data/config.json) - Relative paths are interpreted based on the current operation's context
- Directory separators are forward slashes, regardless of the host operating system
Common Operations
Operations can interact with the workspace through:
- Reading files - Retrieving content from the workspace
- Writing files - Creating new files or updating existing ones
- Deleting files - Removing files that are no longer needed
- Listing directories - Enumerating files in a specific directory
- Checking existence - Verifying if a file or directory exists
Workspace References
In operation configurations, you'll often specify workspace references:
- Input references - Point to files or data that the operation should use as input
- Output references - Designate where the operation's results should be stored
- Context references - Identify additional information the operation may need
Workspace Lifecycle
Creation
A workspace is created when a workflow execution begins. It may:
- Start empty
- Be initialized with files from a template
- Import files from external sources
Runtime
During workflow execution:
- Operations read from and write to the workspace
- The state evolves as operations complete
- Operations can access results from previous steps
Completion
When a workflow completes, the workspace can be:
- Downloaded as a ZIP archive
- Exported to external storage
- Saved as a template for future workflows
- Discarded if no longer needed
Best Practices for Workspace Management
Organization
- Use a consistent directory structure - Create logical organization for your files
- Group related files - Keep files with similar purposes in dedicated directories
- Use descriptive filenames - Make file purposes clear from their names
Efficiency
- Clean up temporary files - Delete intermediate files that won't be needed later
- Avoid excessive duplication - Reference existing files rather than creating copies
- Manage file sizes - Be mindful of storing very large files that may impact performance
Collaboration
- Document workspace structure - Provide clear information about the organization
- Use standard formats - Prefer widely-used file formats for better compatibility
- Consider reusability - Design workspaces to be reusable across similar workflows
Advanced Workspace Features
Templates
Workspace templates provide starting points for new workflows, including:
- Pre-populated directory structures
- Common configuration files
- Sample data or resources
Mapping External Resources
Workspaces can map external resources, making them available within the workspace:
- Cloud storage buckets
- Databases
- APIs
Multi-Workspace Workflows
Complex workflows may utilize multiple workspaces:
- Separate workspaces for different stages of processing
- Specialized workspaces for specific operation types
- Parent-child workspace relationships
Conclusion
Workspaces are the central environment where Raikoo workflows operate. By understanding how to effectively work with workspaces, you can create more organized, efficient, and maintainable workflows. The virtual file system approach provides a powerful and flexible foundation for AI orchestration tasks of all kinds.