Skip to content

Improve workflow API ergonomics in Rust API #6014

Description

@emesare

Specifically want this for the rust api.

Right now workflows are in two states: registered (immutable) and unregistered (mutable).

The distinction itself is hidden in the type system making it very easy for a user to mistake an API meant for unregistered workflows for one they can use on a registered workflow.

Adding a WorkflowBuilder or something that acts as a mutable workflow would allow us to use the type system to enforce correct behavior.

Activity

  1. self-assigned this
    on Oct 19, 2024
  2. assigned and unassigned on Aug 11, 2025
  3. emesare commented on Aug 11, 2025

    @emesare
    MemberAuthor

    This is probably best completed with the PR above, further work could be done to make a proper workflow builder api (something like Workflow::builder().with_activity blah blah blah) but the bulk of the issue is primarily around the the activity configuration in practice.

  4. changed the title [-]rust: Workflow builder api[/-] [+]Improve workflow API ergonomics in Rust API[/+] on Aug 11, 2025
  5. bdash commented on Aug 12, 2025

    @bdash
    Contributor

    #7254 now also adds a WorkflowBuilder type and moves all of Workflows methods over to it. You end up with something like:

    Workflow::cloned("core.module.metaAnalysis")
        .ok_or(())?
        .activity_before(&activity, "core.module.finishUpdate")?
        .register()?;
  6. added this to the Io milestone on Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Component: Rust APIIssue needs changes to the Rust APIEffort: MediumIssues require < 1 month of workImpact: MediumIssue is impactful with a bad, or no, workaround

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions