Exporting Workflows
Export your workflows in various formats for backup, sharing, or integration into your codebase.
Export Formats
JSON
The complete workflow definition in JSON format.
Use cases:
- Backup and restore
- Version control (Git)
- Import to another account
- Programmatic manipulation
JavaScript/TypeScript
Your workflow as executable code.
Use cases:
- Run outside the platform
- Integrate into existing codebase
- Customize with native code
- Self-host the automation
Template
A shareable version others can import.
Use cases:
- Share with the community
- Distribute to team members
- Sell on the marketplace
Exporting to JSON
From the Editor
- Open your workflow
- Click ... menu > Export
- Select JSON
- Download the file
Via API
curl -X GET https://api.specway.com/v1/workflows/{id}/export \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
JSON Structure
{
"version": "1.0",
"workflow": {
"id": "wf_abc123",
"name": "My Workflow",
"nodes": [...],
"connections": [...],
"settings": {...}
},
"exportedAt": "2024-01-15T10:30:00Z"
}
Exporting to Code
From the Editor
- Open your workflow
- Click ... menu > Export
- Select JavaScript or TypeScript
- Choose runtime options
- Download the code
Code Options
Runtime:
- Node.js
- Deno
- Browser (ESM)
Dependencies:
- Bundled (single file)
- External (package.json included)
Generated Code Example
import { createWorkflow } from '@specway/sdk';
const workflow = createWorkflow({
name: 'My Workflow',
trigger: {
type: 'webhook',
config: { method: 'POST' }
},
steps: [
{
type: 'http',
config: {
url: 'https://api.example.com/data',
method: 'GET'
}
},
{
type: 'condition',
config: {
field: 'response.status',
operator: 'equals',
value: 'active'
}
}
]
});
export default workflow;
Running Exported Code
# Install dependencies
npm install @specway/sdk
# Run the workflow
node workflow.js
Creating Templates
Prepare for Sharing
Before exporting as a template:
- Remove sensitive data - No API keys or tokens
- Use placeholders - Mark fields users need to fill
- Add documentation - Describe what the workflow does
- Test thoroughly - Ensure it works from scratch
Export as Template
- Open your workflow
- Click Share > Create Template
- Add title and description
- Select category
- Choose visibility (public or team)
- Click Create
Template Metadata
{
"template": {
"name": "Slack Notifications",
"description": "Send Slack messages on form submission",
"category": "notifications",
"tags": ["slack", "forms", "notifications"],
"requiredIntegrations": ["slack"],
"configurationSteps": [
"Connect your Slack workspace",
"Select the notification channel"
]
}
}
Importing
Import JSON
- Go to Workflows
- Click Import
- Select your JSON file
- Review the imported workflow
- Click Create
Import from URL
- Go to Workflows
- Click Import > From URL
- Paste the JSON URL
- Review and create
Duplicate Detection
When importing, the system checks for:
- Duplicate workflow IDs
- Conflicting names
- Missing integrations
You can choose to:
- Create new (separate workflow)
- Overwrite (replace existing)
- Skip (cancel import)
Best Practices
Version Control
Keep workflows in Git:
- Export to JSON regularly
- Commit to repository
- Track changes over time
- Collaborate via PRs
Backup Strategy
Regular exports protect your work:
- Schedule weekly JSON exports
- Store in secure location
- Test restore process periodically
Documentation
When sharing templates:
- Explain the use case
- List prerequisites
- Describe configuration steps
- Include example data
Next Steps
- Code Export Guide - Advanced code options
- Publishing Templates - Share publicly
- Version History - Track changes