Interactive debugging for failing workflow instances. Use when user reports workflow errors, instances stuck, or deployment failures.
Diagnoses and fixes failing Cloudflare Workflow instances with interactive step-by-step debugging.
/plugin marketplace add secondsky/claude-skills/plugin install cloudflare-workflows@claude-skillsInteractive debugging assistant for Cloudflare Workflow instances with step-by-step diagnosis.
Use AskUserQuestion:
Question: "Which workflow instance needs debugging?"
label: "I have instance ID"
description: "Provide specific instance ID to debug"
label: "Show recent instances"
description: "List recent instances and select one"
label: "Show failed instances"
description: "List only failed instances"
If "I have instance ID":
If "Show recent instances":
wrangler workflows instances list ${workflowName} --limit 10
Display instances, ask user to select one
If "Show failed instances":
wrangler workflows instances list ${workflowName} --status errored --limit 10
wrangler workflows instances describe ${workflowName} ${instanceId}
Parse Output:
Display:
Instance Details:
- ID: ${instanceId}
- Status: ${status}
- Steps Completed: ${stepsCompleted} / ${totalSteps}
- Last Step: ${lastStep}
- Error: ${errorMessage}
Based on status, provide diagnosis:
Check error message patterns:
Pattern 1: "Cannot perform I/O on behalf of different request"
references/common-issues.md #1Pattern 2: "NonRetryableError"
references/common-issues.md #3Pattern 3: "Serialization error"
references/common-issues.md #4Pattern 4: "Timeout"
references/common-issues.md #5Pattern 5: "WorkflowEvent not found"
references/common-issues.md #4Check step history:
If stuck on step.sleep(): Show wake time If stuck on step.waitForEvent(): Check event trigger
Ask user:
Based on diagnosis, provide specific fixes:
For I/O Context Error:
// ❌ Wrong
const data = await fetch('...');
await step.do('use data', async () => {
return data;
});
// ✅ Correct
const data = await step.do('fetch data', async () => {
const response = await fetch('...');
return await response.json();
});
For Serialization Error:
// ❌ Wrong
await step.do('bad', async () => {
return { fn: () => {} }; // Functions not serializable
});
// ✅ Correct
await step.do('good', async () => {
return { result: 'data' }; // JSON-serializable
});
For Timeout:
// ❌ Wrong
await step.do('process all', async () => {
for (let i = 0; i < 10000; i++) {
// Long computation
}
});
// ✅ Correct
for (let i = 0; i < 100; i++) {
await step.do(\`batch \${i}\`, async () => {
// Process batch of 100
});
}
Ask user:
If yes:
Provide testing commands:
# Test locally first
wrangler dev
# Then deploy
wrangler deploy
# Monitor new instances
wrangler workflows instances list ${workflowName} --status running
# Watch for errors
wrangler tail ${workerName} --status error
Suggest:
wrangler workflows instances describewrangler tailDebug Summary:
- Instance: ${instanceId}
- Issue: ${issueSummary}
- Fixes Applied: ${fixesApplied}
Next Steps:
1. ${nextStep1}
2. ${nextStep2}
3. ${nextStep3}
Resources:
- Common issues: references/common-issues.md
- Troubleshooting: references/troubleshooting.md
- Production checklist: references/production-checklist.md
Instance Not Found: Check workflow name and instance ID
Not Authenticated: Run wrangler login
No Access: Check account permissions
Interactive debugging in 7 steps:
When to Use: Workflow errors, stuck instances, deployment failures.