workflow-debug
Interactive debugging for failing workflow instances. Use when user reports workflow errors, instances stuck, or deployment failures.
- 0
- Installs
- —
- Rating
- —
- Success rate
- 1
- Files scanned
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 d11bb5e1b07a5f8e… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
workflow-debug.md
Workflow Debug
Overview
Interactive debugging assistant for Cloudflare Workflow instances with step-by-step diagnosis.
Prerequisites
- wrangler CLI authenticated
- Workflow deployed to Cloudflare
- Instance ID or workflow name
Steps
Step 1: Identify Instance
Use AskUserQuestion:
Question: "Which workflow instance needs debugging?"
- Header: "Instance"
- Question: "How would you like to identify the instance?"
- multiSelect: false
- Options:
-
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":
- Ask for: workflow name + 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
Step 2: Fetch Instance Details
wrangler workflows instances describe ${workflowName} ${instanceId}
Parse Output:
- Status (running, complete, errored)
- Error message (if failed)
- Step history (which steps completed)
- Last step executed
- Retry count
Display:
Instance Details:
- ID: ${instanceId}
- Status: ${status}
- Steps Completed: ${stepsCompleted} / ${totalSteps}
- Last Step: ${lastStep}
- Error: ${errorMessage}
Step 3: Diagnose Issue
Based on status, provide diagnosis:
If Status = "errored":
Check error message patterns:
Pattern 1: "Cannot perform I/O on behalf of different request"
- Diagnosis: I/O outside step.do()
- Solution: Move I/O inside step.do() callbacks
- Reference: Load
references/common-issues.md#1
Pattern 2: "NonRetryableError"
- Diagnosis: Permanent failure
- Solution: Check error message, fix root cause
- Reference: Load
references/common-issues.md#3
Pattern 3: "Serialization error"
- Diagnosis: Non-JSON-serializable data
- Solution: Return only JSON-compatible types
- Reference: Load
references/common-issues.md#4
Pattern 4: "Timeout"
- Diagnosis: Step exceeded 30s CPU limit
- Solution: Break into smaller steps
- Reference: Load
references/common-issues.md#5
Pattern 5: "WorkflowEvent not found"
- Diagnosis: Event name mismatch
- Solution: Match event names exactly
- Reference: Load
references/common-issues.md#4
If Status = "running" (stuck):
Check step history:
If stuck on step.sleep(): Show wake time If stuck on step.waitForEvent(): Check event trigger
Ask user:
- Question: "Instance is stuck. What would you like to do?"
- Options:
- "Wait longer" → Show monitoring command
- "Terminate instance" → Run terminate command
- "Investigate step" → Analyze step code
Step 4: Suggest Fixes
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
});
}
Step 5: Apply Fixes (Optional)
Ask user:
- Question: "Would you like to apply fixes now?"
- Options:
- "Yes - Apply recommended fixes"
- "No - I'll fix manually"
If yes:
- Read workflow file
- Apply fixes using Edit tool
- Re-validate
- Suggest re-deployment
Step 6: Testing & Monitoring
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:
- Use /workflow-test to create test instance
- Monitor with
wrangler workflows instances describe - Check logs with
wrangler tail
Step 7: Summary
Debug 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
Error Handling
Instance Not Found: Check workflow name and instance ID
Not Authenticated: Run wrangler login
No Access: Check account permissions
Summary
Interactive debugging in 7 steps:
- Identify instance (ID, recent, or failed)
- Fetch instance details (status, steps, errors)
- Diagnose issue (pattern matching error messages)
- Suggest fixes (code examples for common issues)
- Apply fixes (optional auto-fix)
- Testing & monitoring (deployment commands)
- Summary & next steps
When to Use: Workflow errors, stuck instances, deployment failures.
Files
1- workflow-debug.md
62b55da7085.7 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from secondsky/claude-skills8
Add a better-auth plugin to an existing project. Configures server and client plugins with proper imports.
Interactive setup wizard for better-auth authentication. Guides through database, framework, OAuth providers, and plugin configuration.
Run a focused blindspot pass for unfamiliar, ambiguous, or high-risk work
Debug Bun applications and diagnose common issues
Deploy Bun applications to various platforms
Initialize a new Bun project with optional framework selection
Migrate existing Node.js/npm projects to Bun
Optimize Bun application performance and bundle size
Related methodology skillsscan passed
Run TDD workflow — write failing tests, implement, verify. For bugs, use the Prove-It pattern.
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.