feat: add workflow runner with per-step retry support#8
Open
yohaiai wants to merge 2 commits into
Open
Conversation
Add workflow-runner.ts that orchestrates multi-step workflow execution with configurable per-step retries. This is critical for time-sensitive steps like TOTP 2FA code entry where the 30-second OTP window may expire during execution. Key features: - WorkflowStep.retries field (default: 0 = no retry) - App re-launch on each retry attempt for fresh state - Dashboard notifications for retry events (workflow_step_retry) - Graceful abort handling during retries - DB progress tracking per step Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
workflow-runner.ts— a multi-step workflow orchestrator with configurable per-step retry supportWorkflowStepcan specify aretriescount (default0= no retry, backwards compatible)workflow_step_retrydashboard events for retry visibilityMotivation
When automating flows like Instagram login with Chrome-based TOTP 2FA, the 6-digit code rotates every 30 seconds. If the code expires mid-step, the step fails. With
retries: 4, we get ~5 attempts to hit a valid window, making success highly likely.Usage
{ "app": "com.android.chrome", "goal": "Copy TOTP code from Chrome, switch to Instagram, paste and submit", "maxSteps": 15, "retries": 4 }Steps without
retriesbehave exactly as before (single attempt, fail immediately on error).Test plan
retriesfield work identically to current behaviorretries: Nretries up to N times on failureworkflow_step_retrydashboard events are emitted with correct attempt/maxRetries🤖 Generated with Claude Code