Skip to content
AnswerWell geo Documentation

Research · 5 min read · Answerwell

Workflow Instance Retention and Instance Status Restart

What changed in Workflow instance_retention typing, InstanceRetention fields, and the restart value for StatusEditParams.status in the Cloudflare SDK.

Cloudflare’s developer changelog and the Cloudflare TypeScript SDK v6.0.0-beta.1 release notes document two related Workflows updates: instance_retention is now a typed InstanceRetention object, and workflow instance status edits can use a new restart value on StatusEditParams.status. The same Workflows notes appear across product-group and SDK changelog indexes, so this page pulls that guidance together for anyone upgrading bindings or generated API types.

Workflows changelog: what changed in the API surface

Section titled “Workflows changelog: what changed in the API surface”

Workflow-related changelog entries under Workflows repeat the same pair of changes. They affect how retention is modeled in the TypeScript SDK and which status values you may pass when editing a workflow instance.

instance_retention: unknown → typed InstanceRetention interface with error_retention, success_retention
New status option: ‘restart’ added to StatusEditParams.status

— Cloudflare, Cloudflare TypeScript SDK v6.0.0-beta.1 now available

The core platform changelog group, developer platform group, SDK product changelog, and main changelog feed carry the same Workflows text, which signals a coordinated documentation and SDK update rather than a one-off note on a single page.

instance_retention: from unknown to InstanceRetention

Section titled “instance_retention: from unknown to InstanceRetention”

Why the instance_retention type change matters for TypeScript projects

Section titled “Why the instance_retention type change matters for TypeScript projects”

Previously, instance_retention was typed as unknown in generated or hand-maintained client types. That forces casts, loose checks, or suppressed type errors whenever you configure how long workflow instances are kept after they finish. The changelog states that instance_retention is now a typed InstanceRetention interface with two named fields: error_retention and success_retention.

In plain terms: retention is no longer an opaque blob in the type system; the SDK expects a structured object that distinguishes failed runs from successful ones. The cluster does not spell out units, defaults, or API request shapes beyond those field names—treat operational limits as defined in the full Workflows API reference you use in production, and rely on the changelog plus SDK upgrade for the type contract.

error_retention and success_retention on InstanceRetention

Section titled “error_retention and success_retention on InstanceRetention”

The changelog names error_retention and success_retention as members of InstanceRetention. Without additional documentation in this cluster, the safe reading is:

  • success_retention — retention settings that apply when a workflow instance completes successfully.
  • error_retention — retention settings that apply when a workflow instance ends in an error state.

When you migrate, replace any code that treated instance_retention as arbitrary JSON or unknown with an object that satisfies InstanceRetention and sets both properties explicitly where your deployment policy requires it.

StatusEditParams.status: the restart option

Section titled “StatusEditParams.status: the restart option”

When to use restart on workflow instance status edits

Section titled “When to use restart on workflow instance status edits”

The second change adds 'restart' as a status option on StatusEditParams.status. That extends the set of values you can send when editing a workflow instance’s status through the API surface reflected in the SDK.

People usually look this up when automations need to re-run or recover a workflow instance without creating a brand-new logical instance from scratch— for example, after fixing upstream data or redeploying a Worker that the workflow calls. The changelog confirms the enum (or union) gain; it does not describe idempotency, side effects, or which instance states allow restart. Plan to confirm those rules in your operational runbooks and any fuller Status Edit API documentation outside this cluster.

New status option: ‘restart’ added to StatusEditParams.status

— Cloudflare, Changelog — SDK

If you generate API clients from Cloudflare’s TypeScript SDK, a missing restart literal at compile time is a signal you are still on pre-v6 typings.

TypeScript SDK v6.0.0-beta.1 and Workflows typings

Section titled “TypeScript SDK v6.0.0-beta.1 and Workflows typings”

How the beta SDK release relates to changelog indexes

Section titled “How the beta SDK release relates to changelog indexes”

The dedicated post Cloudflare TypeScript SDK v6.0.0-beta.1 now available lists Workflows changes in the same wording as the aggregated changelogs (fundamentals product changelog, docs collections group). For application teams, the practical sequence is: read the beta release post for intent, align package version to 6.0.0-beta.1 (or whatever you standardize on from that announcement), then let TypeScript surface the new InstanceRetention shape and the expanded StatusEditParams.status including restart.

Common mistakes when adopting these changelog changes

Section titled “Common mistakes when adopting these changelog changes”
  • Assuming instance_retention is still unknown after upgrading only the Workers runtime but not the Cloudflare TypeScript SDK—types come from the SDK, not from changelog HTML.
  • Setting only one of error_retention or success_retention and leaving the other implicit; the interface exposes both fields, so partial objects may fail type-checking or not match server expectations until you align with your API client version.
  • Sending restart from an older client that was generated before StatusEditParams.status included it; the API may reject unknown enum values depending on server validation.
  • Treating beta SDK types as stable across minor beta bumps; re-run type-checks when the changelog or SDK post updates.
  1. Open the Cloudflare TypeScript SDK v6.0.0-beta.1 post and confirm the Workflows section lists InstanceRetention and StatusEditParams.status with restart.

  2. Cross-check the same Workflows bullets on the SDK product changelog or developer platform changelog group so your internal runbooks match the published wording.

  3. Upgrade your project’s Cloudflare TypeScript SDK to the version referenced in that beta announcement and run your type checker; instance_retention should no longer be unknown, and restart should appear where StatusEditParams.status is defined.

  4. In a staging environment, exercise a status edit that uses restart and a configuration object that sets both error_retention and success_retention, and confirm the API accepts the payloads your types allow.

  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page does not match the current Cloudflare changelog or your SDK version, email yimasynthetic@gmail.com with the page URL and the exact sentence you believe is wrong, and we will correct or clarify it.