Skip to content

Releases: temporalio/sdk-core

v0.2.0

19 Mar 15:47
e49359b

Choose a tag to compare

v0.2.0 Pre-release
Pre-release

⚠️ THIS IS AN EARLY RELEASE AND COMPATIBILITY WILL NOT BE MAINTAINED

Features

Schedule Handles

The Rust SDK now includes full support for Temporal Schedules, allowing you to create, describe, update, pause, trigger, and delete schedules from the client.

use temporalio_client::{Client, CreateScheduleOptions, ScheduleAction, ScheduleSpec};
use std::time::Duration;

// Create a schedule that starts a workflow every hour
let handle = client
    .create_schedule(
        "my-schedule-id",
        CreateScheduleOptions::builder()
            .action(ScheduleAction::start_workflow("MyWorkflow", "my-task-queue", "wf-id"))
            .spec(ScheduleSpec::from_interval(Duration::from_secs(3600)))
            .build(),
    )
    .await?;

// Interact with the schedule
let desc = handle.describe().await?;
handle.pause(Some("maintenance window")).await?;
handle.unpause(Some("back online")).await?;
handle.delete().await?;

#1132

Workflow Context Additions

The workflow context now exposes additional runtime information:

  • continue_as_new_suggested(): if the server suggests the workflow should continue-as-new (e.g. due to history size)
  • workflow_id() and run_id(): access the current workflow's identity directly from the context
#[run]
async fn run(ctx: &mut WorkflowContext<Self>) -> WorkflowResult<()> {
    let wf_id = ctx.workflow_id();
    let run_id = ctx.run_id();

    // Check if we should continue-as-new
    if ctx.continue_as_new_suggested() {
        return ctx.continue_as_new(/* ... */);
    }
}

#1126 and #1131

Deterministic Future Helpers

Workflow code must be deterministic. Standard concurrency primitives like tokio::select! or futures::select! introduce nondeterministic polling order that will break workflow replay. The SDK now provides deterministic wrappers in temporalio_sdk::workflows that are safe to use in workflow code: temporalio_sdk::workflows::select!, temporalio_sdk::workflows::join!, and temporalio_sdk::workflows::join_all().

PR #1133

Dependency Cleanup

The Rust SDK originated as the shared core powering Temporal's language SDKs (Python, TypeScript, .NET, etc.), and as a result it carries dependencies that not all users need. We are actively trimming this down using Cargo features so you only pay for what you use. This is ongoing work, but we appreciate contributions from the community that start this process:

  • Removal of unused protobuf dependency from optional prometheus dependency in temporalio_common: #1134 by @maltere
  • Removal of otel as default feature for temporalio_common and temporalio_sdk_core: #1154 by @sachinsharma3191

Bug Fixes

  • fix(sdk): provide default worker identity (#1123)
  • Return ClientWorkerSet from Connection (#1147)
  • Fix possible NDE in valid child workflow cancel transition by (#1162)
  • fix(client): retry WorkflowUpdateHandle::get_result poll (#1150)
  • fix(core): avoid panic if workflow stream still up during eviction (#1158)
  • no longer cancel pending polls on shutdown (#1122)

Full Changelog: v0.1.0-alpha.1...v0.2.0

v0.1.0-alpha.1

19 Feb 21:34
a0caec4

Choose a tag to compare

v0.1.0-alpha.1 Pre-release
Pre-release

⚠️ THIS IS AN EARLY RELEASE AND COMPATIBILITY WILL NOT BE MAINTAINED

This is the initial release of the Temporal Rust SDK

This release includes

  • Client support
  • Activity and Workflow Worker support

This release does not support

  • Schedules
  • Eager Workflow Start
  • Update with Start
  • Dynamic Handlers