Publishing
Deploy workflows, agents, and processors to environments with versioned releases and publish target configuration.
Overview
Publishing is the final step of the release pipeline, where versioned artifacts are deployed to target environments and made available for execution. M3 Forge provides:
- Publish targets - Configurable deployment destinations
- Atomic deployments - All-or-nothing releases to prevent partial states
- Publish history - Full audit trail of what was deployed when
- Rollback support - Quick recovery from problematic releases
Publishing integrates with the Release Pipeline to provide end-to-end deployment automation.
Publish Targets
Publish targets define where and how artifacts are deployed.
What is a Publish Target?
A publish target is a configuration that specifies:
- Environment - Which environment to deploy to (dev, staging, production)
- Gateway - Which Marie-AI gateway executes workflows
- Database - Where workflow definitions are stored
- Access controls - Who can publish to this target
- Deployment settings - Timeouts, concurrency, validation rules
Viewing Publish Targets
Navigate to Settings → Publish Targets to see all configured targets:
| Target | Environment | Gateway | Type | Status |
|---|---|---|---|---|
| Development | development | gateway-dev | Auto-deploy | ✓ Active |
| Staging | staging | gateway-staging | Manual approval | ✓ Active |
| Production | production | gateway-prod-lb | Manual approval | ✓ Active |
| Hotfix | production | gateway-prod-lb | Emergency | ⏸ Inactive |
Creating a Publish Target
Navigate to Publish Targets
Go to Settings → Publish Targets.
Click “Create Target”
Open the target creation form.
Configure basic properties
{
"name": "Production US East",
"environment": "production",
"type": "manual_approval",
"enabled": true
}Select gateway
Choose the Marie-AI gateway for workflow execution:
{
"gateway_id": "gateway-us-east-1-prod",
"gateway_url": "https://prod-gateway-us-east.example.com",
"health_check_interval_seconds": 60
}Configure database
Specify where workflow definitions are stored:
{
"database_url": "postgresql://user:pass@prod-db.example.com:5432/m3studio",
"schema": "production"
}Set deployment options
{
"deployment": {
"timeout_seconds": 600,
"max_concurrent_deployments": 1,
"require_backup": true,
"run_smoke_tests": true
}
}Configure access controls
{
"access": {
"allowed_roles": ["admin", "maintainer"],
"require_approvals": 2,
"approval_timeout_hours": 24,
"allowed_approvers": ["alice", "bob", "carol"]
}
}Save
The publish target is created and ready to receive deployments.
Publishing a Release
Deploy a version to a publish target:
Navigate to Release Pipeline
Go to Releases → Pipeline.
Select version to publish
In the Versions table, find the version you want to deploy.
Click “Publish”
Open the publish dialog.
Select publish target
Choose the target environment:
- Development US East
- Staging
- Production US East
Review changes
See what will be deployed:
Workflows:
- ✓ invoice-extraction (updated)
- ✓ invoice-classification (new)
- ✗ legacy-invoice-v1 (deleted)
Agents:
- ✓ invoice-agent (updated)
Processors:
- (no changes)
Submit for approval (if required)
For production targets, request approval from designated reviewers.
Monitor deployment
Watch real-time progress with live logs and status updates.
Verify activation
Once deployment succeeds, new version is active and processing requests.
Publish Types
Different publish targets support different deployment workflows:
Auto-Deploy
Deployments start automatically when a new version is created:
{
"type": "auto_deploy",
"triggers": {
"on_version_tag": true,
"version_pattern": "v*.*.*",
"branch": "main"
}
}Use case: Development environments where rapid iteration is needed.
Manual Approval
Deployments require explicit approval from designated reviewers:
{
"type": "manual_approval",
"approvals": {
"min_approvals": 2,
"allowed_approvers": ["alice", "bob", "carol"],
"timeout_hours": 24,
"auto_reject_on_timeout": true
}
}Use case: Staging and production environments requiring human oversight.
Scheduled
Deployments occur on a predefined schedule:
{
"type": "scheduled",
"schedule": {
"cron": "0 2 * * 2",
"timezone": "America/New_York",
"deploy_latest_version": true
}
}Use case: Production deployments during maintenance windows (e.g., every Tuesday at 2 AM).
Emergency
Bypass normal gates for critical hotfixes:
{
"type": "emergency",
"emergency": {
"require_justification": true,
"allowed_roles": ["admin"],
"audit_trail": true,
"post_deploy_review": true
}
}Use case: Hotfix deployments during production outages.
Emergency publishes skip quality gates but are heavily audited. Use only for critical issues.
Publish Process
The publish process executes these steps:
1. Pre-Publish Validation
Before starting deployment:
- Connectivity check - Verify gateway and database are reachable
- Version compatibility - Ensure version is compatible with target environment
- Resource check - Verify sufficient capacity for deployment
- Backup verification - Confirm backup storage is available
If any check fails, deployment is aborted.
2. Quality Gates
Run automated quality checks:
- Workflow validation - DAGs are valid, no cycles
- Security scan - No secrets or vulnerabilities
- Integration tests - End-to-end smoke tests
- Performance tests - Latency and throughput benchmarks
See Release Gates for details.
3. Approval
If required, wait for manual approvals:
- Notification - Send approval requests to designated reviewers
- Review period - Wait for minimum approvals (or timeout)
- Decision - Proceed if approved, abort if rejected
4. Backup
Create backup of current environment state:
- Snapshot workflows - Export current DAG definitions
- Snapshot agents - Export current agent configs
- Snapshot metadata - Save version info and timestamps
- Store backup - Upload to S3 with retention policy
Backups enable quick rollback if deployment fails.
5. Deploy Artifacts
Update target environment:
- Upload workflows - Insert/update DAG definitions in database
- Upload agents - Insert/update agent configurations
- Upload processors - Deploy custom node implementations
- Update metadata - Mark new version as active
Deployment is atomic - either all artifacts are deployed or none are.
6. Activation
Make new version active for execution:
- Switch active version - Update version pointer in database
- Invalidate caches - Clear workflow definition caches
- Restart services (if needed) - Reload configurations
- Route traffic - Direct new executions to new version
7. Post-Publish Verification
Verify deployment succeeded:
- Smoke tests - Execute test workflows end-to-end
- Health checks - Ping gateway and database
- Metric baseline - Record initial metrics for comparison
If verification fails, automatic rollback is triggered.
8. Notification
Notify stakeholders of deployment:
- Slack - Post to deployment channel
- Email - Send to team distribution list
- PagerDuty - Create deployment event
- Webhook - Call custom notification endpoints
Publish History
View all past deployments in the publish history:
History Table
| Version | Target | Status | Started | Duration | Deployed By |
|---|---|---|---|---|---|
| v1.3.0 | Production US East | ✓ Succeeded | 2 hours ago | 3m 45s | alice |
| v1.3.0 | Staging | ✓ Succeeded | 4 hours ago | 2m 12s | alice |
| v1.2.1 | Production US East | ✗ Failed | 2 days ago | 1m 23s | bob |
| v1.2.1 | Staging | ✓ Succeeded | 2 days ago | 2m 34s | bob |
Publish Details
Click any publish to see full details:
Metadata:
- Version: v1.3.0
- Target: Production US East
- Status: Succeeded
- Started: 2024-03-19 14:23:15 UTC
- Completed: 2024-03-19 14:27:00 UTC
- Duration: 3m 45s
- Deployed by: alice
Changes:
- 2 workflows updated
- 1 agent created
- 0 processors deleted
Quality Gates:
- ✓ Validation (3s)
- ✓ Security scan (45s)
- ✓ Integration tests (2m 15s)
Approvals:
- ✓ alice approved (1 hour before deploy)
- ✓ bob approved (30 min before deploy)
Logs:
[2024-03-19 14:23:15] Starting deployment of v1.3.0 to Production US East
[2024-03-19 14:23:16] Running pre-publish validation...
[2024-03-19 14:23:20] ✓ All validations passed
[2024-03-19 14:23:21] Creating backup...
[2024-03-19 14:23:45] ✓ Backup created: backup-prod-20240319-142345
[2024-03-19 14:23:46] Deploying artifacts...
[2024-03-19 14:25:12] ✓ All artifacts deployed
[2024-03-19 14:25:13] Activating new version...
[2024-03-19 14:25:30] ✓ Version v1.3.0 is now active
[2024-03-19 14:25:31] Running post-deploy verification...
[2024-03-19 14:27:00] ✓ All smoke tests passed
[2024-03-19 14:27:00] Deployment succeededRollback
If a publish causes issues, rollback to the previous version:
Rollback Process
Navigate to publish history
Find the problematic deployment in the history table.
Click “Rollback”
Open the rollback confirmation dialog.
Select target version
Choose which version to rollback to:
- Previous version - v1.2.1 (default)
- Specific version - Choose from dropdown
Confirm
Review changes that will be rolled back and confirm.
Monitor rollback
Watch rollback progress with live logs.
Verify
Confirm previous version is active and healthy.
Rollback Execution
Rollback performs these steps:
- Deactivate current version - Stop routing new executions
- Restore from backup - Load previous workflow definitions
- Activate previous version - Route executions to previous version
- Run smoke tests - Verify rollback succeeded
- Notify team - Alert of rollback and reason
Rollback typically completes in under 2 minutes.
Rollback only reverts workflow definitions. In-flight executions continue with the new version.
Multi-Region Publishing
Deploy to multiple geographic regions:
Region Targets
Create publish targets for each region:
{
"targets": [
{
"name": "Production US East",
"region": "us-east-1",
"gateway_url": "https://prod-gateway-us-east.example.com"
},
{
"name": "Production EU West",
"region": "eu-west-1",
"gateway_url": "https://prod-gateway-eu-west.example.com"
},
{
"name": "Production AP Southeast",
"region": "ap-southeast-1",
"gateway_url": "https://prod-gateway-ap-se.example.com"
}
]
}Coordinated Rollout
Deploy to all regions in sequence:
Deploy to first region
Start with lowest-traffic region (AP Southeast).
Monitor for issues
Watch metrics for 30 minutes.
Deploy to second region
If stable, proceed to EU West.
Monitor again
Watch metrics for 30 minutes.
Deploy to final region
If stable, proceed to US East (highest traffic).
Monitor globally
Watch global metrics for 1 hour.
This staged rollout minimizes blast radius if issues occur.
Blue-Green Deployment
Run two versions simultaneously for zero-downtime deploys:
{
"deployment_strategy": "blue_green",
"blue_green": {
"switch_after_seconds": 300,
"traffic_split": {
"blue": 50,
"green": 50
},
"rollback_on_error_rate": 5.0
}
}- Blue - Current version
- Green - New version
- Traffic split 50/50 for 5 minutes
- If error rate > 5%, automatic rollback to blue
Publish Metrics
Track publish performance:
| Metric | Description | Target |
|---|---|---|
| Publish success rate | Percentage of successful publishes | > 95% |
| Mean time to publish | Average duration of publish process | < 5 minutes |
| Rollback rate | Percentage of publishes that required rollback | < 5% |
| Approval wait time | Average time waiting for approvals | < 4 hours |
View metrics in Monitoring → Publish Metrics.
Best Practices
Test Before Production
Always publish to staging before production:
- Publish v1.3.0 to staging
- Run full regression test suite
- Monitor for 1 hour
- If stable, publish to production
Gradual Rollout
For high-risk changes:
- Deploy to 10% of traffic
- Monitor error rates and latency
- If healthy, increase to 50%
- If still healthy, increase to 100%
Publish Windows
Schedule production publishes during low-traffic periods:
- Avoid peak hours - Don’t publish during business hours
- Use maintenance windows - Tuesday 2-4 AM
- Notify users - Warn of potential brief disruption
Automated Testing
Run comprehensive tests before publishing:
- Unit tests (100% pass required)
- Integration tests (95% pass required)
- Performance tests (latency < threshold)
- Security scans (no critical issues)
Communication
Keep team informed of publishes:
- Pre-publish - Announce planned publish time
- During publish - Share real-time status updates
- Post-publish - Confirm success and monitoring plan
Troubleshooting
Publish Stuck in “Deploying”
If publish hangs:
Check publish logs
Look for error messages or last successful step.
Verify gateway connectivity
Ping gateway health endpoint.
Check database connection
Verify database is reachable and not under high load.
Cancel and retry
Click “Cancel” and retry the publish.
Publish Failed
If publish fails:
- Review error logs - Identify failure cause
- Check quality gates - See which gate failed
- Fix issue - Address root cause
- Retry publish - Deploy again after fix
Rollback Failed
If rollback fails:
- Check backup availability - Verify backup exists
- Manual restore - Restore from backup manually if needed
- Contact support - Escalate to platform team
Next Steps
- Configure Publish Targets in Settings
- Set up Release Gates to enforce quality
- Monitor publish health in Monitoring
- Learn about Environments for multi-stage deployment