You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| **Variables** | State management across blocks |
| **Response** | Final output formatting |
### File Operations
Agents can perform file operations in two ways:
#### Option 1: Local File Tools (WORKSPACE_DIR)
Set `WORKSPACE_DIR` in `.env` to enable sandboxed local file operations:
```bash
# In .env
WORKSPACE_DIR=./workspace
```
When enabled, agents automatically get access to these tools:
| Tool | Description |
|------|-------------|
| `local_write_file` | Write text content to a file |
| `local_write_bytes` | Write binary data (images, PDFs) as base64 |
| `local_append_file` | Append text to a file (creates if not exists) |
| `local_read_file` | Read text content from a file |
| `local_read_bytes` | Read binary data as base64 |
| `local_delete_file` | Delete a file |
| `local_list_directory` | List files with metadata (size, modified time) |
**Enable Command Execution** (opt-in for security):
```bash
# In .env
WORKSPACE_DIR=./workspace
ENABLE_COMMAND_EXECUTION=true
```
When enabled, agents also get:
| Tool | Description |
|------|-------------|
| `local_execute_command` | Run commands like `python script.py` or `node process.js` |
Shell operators (`|`, `>`, `&&`, etc.) are blocked for security.
**File Size Limits:**
```bash
# Default: 100MB. Set custom limit in bytes:
MAX_FILE_SIZE=52428800 # 50MB
```
**Security:** All paths are sandboxed to `WORKSPACE_DIR`. Path traversal attacks (`../`) and symlink escapes are blocked. Agents cannot access files outside the workspace directory.
**With Docker:** The `docker-compose.yml` mounts `./output` on your host to `/app/workspace` in the container:
```bash
docker compose up -d
# Files written by agents appear in ./output/ on your host machine
```
#### Option 2: MCP Filesystem Tools
If your workflow uses MCP filesystem servers, those tools work as configured. MCP servers handle file operations on their own systems—paths and permissions are determined by the MCP server's configuration.
#### Using Both Together
You can enable both options simultaneously. If `WORKSPACE_DIR` is set, agents will have access to:
- Local file tools (`local_write_file`, etc.) for the sandboxed workspace
- MCP tools for external filesystem servers
The LLM chooses the appropriate tool based on the tool descriptions and context.
#### Health Check with Workspace Status
The `/health` endpoint returns workspace configuration status:
```json
{
"status": "healthy",
"workspace": {
"enabled": true,
"workspace_dir": "/app/workspace",
"command_execution_enabled": false,
"max_file_size": 104857600
}
}
```
### API Endpoints
The exported service provides these endpoints:
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/execute` | POST | Execute the workflow with input data |
| `/health` | GET | Health check (returns `{"status": "healthy"}`) |
| `/ready` | GET | Readiness check |
**Example execution:**
```bash
curl -X POST http://localhost:8080/execute \
-H "Content-Type: application/json" \
-d '{
"message": "Analyze this data",
"data": {"key": "value"}
}'
```
### Docker Deployment
```bash
# Build and run with Docker Compose
docker compose up -d
# View logs
docker compose logs -f
# Stop
docker compose down
```
**Manual Docker build:**
```bash
docker build -t my-workflow .
docker run -p 8080:8080 --env-file .env my-workflow
```
### Production Configuration
| Environment Variable | Default | Description |
|---------------------|---------|-------------|
| `HOST` | `0.0.0.0` | Server bind address |
| `PORT` | `8080` | Server port |
| `WORKSPACE_DIR` | (disabled) | Enable local file tools with sandbox path |
The exported service supports MCP (Model Context Protocol) tools via the official Python SDK. MCP servers must be running and accessible at their configured URLs.
MCP tools configured in your workflow are automatically available to agent blocks. The service connects to MCP servers via Streamable HTTP transport.
### Export Validation
Before export, the service validates your workflow for compatibility:
- **Unsupported block types**: Shows which blocks cannot be exported
- **Unsupported providers**: Shows which LLM providers are not yet supported
- **Clear error messages**: Displayed via notification system with actionable feedback
If validation fails, you'll see a notification explaining what needs to be changed.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.