Quick scaffold for new workflow class in existing project. Use when user wants to add another workflow to existing project without full setup wizard.
Scaffolds new workflow classes in existing Cloudflare Workflows projects.
/plugin marketplace add secondsky/claude-skills/plugin install cloudflare-workflows@claude-skillsQuick scaffolding for new workflow classes in existing Cloudflare Workflows projects.
Use AskUserQuestion:
Question 1: Class Name
Store as: className
Generate: workflowName = kebab-case version
Question 2: Pattern Type
label: "Sequential"
description: "Basic step-by-step workflow"
label: "Event-Driven"
description: "Wait for external events"
label: "Scheduled"
description: "Workflows with sleep/delays"
label: "Parallel"
description: "Run steps in parallel"
Store as: pattern
Question 3: Number of Steps
Store as: stepCount
File: src/workflows/${workflowName}.ts
Template (based on pattern):
import { WorkflowEntrypoint, WorkflowStep, WorkflowEvent } from 'cloudflare:workers';
import { NonRetryableError } from 'cloudflare:workflows';
type Env = {
// Add your bindings
};
type Params = {
id: string;
};
export class ${className} extends WorkflowEntrypoint<Env, Params> {
async run(event: WorkflowEvent<Params>, step: WorkflowStep) {
const { id } = event.payload;
${generateSteps(pattern, stepCount)}
return { status: 'complete', id };
}
}
generateSteps logic:
Update wrangler.jsonc:
Use Edit tool to add to workflows array:
{
"binding": "${className.toUpperCase()}_WORKFLOW",
"name": "${workflowName}",
"class_name": "${className}"
}
Update Env interface:
If src/types.ts exists:
${className.toUpperCase()}_WORKFLOW: Workflow;
File: src/index.ts
Add export:
export { ${className} } from './workflows/${workflowName}';
# Validate configuration
./scripts/validate-workflow-config.sh wrangler.jsonc
# Check limits
./scripts/check-workflow-limits.sh src/workflows/${workflowName}.ts
✅ Workflow Created!
Files:
- src/workflows/${workflowName}.ts (${className})
- wrangler.jsonc (updated)
- src/index.ts (export added)
Next Steps:
1. Implement workflow logic in src/workflows/${workflowName}.ts
2. Test: wrangler dev
3. Deploy: wrangler deploy
Binding: env.${className.toUpperCase()}_WORKFLOW
Duplicate Class: Workflow class already exists → Suggest different name Invalid Name: Must be PascalCase → Show examples No Project: No wrangler.jsonc found → Run /workflow-setup first
Quick workflow scaffolding in 6 steps:
When to Use: Adding workflow to existing project (faster than /workflow-setup).