Exporting Patterns
Export your visual patterns to deployable configuration formats.
Export Formats
YAML Format
Standard Parallax pattern format for use with the SDK and CLI.
Use for:
- SDK integration (
client.registerPattern()) - CLI deployment (
parallax pattern deploy) - Version control
- Manual editing
Example Output:
name: content-classifier
version: 1.0.0
description: Classify content using multi-agent voting
input:
content:
type: string
required: true
agents:
capabilities: [classification]
min: 3
execution:
strategy: parallel
timeout: 30000
aggregation:
strategy: voting
method: majority
minVotes: 2
validation:
minConfidence: 0.7
onFailure: retry
maxRetries: 2
output:
category: $vote.result
confidence: $vote.confidence
Prism Format
Domain-specific language for complex orchestrations.
Use for:
- Advanced patterns
- Multi-step workflows
- Pattern composition
- Runtime optimization
Example Output:
pattern content-classifier {
version "1.0.0"
input {
content: string @required
}
agents classification {
capabilities: [classification]
min: 3
}
execute parallel {
timeout: 30s
}
aggregate voting {
method: majority
minVotes: 2
}
validate {
minConfidence: 0.7
onFailure: retry(2)
}
output {
category: $vote.result
confidence: $vote.confidence
}
}
JSON Format
Machine-readable format for programmatic use.
Use for:
- API integration
- Programmatic generation
- Tool interoperability
Exporting
From the Toolbar
- Click Export in the toolbar
- Select format:
- Export YAML - Standard format
- Export Prism - DSL format
- Export JSON - Machine format
- Choose action:
- Copy to Clipboard
- Download File
- Deploy to Control Plane (if connected)
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Cmd/Ctrl + E | Open export dialog |
Cmd/Ctrl + Shift + C | Copy YAML to clipboard |
Cmd/Ctrl + Shift + S | Save/download file |
Export Options
When exporting, you can configure:
| Option | Description |
|---|---|
| Include Comments | Add documentation comments |
| Include Metadata | Include author, timestamp |
| Minify | Remove whitespace (JSON only) |
| Validate | Validate before export |
Validation Before Export
The builder validates patterns before export:
Pre-export Checks
- Required nodes: Input and Output nodes exist
- Connections: All nodes properly connected
- Configuration: Required fields filled
- Types: Data types compatible
- Variables: All references valid
Validation Errors
If validation fails, you'll see:
❌ Export failed - 2 errors found:
1. Agent node missing capabilities
→ Configure at least one capability
2. Output references undefined variable: $results.data
→ Check variable name or add source node
Fix and Retry
- Click on the error to highlight the problem node
- Fix the configuration
- Click Export again
Importing
Import YAML
Load existing patterns into the builder:
- Click File → Import
- Select YAML file or paste content
- Pattern loads onto canvas
Import from Examples
- Click Examples in toolbar
- Select an example pattern
- Pattern loads onto canvas
- Modify as needed
Import Limitations
Some patterns may not fully import:
| Feature | Support |
|---|---|
| Basic patterns | Full support |
| Multi-step | Full support |
| Complex conditionals | Partial support |
| Custom primitives | Not supported |
| Pattern composition | Partial support |
Deployment
Direct Deploy
Deploy directly from the builder:
- Click Export → Deploy to Control Plane
- Select target environment
- Confirm deployment
Requires:
- Connected to control plane
- Appropriate permissions
- Valid pattern
CLI Deploy
Deploy exported files via CLI:
# Validate first
parallax pattern validate my-pattern.yaml
# Deploy to local
parallax pattern deploy my-pattern.yaml
# Deploy to specific environment
parallax pattern deploy my-pattern.yaml --env production
SDK Deploy
Deploy programmatically:
import { ParallaxClient } from '@parallax/sdk-typescript';
import fs from 'fs';
const client = new ParallaxClient({ url: 'http://localhost:8080' });
const yaml = fs.readFileSync('my-pattern.yaml', 'utf-8');
await client.registerPattern(yaml);
Version Management
Pattern Versioning
Set version in the pattern metadata:
name: my-pattern
version: 2.1.0 # Semantic versioning
Updating Patterns
When updating an existing pattern:
- Increment version number
- Export new version
- Deploy (old versions remain available)
Version Selection
Clients can select versions:
// Exact version
client.executePattern('my-pattern', input, { version: '2.1.0' });
// Version range
client.executePattern('my-pattern', input, { version: '2.x' });
// Latest
client.executePattern('my-pattern', input, { version: 'latest' });
Export Troubleshooting
"Cannot export: validation failed"
Cause: Pattern has configuration errors
Solution:
- Check the error panel
- Fix highlighted issues
- Retry export
"YAML generation failed"
Cause: Complex pattern structure
Solution:
- Simplify pattern
- Check for unsupported features
- Try JSON export instead
"Prism compilation failed"
Cause: Pattern uses features not supported in Prism
Solution:
- Use YAML format instead
- Simplify complex conditions
- Check Prism documentation for supported features
Exported YAML differs from preview
Cause: Preview may not show all options
Solution:
- This is expected for optional fields
- Exported YAML is canonical
- Both are functionally equivalent
Best Practices
Before Export
- Validate thoroughly - Fix all errors and warnings
- Test with examples - Try sample inputs mentally
- Review connections - Ensure data flows correctly
- Check variable names - Consistent, descriptive names
File Management
- Use version control - Commit pattern files
- Name consistently -
{name}-v{version}.yaml - Include metadata - Author, date, description
- Keep backups - Save before major changes
Deployment
- Test locally first - Use local control plane
- Validate in staging - Before production
- Monitor after deploy - Check metrics
- Rollback plan - Know how to revert
Next Steps
- Overview - Builder guide
- YAML Syntax - YAML reference
- Executing Patterns - Using exported patterns