Rust SDK for Conductor
Build agents, workflows, and workers in Rust with Conductor.
See the agent quickstart or workflow quickstart. Conductor Skills helps coding agents work with Conductor.
Choose your Conductor server
Use a hosted or local Conductor server for the examples below.
Recommended: Orkes Developer Edition
In Orkes Developer Edition, create an application and access key, then set:
export CONDUCTOR_SERVER_URL=https://developer.orkescloud.com/api
export CONDUCTOR_AUTH_KEY=<your-key-id>
export CONDUCTOR_AUTH_SECRET=<your-key-secret>
For another remote cluster, use its /api URL and credentials.
Local: Conductor CLI
npm install -g @conductor-oss/conductor-cli
conductor server start
conductor server status
export CONDUCTOR_SERVER_URL=http://localhost:8080/api
Local: Docker Compose
docker compose -f scripts/docker-compose-oss.yaml up -d
export CONDUCTOR_SERVER_URL=http://localhost:8080/api
The Compose server UI is at http://localhost:8080.
Requires Rust 1.85 or newer and a reachable Conductor server. See CI for tested server versions.
Install the SDK
Add the following to your Cargo.toml:
[]
# The crate is published as `conductor-sdk`; rename it to `conductor` so
# `use conductor::...` works in your code.
= { = "0.2.0", = "conductor-sdk" }
= { = "1", = ["full"] }
For the #[worker] macro (similar to Python's @worker_task decorator):
[]
= { = "0.2.0", = "conductor-sdk", = ["macros"] }
= "0.2.0"
= { = "1", = ["full"] }
For agents, enable agents:
= { = "0.2.0", = "conductor-sdk", = ["agents"] }
= { = "1", = ["full"] }
The agents feature includes worker macros.
Agent quickstart
Configure a provider and model on your Conductor server. Create a project and add the agents dependencies above to its Cargo.toml:
cargo new conductor-agent-demo
cd conductor-agent-demo
Put this in src/main.rs:
use ;
use Configuration;
use ;
async
Run with a model configured on your server:
cargo run -- openai/gpt-4o-mini
The checked-in example uses the same code.
Expect status: COMPLETED, model output, and an execution ID.
See the agent guide and examples for more.
60-Second Quickstart
Step 1: Create a workflow
Workflows are definitions that reference task types (e.g. a SIMPLE task called greet). We'll build a workflow called
greetings that runs one task and returns its output.
use ;
Step 2: Write worker
Workers are Rust functions decorated with #[worker] that poll Conductor for tasks and execute them.
use worker;
async
Step 3: Run your first workflow app
Create a Cargo project, add the macro dependencies above to its Cargo.toml, then put the following in src/main.rs:
cargo new greetings
cd greetings
use ;
use worker;
// A worker is any Rust function with the #[worker] macro.
async
async
Run it:
cargo run
Using Orkes Conductor / Remote Server?
Export your authentication credentials as well:
export CONDUCTOR_SERVER_URL="https://your-cluster.orkesconductor.io/api" # If using Orkes Conductor that requires auth key/secret export CONDUCTOR_AUTH_KEY="your-key" export CONDUCTOR_AUTH_SECRET="your-secret"See Choose your Conductor server for setup details.
That's it -- you just defined a worker, built a workflow, and executed it. Open the Conductor UI (default: http://localhost:8080) to see the execution.
Comprehensive worker example
The example includes sync + async workers, metrics, and long-running tasks.
See examples/worker_example.rs
Workers
Workers are Rust functions that execute Conductor tasks. Use the #[worker] macro or FnWorker to:
- register it as a worker (auto-discovered by
TaskHandler) - use it as a workflow task (call it with
task_ref_name=...)
Workers can also serve as agent tools. See Conductor agents.
use worker;
async
Using FnWorker (closure-based):
use ;
let greetings_worker = new
.with_thread_count
.with_poll_interval_millis;
Start workers with TaskHandler:
use ;
let config = default;
let mut task_handler = new?;
task_handler.add_worker;
task_handler.start.await?;
// Wait for shutdown signal
ctrl_c.await?;
task_handler.stop.await?;
Worker Configuration
Workers support hierarchical environment variable configuration — global settings that can be overridden per worker:
# Global (all workers)
export CONDUCTOR_WORKER_ALL_POLL_INTERVAL_MILLIS=250
export CONDUCTOR_WORKER_ALL_THREAD_COUNT=20
export CONDUCTOR_WORKER_ALL_DOMAIN=production
# Per-worker override
export CONDUCTOR_WORKER_GREETINGS_THREAD_COUNT=50
See WORKER_CONFIGURATION.md for all options.
Monitoring Workers
Enable Prometheus metrics:
use MetricsSettings;
use TaskHandler;
let mut task_handler = new?;
task_handler.enable_metrics;
task_handler.start.await?;
// Metrics at http://localhost:9090/metrics
See METRICS.md for details.
Learn more:
- Worker Guide — All worker patterns (function, closure, macro, async)
- Worker Configuration — Environment variable configuration system
Workflows
Define workflows in Rust using the builder pattern to chain tasks:
use ;
let config = default;
let client = new?;
let metadata_client = client.metadata_client;
let workflow = new
.with_version
.with_task
.with_output_param;
// Registering is required if you want to start/execute by name+version
metadata_client.register_or_update_workflow_def.await?;
Execute workflows:
use StartWorkflowRequest;
use Duration;
// Asynchronous (returns workflow ID immediately)
let request = new
.with_version
.with_input_value;
let workflow_id = workflow_client.start_workflow.await?;
// Synchronous (waits for completion)
let run = workflow_client
.execute_workflow
.await?;
println!;
Manage running workflows and send signals:
workflow_client.pause_workflow.await?;
workflow_client.resume_workflow.await?;
workflow_client.terminate_workflow.await?;
workflow_client.retry_workflow.await?;
workflow_client.restart_workflow.await?;
Learn more:
- Workflow Management — Start, pause, resume, terminate, retry, search
- Workflow Testing — Example using mock task outputs
- Metadata Management — Task & workflow definitions
Troubleshooting
- Worker stops polling:
TaskHandlermonitors workers. Usetask_handler.is_healthy()for health checks. - Connection issues: Verify
CONDUCTOR_SERVER_URLis correct and server is running. - Authentication failures: For Orkes Conductor, ensure
CONDUCTOR_AUTH_KEYandCONDUCTOR_AUTH_SECRETare valid. - Agent cannot call a model: Check the provider and model configured on the Conductor server.
Conductor agents
The agents feature supports local tools, human approval, guardrails, and multi-agent runs.
Configure a model on your Conductor server, then try:
| Example | Shows |
|---|---|
| Simple tools | Rust function tools |
| Human approval | Terminal approval for a tool call |
| Parallel agents | Multi-agent execution |
cargo run --example agent_demo_02a_simple_tools --features agents -- openai/gpt-4o-mini
See the agent guide and full example list. For LLM and RAG workflows built with the core SDK, see llm_chat_example.rs and rag_workflow.rs.
Examples
See the examples directory for the full catalog. Key examples:
| Example | Description | Run |
|---|---|---|
| worker_example.rs | End-to-end: sync + async workers, metrics | cargo run --example worker_example |
| hello_world.rs | Minimal hello world | cargo run --example hello_world |
| dynamic_workflow.rs | Build workflows programmatically | cargo run --example dynamic_workflow |
| llm_chat_example.rs | AI multi-turn chat | cargo run --example llm_chat_example |
| rag_workflow.rs | RAG pipeline | cargo run --example rag_workflow |
| task_context_example.rs | Long-running tasks with TaskContext | cargo run --example task_context_example |
| workflow_ops.rs | Pause, resume, terminate workflows | cargo run --example workflow_ops |
| test_workflows.rs | Unit testing workflows | cargo run --example test_workflows |
| kitchensink.rs | All task types (HTTP, JS, JQ, Switch) | cargo run --example kitchensink |
API Journey Examples
End-to-end examples covering all APIs for each domain:
| Example | APIs | Run |
|---|---|---|
| authorization_example.rs | Authorization APIs | cargo run --example authorization_example |
| metadata_journey.rs | Metadata APIs | cargo run --example metadata_journey |
| schedule_journey.rs | Schedule APIs | cargo run --example schedule_journey |
| prompt_journey.rs | Prompt APIs | cargo run --example prompt_journey |
Documentation
| Document | Description |
|---|---|
| Worker Guide | All worker patterns (function, closure, macro, async) |
| Agent Guide | Durable agents, tools, and runtime modes |
| Worker Configuration | Hierarchical environment variable configuration |
| Workflow Management | Start, pause, resume, terminate, retry, search |
| Workflow Testing | Example using mock task outputs |
| Task Management | Task operations |
| Metadata | Task & workflow definitions |
| Authorization | Users, groups, applications, permissions |
| Schedules | Workflow scheduling |
| Secrets | Secret storage |
| Prompts | AI/LLM prompt templates |
| Integrations | AI/LLM provider integrations |
| Metrics | Prometheus metrics collection |
Support
- Open an issue (SDK) for SDK bugs, questions, and feature requests
- Open an issue (Conductor server) for Conductor OSS server issues
- Join the Conductor Slack for community discussion and help
- Orkes Community Forum for Q&A
- Conductor OSS contribution guide for contributing upstream
- Conductor Code of Conduct and security policy for community and private vulnerability reporting
Frequently Asked Questions
Is this the same as Netflix Conductor?
Yes. Conductor OSS is the continuation of the original Netflix Conductor repository after Netflix contributed the project to the open-source foundation.
Is this project actively maintained?
Yes. Orkes is the primary maintainer and offers an enterprise SaaS platform for Conductor across all major cloud providers.
Can Conductor scale to handle my workload?
Conductor was built at Netflix to handle massive scale and has been battle-tested in production environments processing millions of workflows. It scales horizontally to meet virtually any demand.
Does Conductor support durable code execution?
Yes. Conductor ensures workflows complete reliably even in the face of infrastructure failures, process crashes, or network issues.
Are workflows always asynchronous?
No. While Conductor excels at asynchronous orchestration, it also supports synchronous workflow execution when immediate results are required.
Do I need to use a Conductor-specific framework?
No. Conductor is language and framework agnostic. Use your preferred language and framework -- the SDKs provide native integration for Python, Java, JavaScript, Go, C#, Rust, and more.
Can I mix workers written in different languages?
Yes. A single workflow can have workers written in Rust, Python, Java, Go, or any other supported language. Workers communicate through the Conductor server, not directly with each other.
What Rust versions are supported?
Rust 1.85 and above (2021 edition), as declared in Cargo.toml.
Should I use async fn or regular fn for my workers?
Use async fn for I/O-bound tasks (API calls, database queries) — the SDK uses async runtime for high concurrency with low overhead. Use regular functions for CPU-bound or blocking work. The SDK handles both patterns efficiently.
How do I run workers in production?
Workers are standard Rust applications. Deploy them as you would any Rust application -- in containers, VMs, or bare metal. Workers poll the Conductor server for tasks, so no inbound ports need to be opened.
How do I test workflows with mock task outputs?
Conductor's POST /api/workflow/test endpoint evaluates workflows with mock task outputs. See the workflow testing example. This endpoint still requires a running Conductor server.
License
Apache 2.0