Skip to main content

Crate stepflow_client

Crate stepflow_client 

Source
Expand description

§stepflow-client

Rust client SDK for the Stepflow orchestrator.

Provides two main capabilities:

§Example: store and run a flow

use stepflow_client::{StepflowClient, FlowBuilder, ValueExpr};

let mut client = StepflowClient::connect("http://localhost:7840").await?;

let mut builder = FlowBuilder::new();
builder.add_step(
    "process",
    "/python/my_func",
    ValueExpr::object(vec![("data".to_string(), ValueExpr::workflow_input(Default::default()))]),
);
let flow = builder
    .output(ValueExpr::step_output("process"))
    .build()?;

let flow_id = client.store_flow(&flow).await?;
let output = client.run(&flow_id, serde_json::json!({"key": "value"})).await?;
println!("{output}");

Re-exports§

pub use client::ComponentInfo;
pub use client::FlowVariable;
pub use client::ListComponentsResult;
pub use client::RunStatus;
pub use client::StatusEventStream;
pub use client::StepflowClient;
pub use error::BuilderError;
pub use error::ClientError;
pub use flow::FlowBuilder;
pub use stepflow_flow;

Modules§

client
High-level gRPC client for the Stepflow orchestrator.
error
flow
Flow definition types and programmatic builder API.

Structs§

Flow
A workflow consisting of a sequence of steps and their outputs.
StatusEvent
A status event from the execution journal.
Step
A step in a workflow that executes a component with specific arguments.

Enums§

ValueExpr
A value expression that can contain literal data or references to other values.