| Crates.io | runtara-workflow-stdlib |
| lib.rs | runtara-workflow-stdlib |
| version | 1.4.1 |
| created_at | 2025-12-17 15:19:39.630778+00 |
| updated_at | 2026-01-10 20:19:25.306752+00 |
| description | Standard library for runtara workflow binaries - combines agents and runtime |
| homepage | |
| repository | https://github.com/runtara/runtara |
| max_upload_size | |
| id | 1990517 |
| size | 99,755 |
Standard library for Runtara compiled workflow binaries. Combines the SDK runtime with built-in agents for complete workflow execution.
This crate is automatically linked into workflows compiled by runtara-workflows. It provides:
runtara-sdk for checkpointing and signalsruntara-agents for HTTP, SFTP, CSV, XML, etc.This crate is typically not used directly. Instead, it's linked into compiled workflows by runtara-workflows.
For custom stdlib development:
[dependencies]
runtara-workflow-stdlib = "1.0"
| Module | Source | Description |
|---|---|---|
sdk |
runtara-sdk |
Checkpointing, signals, durability |
agents |
runtara-agents |
HTTP, SFTP, CSV, XML, Transform agents |
serde |
serde |
Serialization framework |
serde_json |
serde_json |
JSON serialization |
Products can extend the standard library with custom agents:
// my-product-stdlib/src/lib.rs
// Re-export everything from the base stdlib
pub use runtara_workflow_stdlib::*;
// Add your custom agents
pub mod my_agents {
use runtara_agent_macro::agent;
use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize)]
pub struct MyInput {
pub value: String,
}
#[derive(Serialize, Deserialize)]
pub struct MyOutput {
pub result: String,
}
#[agent(id = "my-custom-agent", category = "custom")]
pub mod my_custom_agent {
use super::*;
#[capability(id = "process", description = "Custom processing")]
pub async fn process(input: MyInput) -> Result<MyOutput, Box<dyn std::error::Error>> {
Ok(MyOutput {
result: format!("Processed: {}", input.value),
})
}
}
}
[package]
name = "my-product-stdlib"
version = "1.0.0"
[lib]
crate-type = ["rlib"]
[dependencies]
runtara-workflow-stdlib = "1.0"
runtara-agent-macro = "1.0"
serde = { version = "1.0", features = ["derive"] }
cargo build --release
# Output: target/release/libmy_product_stdlib.rlib
export RUNTARA_NATIVE_LIBRARY_DIR=/path/to/native_cache
export RUNTARA_STDLIB_NAME=my_product_stdlib
{
"steps": {
"custom": {
"stepType": "Agent",
"id": "custom",
"agentId": "my-custom-agent",
"capabilityId": "process",
"inputMapping": {
"value": { "valueType": "reference", "value": "data.input" }
}
}
}
}
Compiled workflows fetch credentials at runtime:
use runtara_workflow_stdlib::fetch_connection;
// Fetch connection configuration from product's connection service
let connection = fetch_connection(
"https://my-product.com/api/connections",
"tenant-123",
"my-sftp-connection",
).await?;
// Use connection config with agents
let sftp_config = connection.get("sftp").unwrap();
The workflow compiler generates code that uses stdlib exports:
// Generated workflow code (simplified)
use runtara_workflow_stdlib::{
sdk::{RuntaraSdk, CheckpointResult},
agents::{http, transform},
serde_json,
};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut sdk = RuntaraSdk::from_env()?;
sdk.connect().await?;
sdk.register(None).await?;
// Step: fetch
let result = sdk.checkpoint("fetch", &[]).await?;
if result.existing_state().is_none() {
let output = http::request(http::RequestInput {
url: "https://api.example.com".to_string(),
..Default::default()
}).await?;
// Save checkpoint with output...
}
sdk.completed(&output_bytes).await?;
Ok(())
}
runtara-sdk - Core SDK (re-exported)runtara-agents - Built-in agents (re-exported)runtara-workflows - Compiles scenarios using this stdlibThis project is licensed under AGPL-3.0-or-later.