/create-workflow Command
Version: 1.0.0 Status: Production Category: Workflow Management
System Prompt
⚠️ EXECUTION DIRECTIVE: When the user invokes this command, you MUST:
- IMMEDIATELY execute - no questions, no explanations first
- ALWAYS show full output from script/tool execution
- ALWAYS provide summary after execution completes
DO NOT:
- Say "I don't need to take action" - you ALWAYS execute when invoked
- Ask for confirmation unless
requires_confirmation: truein frontmatter - Skip execution even if it seems redundant - run it anyway
The user invoking the command IS the confirmation.
Purpose
Create new workflows from templates or by composing existing workflows. Supports dynamic workflow generation for novel use cases.
Usage
# Create from template
/create-workflow --template basic-automation --name "weekly-backup"
# Create from description
/create-workflow --describe "Automate weekly database backup with verification and notification"
# Compose from existing workflows
/create-workflow --compose lead-qualification-flow,sales-proposal-automation --name "lead-to-proposal"
# Interactive creation
/create-workflow --interactive
# Clone and modify existing
/create-workflow --clone customer-onboarding-automation --name "enterprise-onboarding"
Options
| Option | Description | Default |
|---|---|---|
--template | Base template to use | none |
--name | Workflow name (kebab-case) | required |
--describe | Natural language description | none |
--compose | Comma-separated workflows to combine | none |
--clone | Existing workflow to clone | none |
--interactive | Interactive creation wizard | false |
--category | Target category | auto-detect |
--output | Output format (md, json, both) | both |
--validate | Validate before saving | true |
Templates
Available Templates
| Template | Steps | Use Case |
|---|---|---|
basic-automation | 5 | Simple task automation |
approval-workflow | 8 | Multi-level approvals |
data-pipeline | 10 | ETL and analysis |
customer-journey | 12 | End-to-end customer process |
incident-response | 10 | Crisis management |
compliance-audit | 15 | Regulatory compliance |
product-launch | 20 | Feature/product release |
research-report | 8 | Investigation and reporting |
Template Variables
/create-workflow --template approval-workflow --name "budget-approval" --vars '{
"approvers": ["manager", "finance", "cfo"],
"threshold": 10000,
"escalation_time": "24h",
"notification_channel": "slack:#approvals"
}'
Creation Modes
From Template
/create-workflow --template data-pipeline --name "sales-analytics" --vars '{
"source": "salesforce",
"destination": "bigquery",
"schedule": "daily",
"transforms": ["aggregate", "calculate_metrics"]
}'
Output:
Creating workflow: sales-analytics
Template: data-pipeline
Variables applied: 4
Generated steps:
1. Extract from Salesforce - data-engineering
2. Validate source data - qa-specialist
3. Transform: aggregate - data-engineering
4. Transform: calculate_metrics - data-engineering
5. Load to BigQuery - data-engineering
6. Validate loaded data - qa-specialist
7. Generate analytics report - business-intelligence-analyst
8. Notify stakeholders - notification-specialist
9. Archive raw data - data-engineering
10. Update data catalog - documentation-librarian
Files created:
- docs/workflows/sales-analytics.md
- workflows/devops/sales-analytics.workflow.json
Workflow ready to execute: /execute-workflow sales-analytics
From Description (AI-Generated)
/create-workflow --describe "When a customer churns, analyze their history, identify patterns, update CRM, notify success team, and create win-back campaign"
Output:
Analyzing description...
Identified intent:
- Trigger: customer churn event
- Actions: analyze, identify, update, notify, create
- Entities: customer, history, patterns, CRM, success team, campaign
Generating workflow: customer-churn-response
Steps generated:
1. Detect churn event - webhook/trigger
2. Retrieve customer history - crm-integration
3. Analyze usage patterns - business-intelligence-analyst
4. Identify churn indicators - data-engineering
5. Update CRM status - crm-integration
6. Generate churn report - codi-documentation-writer
7. Notify success team - notification-specialist
8. Create win-back campaign - content-marketing
9. Schedule follow-ups - orchestrator
10. Track win-back progress - monitoring-specialist
Confidence: 87%
Review recommended before production use.
Files created:
- docs/workflows/customer-churn-response.md
- workflows/business/customer-success/customer-churn-response.workflow.json
Compose Multiple Workflows
/create-workflow --compose "lead-qualification-flow,opportunity-tracking-pipeline,deal-closing-workflow" --name "full-sales-cycle"
Output:
Composing workflows...
Source workflows:
1. lead-qualification-flow (10 steps)
2. opportunity-tracking-pipeline (10 steps)
3. deal-closing-workflow (10 steps)
Analyzing connections...
- lead-qualification-flow → opportunity-tracking-pipeline (qualified_lead)
- opportunity-tracking-pipeline → deal-closing-workflow (opportunity_record)
Optimizations applied:
- Removed duplicate data validation steps
- Merged notification steps
- Added transition checkpoints
Generated: full-sales-cycle (25 steps)
Phase 1: Lead Qualification (steps 1-8)
Phase 2: Opportunity Management (steps 9-17)
Phase 3: Deal Closing (steps 18-25)
Files created:
- docs/workflows/full-sales-cycle.md
- workflows/business/sales/full-sales-cycle.workflow.json
Interactive Mode
/create-workflow --interactive
Welcome to Workflow Creator
What type of workflow do you want to create?
1. Automation (reduce manual work)
2. Approval (multi-level decisions)
3. Pipeline (data processing)
4. Journey (multi-step process)
5. Response (event-driven)
> 1
What domain is this workflow for?
1. Software Development
2. Business Operations
3. Sales & Marketing
4. Finance
5. HR & Legal
6. Other
> 2
Describe what you want to automate:
> Weekly report generation from multiple data sources with executive summary
Generating workflow...
Proposed: weekly-report-automation
Steps:
1. Trigger on schedule (Monday 8am)
2. Collect data from Source A
3. Collect data from Source B
4. Merge and validate data
5. Generate charts and visualizations
6. Create executive summary (AI)
7. Format report document
8. Send to distribution list
9. Archive report
Does this look correct? (yes/no/modify)
> yes
Workflow created successfully!
Validation
All created workflows are validated for:
- Structure: Valid YAML/JSON format
- Steps: Each step has agent assignment
- Dependencies: All referenced agents exist
- Triggers: Valid trigger configuration
- QA Integration: Quality checkpoints defined
# Validation output
Validating: weekly-report-automation
✓ Structure valid
✓ All 9 steps have agent assignments
✓ All agents available (5 unique)
✓ Trigger configured (schedule)
✓ QA checkpoints defined (3)
Validation passed!
Output Formats
Markdown (docs/workflows/)
## weekly-report-automation
- **Description:** Automated weekly report from multiple sources with AI summary
- **Trigger:** schedule (Monday 8am)
- **Complexity:** moderate
- **Duration:** 15-30m
- **QA Integration:** validation: required, review: recommended
- **Dependencies:**
- Agents: data-engineering, business-intelligence-analyst, ai-specialist, codi-documentation-writer, notification-specialist
- Commands: /generate-report
- **Steps:**
1. Trigger on schedule - scheduler - Initiate weekly run
...
N8N JSON (workflows/)
{
"name": "Weekly Report Automation",
"nodes": [...],
"connections": {...},
"_coditect": {
"source": "create-workflow",
"template": "data-pipeline",
"created": "2025-12-12T10:00:00Z"
}
}
Related Commands
/analyze-workflow- Find existing workflows/execute-workflow- Run a workflow/list-workflows- List all workflows
Success Output
When workflow creation completes:
✅ COMMAND COMPLETE: /create-workflow
Workflow: <workflow-name>
Template: <template-name|generated>
Steps: N
Agents: N unique
QA Checkpoints: N
Files: docs/workflows/<name>.md, workflows/<category>/<name>.workflow.json
Completion Checklist
Before marking complete:
- Workflow name assigned
- All steps defined
- Agents assigned
- Validation passed
- Files created
Failure Indicators
This command has FAILED if:
- ❌ Missing workflow name
- ❌ Validation failed
- ❌ No output files
- ❌ Agents not available
When NOT to Use
Do NOT use when:
- Single-step task (no workflow needed)
- Existing workflow covers use case
- Ad-hoc task without reuse
Anti-Patterns (Avoid)
| Anti-Pattern | Problem | Solution |
|---|---|---|
| Skip validation | Broken workflow | Always validate |
| No QA checkpoints | Quality issues | Add QA integration |
| Vague steps | Unclear execution | Be specific |
Principles
This command embodies:
- #2 Search Before Create - Check existing workflows
- #3 Complete Execution - Full workflow generation
- #6 Clear, Understandable - Structured output
Full Standard: CODITECT-STANDARD-AUTOMATION.md
Maintainer: CODITECT Core Team