Skip to content

fix: expose step-level retries typing in workflow chains#945

Merged
omeraplak merged 1 commit into
mainfrom
fix/and-then-retries
Jan 15, 2026
Merged

fix: expose step-level retries typing in workflow chains#945
omeraplak merged 1 commit into
mainfrom
fix/and-then-retries

Conversation

@omeraplak
Copy link
Copy Markdown
Member

@omeraplak omeraplak commented Jan 15, 2026

PR Checklist

Please check if your PR fulfills the following requirements:

Bugs / Features

What is the current behavior?

What is the new behavior?

fixes (issue)

Notes for reviewers


Summary by cubic

Exposed step-level retries in TypeScript for workflow chains. andThen/andTap now type retryCount in the execute context and retries in step config, matching runtime behavior.

  • Bug Fixes
    • Added retryCount?: number to the execute context for andThen/andTap.
    • Added retries?: number to step definitions.
    • Updated WorkflowChain overloads to propagate these types; no runtime changes.

Written for commit 03cad16. Summary will update on new commits.

Summary by CodeRabbit

  • New Features
    • Added step-level retry configuration to workflow chains. Developers can now specify retry behavior for individual workflow steps using the new retries and retryCount properties. Retry functionality is available across all step types, enabling more resilient and flexible workflow definitions.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 15, 2026

🦋 Changeset detected

Latest commit: 03cad16

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@voltagent/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 15, 2026

📝 Walkthrough

Walkthrough

Type definitions for workflow chain steps are enhanced to include retries and retryCount properties. Updates span step interfaces and execution context signatures in AndThenStep, AndTapStep, and related method overloads, with a corresponding changeset documenting the modifications.

Changes

Cohort / File(s) Summary
Retry typing enhancements
.changeset/stupid-pens-create.md
Added changeset documentation describing the introduction of retry-level typing to workflow chains, including step type definition changes and usage examples.
Workflow chain type updates
packages/core/src/workflow/chain.ts
Extended method overloads for andThen, andTap, and related step-building methods to include retryCount?: number in execution contexts and retries?: number in public step descriptors.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 Hops of joy through retry chains,
Types now catch what once was plain,
Count and retry, hand in paw,
Workflow steps without a flaw! 🔄✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description lacks concrete details for required sections (current behavior, new behavior, issue reference) despite the auto-generated summary providing helpful context about the changes. Fill in 'What is the current behavior?', 'What is the new behavior?', and link the related issue to complete the required template sections.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: exposing step-level retries typing in workflow chains, which matches the file modifications adding retries and retryCount properties.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c992dac and 03cad16.

📒 Files selected for processing (2)
  • .changeset/stupid-pens-create.md
  • packages/core/src/workflow/chain.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

**/*.ts: Maintain type safety in TypeScript-first codebase
Never use JSON.stringify; use the safeStringify function instead, imported from @voltagent/internal

Files:

  • packages/core/src/workflow/chain.ts
🧬 Code graph analysis (1)
packages/core/src/workflow/chain.ts (1)
packages/core/src/workflow/types.ts (1)
  • WorkflowStreamWriter (801-820)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Test core
  • GitHub Check: Test cli
  • GitHub Check: Build (Node 22)
  • GitHub Check: Build (Node 24)
  • GitHub Check: Build (Node 20)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (8)
.changeset/stupid-pens-create.md (1)

1-29: LGTM!

The changeset clearly documents the typing fix and provides a useful code example demonstrating both retries configuration and retryCount access within the execution context.

packages/core/src/workflow/chain.ts (7)

220-227: LGTM - Retry typing consistently added to andThen overload.

The retryCount in the execution context and retries in step config are correctly typed as optional numbers.


254-261: Consistent typing across overload.


287-294: Consistent typing across overload.


320-327: Consistent typing across overload.


362-369: Consistent typing across overload.


506-513: Consistent typing for andTap with inputSchema.


547-554: Consistent typing for basic andTap.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@joggrbot

This comment has been minimized.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/core/src/workflow/chain.ts (1)

389-423: Add retries config property and retryCount context to andWhen overloads for consistency.

The andWhen overloads should expose retry typing like andThen and andTap. While the runtime supports step-level retries for conditional steps (inherited from InternalWorkflowStepConfig), the type signatures don't make this visible. Add retries?: number to the config and include retryCount?: number in the condition context to match the explicit retry support in other step types.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c992dac and 03cad16.

📒 Files selected for processing (2)
  • .changeset/stupid-pens-create.md
  • packages/core/src/workflow/chain.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

**/*.ts: Maintain type safety in TypeScript-first codebase
Never use JSON.stringify; use the safeStringify function instead, imported from @voltagent/internal

Files:

  • packages/core/src/workflow/chain.ts
🧬 Code graph analysis (1)
packages/core/src/workflow/chain.ts (1)
packages/core/src/workflow/types.ts (1)
  • WorkflowStreamWriter (801-820)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Test core
  • GitHub Check: Test cli
  • GitHub Check: Build (Node 22)
  • GitHub Check: Build (Node 24)
  • GitHub Check: Build (Node 20)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (8)
.changeset/stupid-pens-create.md (1)

1-29: LGTM!

The changeset clearly documents the typing fix and provides a useful code example demonstrating both retries configuration and retryCount access within the execution context.

packages/core/src/workflow/chain.ts (7)

220-227: LGTM - Retry typing consistently added to andThen overload.

The retryCount in the execution context and retries in step config are correctly typed as optional numbers.


254-261: Consistent typing across overload.


287-294: Consistent typing across overload.


320-327: Consistent typing across overload.


362-369: Consistent typing across overload.


506-513: Consistent typing for andTap with inputSchema.


547-554: Consistent typing for basic andTap.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying voltagent with  Cloudflare Pages  Cloudflare Pages

Latest commit: 03cad16
Status: ✅  Deploy successful!
Preview URL: https://9a1bf7d6.voltagent.pages.dev
Branch Preview URL: https://fix-and-then-retries.voltagent.pages.dev

View logs

@omeraplak omeraplak merged commit ac9ef8d into main Jan 15, 2026
23 checks passed
@omeraplak omeraplak deleted the fix/and-then-retries branch January 15, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants