Skip to main content
Version: 2.x

Migrate from Rust SDK 4 to 5

Update durable-workflow to major version 5. Replace SDK-facing chrono::DateTime<chrono::Utc> with durable_workflow::jiff::Timestamp. The re-export uses the same Jiff version as the SDK.

APIVersion 5 type
WorkflowContext::replay_now(), QueryContext::replay_now()Result<Timestamp>
ActivityHeartbeatCheckpoint::acknowledged_at()&Timestamp
ActivityContext::last_heartbeat_at()Result<Option<&Timestamp>, ActivityHeartbeatResumeUnavailable>
CancellationContext::requested_at(), deadline()Timestamp
ScopedCancellationLineage::deadline()Timestamp
ScopedCancellationContext::requested_at(), root_deadline(), deadline()Timestamp
CancellationScopeDeliveryBudget::restrict(deadline)Timestamp argument
CancellationScopeDeliveryReceipt::authority_deadline()Timestamp

Use later.duration_since(earlier) to get a jiff::SignedDuration. Use format!("{timestamp:.6}") for UTC output with six fractional digits.

The SDK reads a recorded leap second as the following second, so 2016-12-31T23:59:60.5Z becomes 2017-01-01T00:00:00.5Z. Instants after 9999-12-30T22:00:00.999999999Z are out of range.

The default text form changes from 2026-11-18 09:15:42.123400 UTC to 2026-11-18T09:15:42.1234Z. If workflow code formats or serializes replay_now() into durable values, choose an explicit format and verify its bytes against recorded histories before replacing workers.

For canonical Server timestamps (YYYY-MM-DDTHH:MM:SS.ffffffZ), text.parse::<Timestamp>() gives the same instant as the SDK. Leap seconds and non-canonical spellings can differ. Jiff reads :60 as :59 and also accepts short offsets such as +05, comma fractions such as ,5, times without seconds, and bracketed zone annotations. Jiff rejects more than nine fractional digits and the Unicode minus sign U+2212 in offsets. The SDK wire parser accepts both.

Remove chrono from your manifest if your application only used it for these SDK APIs.