Skip to main content

IronflowClient

Struct IronflowClient 

Source
pub struct IronflowClient { /* private fields */ }
Expand description

Type-safe client for the Ironflow REST API.

Handles Bearer authentication, the { data, meta } response envelope, and provides methods for all public API endpoints.

§Examples

use ironflow_sdk::IronflowClient;

let client = IronflowClient::new("https://ironflow.example.com", "my-api-key");

// List runs
let runs = client.list_runs().await?;
for run in &runs.data {
}

// Get a specific workflow
let wf = client.get_workflow("deploy").await?;

Implementations§

Source§

impl IronflowClient

Source

pub async fn download_artifact( &self, run_id: Uuid, step_name: &str, artifact_name: &str, ) -> Result<ArtifactDownload, Error>

Download an artifact by step name.

Resolves step_name to a step ID via get_run, then downloads the artifact. The SHA-256 digest is taken from the step’s artifact metadata (no extra round-trip for the hash).

Use download_artifact_by_step_id to skip the run detail lookup when you already have the step ID.

§Errors

Returns Error::Api on 404 (run, step or artifact not found) or 401. Returns Error::Deserialize if no step matches step_name.

§Examples
use ironflow_sdk::IronflowClient;
use uuid::Uuid;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let run_id = Uuid::nil();
let artifact = client.download_artifact(run_id, "build", "report.html").await?;
let _ = artifact.content_type;
Source

pub async fn download_artifact_by_step_id( &self, run_id: Uuid, step_id: Uuid, artifact_name: &str, ) -> Result<ArtifactDownload, Error>

Download an artifact by step ID (no extra round-trip).

Calls GET /api/v1/runs/{run_id}/steps/{step_id}/artifacts/{name} and returns the raw bytes with content type.

The SHA-256 field is empty because the download route does not include it. Use download_artifact (by step name) to get the digest from the step metadata.

§Errors

Returns Error::Api on 404 (run, step or artifact not found), 401 or 501 (artifact storage not configured).

§Examples
use ironflow_sdk::IronflowClient;
use uuid::Uuid;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let run_id = Uuid::nil();
let step_id = Uuid::nil();
let artifact = client
    .download_artifact_by_step_id(run_id, step_id, "report.html")
    .await?;
let _ = artifact.content_type;
Source§

impl IronflowClient

Source

pub async fn change_password( &self, old_password: &str, new_password: &str, ) -> Result<(), Error>

Change the current user’s password.

§Errors

Returns an error if the HTTP request fails or the old password is incorrect.

§Examples
use ironflow_sdk::IronflowClient;

let client = IronflowClient::new("https://ironflow.example.com", "key");
client.change_password("old_pass", "new_pass").await?;
Source§

impl IronflowClient

Source

pub fn new(base_url: &str, api_key: &str) -> Self

Create a new client with the given base URL and API key.

Uses a default timeout of 30 seconds.

§Panics

Panics if api_key contains characters invalid for HTTP headers (e.g. newlines, NUL bytes, or non-visible ASCII).

§Examples
use ironflow_sdk::IronflowClient;

let client = IronflowClient::new("https://ironflow.example.com", "my-api-key");
Source

pub fn from_config(config: ClientConfig) -> Self

Create a new client from a ClientConfig.

§Panics

Panics if config.api_key contains characters invalid for HTTP headers (e.g. newlines, NUL bytes, or non-visible ASCII).

§Examples
use ironflow_sdk::IronflowClient;
use ironflow_sdk::client::ClientConfig;
use std::time::Duration;

let config = ClientConfig {
    base_url: "https://ironflow.example.com".to_string(),
    api_key: "my-api-key".to_string(),
    timeout: Duration::from_secs(60),
};
let client = IronflowClient::from_config(config);
Source

pub fn from_config_with_retry( config: ClientConfig, retry_config: RetryConfig, rate_limiter: RateLimiter, ) -> Self

Create a new client with custom retry and rate-limit settings.

Prefer ClientBuilder for a more ergonomic interface.

§Panics

Panics if config.api_key contains characters invalid for HTTP headers.

Source

pub fn base_url(&self) -> &str

Return the base URL.

Source

pub async fn health_check(&self) -> Result<(), Error>

GET /api/v1/health-check

§Errors

Returns Error::Http on network failure.

Source

pub async fn list_runs(&self) -> Result<ApiResponse<Vec<RunResponse>>, Error>

GET /api/v1/runs – List runs with optional filtering and pagination.

§Errors

Returns Error::Api on 401 Unauthorized.

Source

pub async fn list_runs_filtered( &self, filter: &ListRunsFilter<'_>, ) -> Result<ApiResponse<Vec<RunResponse>>, Error>

GET /api/v1/runs with query parameters.

§Errors

Returns Error::Api on 401 Unauthorized.

§Examples
use ironflow_sdk::IronflowClient;
use ironflow_sdk::client::ListRunsFilter;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let filter = ListRunsFilter {
    workflow: Some("deploy"),
    status: Some("completed"),
    ..Default::default()
};
let runs = client.list_runs_filtered(&filter).await?;
Source

pub async fn create_run( &self, request: &CreateRunRequest, ) -> Result<ApiResponse<RunResponse>, Error>

POST /api/v1/runs – Trigger a workflow.

§Errors

Returns Error::Api on 400 (unknown workflow) or 401/403.

Source

pub async fn create_run_idempotent( &self, request: &CreateRunRequest, idempotency_key: &str, ) -> Result<ApiResponse<RunResponse>, Error>

POST /api/v1/runs with an Idempotency-Key header – trigger a workflow exactly once.

Replaying the same key returns the run it already produced instead of creating a second one. The key stays bound for 24 hours. Use a value the caller can reproduce across retries, such as a webhook delivery id.

The returned envelope is identical whether the run was created or replayed; compare data.idempotency_key or the run id if the distinction matters.

§Errors

Returns Error::Api on 400 (unknown workflow or malformed key), 401/403, or 409 (IDEMPOTENCY_KEY_CONFLICT) when the key is already bound to a different workflow or payload.

§Examples
use ironflow_sdk::{IronflowClient, types};

let client = IronflowClient::new("https://ironflow.example.com", "key");

// Derive the key from something the caller can reproduce on retry,
// such as the provider delivery id of the webhook that triggered this.
let run = client
    .create_run_idempotent(request, "github:8f4e2a10")
    .await?;
Source

pub async fn get_run( &self, id: Uuid, ) -> Result<ApiResponse<RunDetailResponse>, Error>

GET /api/v1/runs/:id – Get run details.

§Errors

Returns Error::Api on 404 (run not found) or 401.

Source

pub async fn cancel_run( &self, id: Uuid, ) -> Result<ApiResponse<CancelRunResponse>, Error>

POST /api/v1/runs/:id/cancel – Cancel a run and the sub-workflow runs below it.

The response carries the cancelled run’s fields plus cancelled_descendants, the ids of the sub-runs cancelled with it.

§Errors

Returns Error::Api on 404 or 400 (invalid state transition).

Source

pub async fn pause_run( &self, id: Uuid, ) -> Result<ApiResponse<PauseRunResponse>, Error>

POST /api/v1/runs/:id/pause – Pause a run and the sub-workflow runs below it.

A running run has its step in flight interrupted, executed again on resume. The response carries the paused run’s fields, with resume_status (the state it returns to), plus paused_descendants, the ids of the sub-runs paused with it.

§Errors

Returns Error::Api on 404, 403 (not an admin) or 400 (the run already finished, is already paused, or is a sub-workflow run).

Source

pub async fn resume_run( &self, id: Uuid, ) -> Result<ApiResponse<ResumeRunResponse>, Error>

POST /api/v1/runs/:id/resume – Resume a paused run and the sub-workflow runs paused below it.

The response carries the resumed run’s fields plus resumed_descendants, the ids of the sub-runs resumed with it.

§Errors

Returns Error::Api on 404, 403 (not an admin) or 400 (the run is not paused, or is a sub-workflow run).

Source

pub async fn approve_run( &self, id: Uuid, ) -> Result<ApiResponse<RunResponse>, Error>

POST /api/v1/runs/:id/approve – Approve a run waiting for approval.

§Errors

Returns Error::Api on 404 or 400.

Source

pub async fn reject_run( &self, id: Uuid, ) -> Result<ApiResponse<RunResponse>, Error>

POST /api/v1/runs/:id/reject – Reject a run waiting for approval.

§Errors

Returns Error::Api on 404 or 400.

Source

pub async fn submit_input<T: Serialize + ?Sized>( &self, run_id: Uuid, step_id: Uuid, value: &T, ) -> Result<ApiResponse<RunResponse>, Error>

POST /api/v1/runs/:id/steps/:step_id/input – Answer a human input step.

value is serialized as the JSON body and validated by the server against the schema stored on the step. On success the run resumes.

§Errors

Returns Error::Api on 400 (the step does not wait for input), 403 (the caller may not answer), 404 (unknown run or step), 409 (already answered or rejected) or 422 (the value does not match the schema).

Source

pub async fn reject_input( &self, run_id: Uuid, step_id: Uuid, reason: Option<&str>, ) -> Result<ApiResponse<RunResponse>, Error>

POST /api/v1/runs/:id/steps/:step_id/reject – Reject a human input step.

The run resumes and the handler receives the rejection with reason (or a default reason naming the caller).

§Errors

Returns Error::Api on 400 (the step does not wait for input), 403 (the caller may not reject it), 404 (unknown run or step) or 409 (already answered or rejected).

Source

pub async fn retry_run( &self, id: Uuid, force: bool, ) -> Result<ApiResponse<RunResponse>, Error>

POST /api/v1/runs/:id/retry – Retry a failed run (creates a new run).

When force is true, the query parameter ?force=true is appended to override a handler version mismatch.

§Errors

Returns Error::Api on 404, 400, or 409 (version mismatch).

Source

pub async fn replay_run( &self, id: Uuid, ) -> Result<ApiResponse<RunResponse>, Error>

POST /api/v1/runs/:id/replay – Replay a finished run on the current handler version (creates a new run).

Unlike retry_run, the new run always targets the handler’s current version; there is no compatibility check to force.

§Errors

Returns Error::Api on 404 (run not found or workflow no longer registered) or 400 (run still in flight).

Source

pub async fn list_workflows( &self, ) -> Result<ApiResponse<Vec<WorkflowSummary>>, Error>

GET /api/v1/workflows – List registered workflows.

§Errors

Returns Error::Api on 401.

Source

pub async fn get_workflow( &self, name: &str, ) -> Result<ApiResponse<WorkflowDetailResponse>, Error>

GET /api/v1/workflows/:name – Get workflow details.

§Errors

Returns Error::Api on 404 or 401.

Source

pub async fn plan_workflow( &self, name: &str, request: &PlanWorkflowRequest, ) -> Result<ApiResponse<ExecutionPlanResponse>, Error>

POST /api/v1/workflows/:name/plan – Build the execution plan for a workflow.

Planning has no side effect: no step runs, and no run is created.

§Errors

Returns Error::Api on 400 (invalid payload or max_depth), 401, or 404 (workflow not registered).

Source

pub async fn pause_workflow( &self, name: &str, ) -> Result<ApiResponse<WorkflowPauseResponse>, Error>

POST /api/v1/workflows/:name/pause – Pause a workflow: workers stop picking its queued runs until it is resumed.

§Errors

Returns Error::Api on 404 (workflow not registered) or 403 (not an admin).

Source

pub async fn resume_workflow( &self, name: &str, ) -> Result<ApiResponse<WorkflowPauseResponse>, Error>

POST /api/v1/workflows/:name/resume – Resume a paused workflow.

§Errors

Returns Error::Api on 404 (workflow not registered) or 403 (not an admin).

Source

pub async fn get_stats(&self) -> Result<ApiResponse<StatsResponse>, Error>

GET /api/v1/stats – Aggregate statistics.

§Errors

Returns Error::Api on 401.

Source

pub async fn stats_history( &self, workflow: Option<&str>, period: Option<&str>, granularity: Option<&str>, ) -> Result<ApiResponse<StatsHistoryResponse>, Error>

GET /api/v1/stats/history – Time-bucketed historical statistics.

Shorthand for stats_history_with without run filters other than workflow.

§Examples
let history = client.stats_history(Some("deploy"), Some("7d"), None).await?;
for bucket in &history.data.buckets {
    println!(
        "{}: {} completed, {} warning, {} running",
        bucket.time, bucket.completed, bucket.warning, bucket.running
    );
}
§Errors

Returns Error::Api on 401 or 400.

Source

pub async fn stats_history_with( &self, params: &StatsHistoryParams<'_>, ) -> Result<ApiResponse<StatsHistoryResponse>, Error>

GET /api/v1/stats/history with every query parameter.

Returns one bucket per granularity step over the whole period (zero-filled), each with a counter per run status and the success rate.

§Examples
use ironflow_sdk::client::StatsHistoryParams;

let params = StatsHistoryParams {
    period: Some("24h"),
    label: Some("env:prod"),
    ..Default::default()
};
let history = client.stats_history_with(&params).await?;
for bucket in &history.data.buckets {
    println!("{}: {:?}", bucket.time, bucket.success_rate_percent);
}
§Errors

Returns Error::Api on 401 or 400.

Source

pub async fn agent_role_stats( &self, period: Option<&str>, ) -> Result<ApiResponse<AgentRoleStatsResponse>, Error>

GET /api/v1/stats/agent-roles – Cost, executions and failures per agent role over a period, all workflows combined.

period is 24h, 7d, 30d or 90d; the server defaults to 7d.

§Examples
let stats = client.agent_role_stats(Some("30d")).await?;
for role in &stats.data.roles {
    println!("{}: {} executions", role.agent_role, role.executions);
}
§Errors

Returns Error::Api on 401, 403 or 400 (invalid period).

Source

pub async fn list_steps( &self, params: &ListStepsParams<'_>, ) -> Result<ApiResponse<Vec<StepResponse>>, Error>

GET /api/v1/steps – List the agent steps of one agent role across every run and workflow, newest first.

§Examples
use ironflow_sdk::client::ListStepsParams;

let params = ListStepsParams {
    agent_role: "Reviewer",
    page: None,
    per_page: Some(50),
};
let steps = client.list_steps(&params).await?;
for step in &steps.data {
    println!("{} in run {}", step.name, step.run_id);
}
§Errors

Returns Error::Api on 401, 403 or 400 (blank or too long role).

Source

pub async fn sign_in(&self, request: &SignInRequest) -> Result<(), Error>

POST /api/v1/auth/sign-in – Sign in with credentials.

Returns cookies/headers for session management.

§Errors

Returns Error::Api on 401 (invalid credentials).

Source

pub async fn sign_out(&self) -> Result<(), Error>

POST /api/v1/auth/sign-out – Sign out.

§Errors

Returns Error::Api on 401.

Source

pub async fn me(&self) -> Result<ApiResponse<MeResponse>, Error>

GET /api/v1/auth/me – Get current user info.

§Errors

Returns Error::Api on 401.

Source

pub async fn list_api_keys( &self, ) -> Result<ApiResponse<Vec<ApiKeyResponse>>, Error>

GET /api/v1/api-keys – List API keys.

§Errors

Returns Error::Api on 401.

Source

pub async fn create_api_key( &self, request: &CreateApiKeyRequest, ) -> Result<ApiResponse<CreateApiKeyResponse>, Error>

POST /api/v1/api-keys – Create a new API key.

§Errors

Returns Error::Api on 400 or 401.

Source

pub async fn available_scopes( &self, ) -> Result<ApiResponse<Vec<ScopeEntry>>, Error>

GET /api/v1/api-keys/scopes – List available API key scopes.

§Errors

Returns Error::Api on 401.

Source

pub async fn delete_api_key(&self, id: Uuid) -> Result<(), Error>

DELETE /api/v1/api-keys/:id – Delete an API key.

§Errors

Returns Error::Api on 404 or 401.

Source

pub async fn list_users(&self) -> Result<ApiResponse<Vec<UserResponse>>, Error>

GET /api/v1/users – List users (admin only).

§Errors

Returns Error::Api on 401 or 403.

Source

pub async fn create_user( &self, request: &CreateUserRequest, ) -> Result<ApiResponse<UserResponse>, Error>

POST /api/v1/users – Create a user (admin only).

§Errors

Returns Error::Api on 400, 401, 403, or 409.

Source

pub async fn delete_user(&self, id: Uuid) -> Result<(), Error>

DELETE /api/v1/users/:id – Delete a user (admin only).

§Errors

Returns Error::Api on 404, 401, or 403.

Source

pub async fn update_role( &self, id: Uuid, request: &UpdateRoleRequest, ) -> Result<ApiResponse<UserResponse>, Error>

PATCH /api/v1/users/:id/role – Update a user’s role (admin only).

§Errors

Returns Error::Api on 404, 401, or 403.

Source

pub async fn get_user_groups( &self, id: Uuid, ) -> Result<ApiResponse<UserGroupsResponse>, Error>

GET /api/v1/users/:id/groups – List a user’s groups (admin only).

§Errors

Returns Error::Api on 401, 403, or 404.

Source

pub async fn update_user_groups( &self, id: Uuid, groups: &[String], ) -> Result<ApiResponse<UserGroupsResponse>, Error>

PUT /api/v1/users/:id/groups – Replace a user’s groups (admin only).

Group membership restricts who may vote on an approval gate whose rule lists approver groups. An empty slice removes the user from every group.

§Errors

Returns Error::Api on 400 (invalid group name), 401, 403, or 404.

Source

pub async fn list_secrets( &self, ) -> Result<ApiResponse<Vec<SecretResponse>>, Error>

GET /api/v1/secrets – List secrets (admin only).

§Errors

Returns Error::Api on 401 or 403.

Source

pub async fn create_secret( &self, request: &SetSecretRequest, ) -> Result<ApiResponse<SecretResponse>, Error>

POST /api/v1/secrets – Create a secret (admin only).

§Errors

Returns Error::Api on 400, 401, or 403.

Source

pub async fn update_secret( &self, key: &str, request: &UpdateSecretRequest, ) -> Result<ApiResponse<SecretResponse>, Error>

PUT /api/v1/secrets/:key – Update a secret (admin only).

§Errors

Returns Error::Api on 404, 401, or 403.

Source

pub async fn delete_secret(&self, key: &str) -> Result<(), Error>

DELETE /api/v1/secrets/:key – Delete a secret (admin only).

§Errors

Returns Error::Api on 404, 401, or 403.

Source

pub async fn rotate_secrets( &self, request: &RotateSecretsRequest, ) -> Result<ApiResponse<RotateSecretsResponse>, Error>

POST /api/v1/secrets/rotate – Re-encrypt one batch of secrets towards a key version (admin only).

One call handles one batch. Loop, passing the returned last_id back as after_id, until remaining reaches zero or last_id is None. The operation is idempotent, so an interrupted rotation can simply be restarted.

§Errors

Returns Error::Api on 400 (unknown key version), 401, or 403.

Source

pub async fn secret_key_versions( &self, ) -> Result<ApiResponse<KeyVersionsResponse>, Error>

GET /api/v1/secrets/key-versions – Encryption key ring status (admin only).

§Errors

Returns Error::Api on 401 or 403.

Source

pub async fn get_run_logs( &self, run_id: Uuid, filter: &ListRunLogsFilter<'_>, ) -> Result<ApiResponse<Vec<LogEntry>>, Error>

GET /api/v1/runs/:id/logs – Retrieve persisted log lines for a run.

Returns log entries with cursor-based pagination. Pass the next_cursor from a previous response to fetch the next page.

§Errors

Returns Error::Api on 404 (run not found) or 401.

§Examples
use ironflow_sdk::IronflowClient;
use ironflow_sdk::client::ListRunLogsFilter;
use uuid::Uuid;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let run_id = Uuid::nil();
let logs = client.get_run_logs(run_id, &ListRunLogsFilter::default()).await?;
Source

pub async fn list_audit_logs( &self, ) -> Result<ApiResponse<Vec<AuditLogEntry>>, Error>

GET /api/v1/audit-logs – List audit log entries (admin only).

§Errors

Returns Error::Api on 401 or 403.

Source

pub async fn list_audit_logs_filtered( &self, filter: &ListAuditLogsFilter<'_>, ) -> Result<ApiResponse<Vec<AuditLogEntry>>, Error>

GET /api/v1/audit-logs with query parameters (admin only).

§Errors

Returns Error::Api on 401 or 403.

§Examples
use ironflow_sdk::IronflowClient;
use ironflow_sdk::client::ListAuditLogsFilter;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let filter = ListAuditLogsFilter {
    event_type: Some("run_created"),
    ..Default::default()
};
let entries = client.list_audit_logs_filtered(&filter).await?;
Source§

impl IronflowClient

Source

pub async fn list_approval_delegations( &self, ) -> Result<ApiResponse<Vec<ApprovalDelegationResponse>>, Error>

List the first page of the active approval delegations visible to the caller.

§Errors

Returns an error if the HTTP request fails or the response cannot be deserialized.

§Examples
use ironflow_sdk::IronflowClient;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let delegations = client.list_approval_delegations().await?;
Source

pub async fn list_approval_delegations_filtered( &self, filter: &ListApprovalDelegationsFilter, ) -> Result<ApiResponse<Vec<ApprovalDelegationResponse>>, Error>

List the active approval delegations visible to the caller, with filters and pagination.

§Errors

Returns an error if the HTTP request fails or the response cannot be deserialized.

§Examples
use ironflow_sdk::IronflowClient;
use ironflow_sdk::client::ListApprovalDelegationsFilter;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let filter = ListApprovalDelegationsFilter {
    page: Some(2),
    ..Default::default()
};
let delegations = client.list_approval_delegations_filtered(&filter).await?;
Source

pub async fn create_approval_delegation( &self, request: &CreateApprovalDelegationRequest, ) -> Result<ApiResponse<ApprovalDelegationResponse>, Error>

Delegate the caller’s approval power to another user.

§Errors

Returns an error if the HTTP request fails or the response cannot be deserialized.

§Examples
use chrono::{TimeDelta, Utc};
use ironflow_sdk::IronflowClient;
use ironflow_sdk::types::CreateApprovalDelegationRequest;
use uuid::Uuid;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let delegation = client.create_approval_delegation(&CreateApprovalDelegationRequest {
    to_user_id: bob,
    valid_from: None,
    valid_until: Utc::now() + TimeDelta::days(7),
    workflow_filter: Some("deploy-*".to_string()),
}).await?;
Source

pub async fn delete_approval_delegation(&self, id: Uuid) -> Result<(), Error>

Revoke an approval delegation by ID.

§Errors

Returns an error if the HTTP request fails.

§Examples
use ironflow_sdk::IronflowClient;
use uuid::Uuid;

let client = IronflowClient::new("https://ironflow.example.com", "key");
client.delete_approval_delegation(Uuid::nil()).await?;
Source§

impl IronflowClient

Source

pub async fn list_provider_accounts( &self, ) -> Result<ApiResponse<Vec<ProviderAccountResponse>>, Error>

List Provider Accounts with their latest usage windows.

§Errors

Returns an error if the HTTP request fails or the response cannot be deserialized.

§Examples
use ironflow_sdk::IronflowClient;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let accounts = client.list_provider_accounts().await?;
Source

pub async fn create_provider_account( &self, request: &CreateProviderAccountRequest, ) -> Result<ApiResponse<ProviderAccountResponse>, Error>

Add a Provider Account. The token is checked against the provider first.

§Errors

Returns an error if the HTTP request fails, the token is rejected (422) or the name is taken (409).

§Examples
use ironflow_sdk::IronflowClient;
use ironflow_sdk::types::CreateProviderAccountRequest;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let account = client.create_provider_account(&CreateProviderAccountRequest {
    name: "perso".to_string(),
    kind: "claude_subscription".to_string(),
    token: "sk-ant-oat01-...".to_string(),
    alert_threshold: None,
    display_name: None,
    enabled: None,
    expires_at: None,
    max_concurrency: None,
    plan: None,
    priority: None,
    tags: None,
}).await?;
Source

pub async fn get_provider_account( &self, account: &str, ) -> Result<ApiResponse<ProviderAccountResponse>, Error>

Get a Provider Account by UUID or name.

§Errors

Returns an error if the HTTP request fails or the account does not exist.

§Examples
use ironflow_sdk::IronflowClient;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let account = client.get_provider_account("perso").await?;
Source

pub async fn update_provider_account( &self, account: &str, request: &UpdateProviderAccountRequest, ) -> Result<ApiResponse<ProviderAccountResponse>, Error>

Update a Provider Account by UUID or name.

§Errors

Returns an error if the HTTP request fails, the account does not exist or a new token is rejected.

§Examples
use ironflow_sdk::IronflowClient;
use ironflow_sdk::types::UpdateProviderAccountRequest;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let update = UpdateProviderAccountRequest { enabled: Some(false), ..Default::default() };
client.update_provider_account("perso", &update).await?;
Source

pub async fn clear_provider_account_max_concurrency( &self, account: &str, ) -> Result<ApiResponse<ProviderAccountResponse>, Error>

Remove the max_concurrency limit of a Provider Account.

update_provider_account leaves an absent field unchanged, so clearing needs an explicit null.

§Errors

Returns an error if the HTTP request fails or the account does not exist.

§Examples
use ironflow_sdk::IronflowClient;

let client = IronflowClient::new("https://ironflow.example.com", "key");
client.clear_provider_account_max_concurrency("perso").await?;
Source

pub async fn delete_provider_account(&self, account: &str) -> Result<(), Error>

Delete a Provider Account and its credential.

§Errors

Returns an error if the HTTP request fails or the account does not exist.

§Examples
use ironflow_sdk::IronflowClient;

let client = IronflowClient::new("https://ironflow.example.com", "key");
client.delete_provider_account("perso").await?;
Source

pub async fn test_provider_account( &self, account: &str, ) -> Result<ApiResponse<ProviderAccountTestResponse>, Error>

Check the stored credential of a Provider Account against the provider.

§Errors

Returns an error if the HTTP request fails or the provider is unreachable.

§Examples
use ironflow_sdk::IronflowClient;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let outcome = client.test_provider_account("perso").await?;
Source

pub async fn provider_account_usage( &self, account: &str, ) -> Result<ApiResponse<ProviderAccountUsageResponse>, Error>

Current windows and 30-day history of a Provider Account.

§Errors

Returns an error if the HTTP request fails or the account does not exist.

§Examples
use ironflow_sdk::IronflowClient;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let usage = client.provider_account_usage("perso").await?;
Source§

impl IronflowClient

Source

pub async fn list_schedules( &self, ) -> Result<ApiResponse<Vec<ScheduleResponse>>, Error>

List all schedules.

§Errors

Returns an error if the HTTP request fails or the response cannot be deserialized.

§Examples
use ironflow_sdk::IronflowClient;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let schedules = client.list_schedules().await?;
Source

pub async fn create_schedule( &self, request: &CreateScheduleRequest, ) -> Result<ApiResponse<ScheduleResponse>, Error>

Create a new schedule.

§Errors

Returns an error if the HTTP request fails or the response cannot be deserialized.

§Examples
use ironflow_sdk::IronflowClient;
use ironflow_sdk::types::CreateScheduleRequest;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let schedule = client.create_schedule(&CreateScheduleRequest {
    workflow_name: "deploy".to_string(),
    cron_expression: "0 * * * *".to_string(),
    inputs: Some(serde_json::json!({})),
    priority: None,
    catchup: None,
    catchup_max: None,
    catchup_window_secs: None,
    overlap: None,
    timezone: Some("Europe/Paris".to_string()),
}).await?;
Source

pub async fn get_schedule( &self, id: Uuid, ) -> Result<ApiResponse<ScheduleResponse>, Error>

Get a schedule by ID.

§Errors

Returns an error if the HTTP request fails or the response cannot be deserialized.

§Examples
use ironflow_sdk::IronflowClient;
use uuid::Uuid;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let schedule = client.get_schedule(Uuid::nil()).await?;
Source

pub async fn delete_schedule(&self, id: Uuid) -> Result<(), Error>

Delete a schedule by ID.

§Errors

Returns an error if the HTTP request fails.

§Examples
use ironflow_sdk::IronflowClient;
use uuid::Uuid;

let client = IronflowClient::new("https://ironflow.example.com", "key");
client.delete_schedule(Uuid::nil()).await?;
Source

pub async fn pause_schedule( &self, id: Uuid, ) -> Result<ApiResponse<ScheduleResponse>, Error>

Pause a schedule.

§Errors

Returns an error if the HTTP request fails or the response cannot be deserialized.

§Examples
use ironflow_sdk::IronflowClient;
use uuid::Uuid;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let schedule = client.pause_schedule(Uuid::nil()).await?;
Source

pub async fn resume_schedule( &self, id: Uuid, ) -> Result<ApiResponse<ScheduleResponse>, Error>

Resume a schedule.

§Errors

Returns an error if the HTTP request fails or the response cannot be deserialized.

§Examples
use ironflow_sdk::IronflowClient;
use uuid::Uuid;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let schedule = client.resume_schedule(Uuid::nil()).await?;
Source

pub async fn trigger_schedule( &self, id: Uuid, ) -> Result<ApiResponse<ScheduleResponse>, Error>

Trigger a schedule manually, creating a run.

§Errors

Returns an error if the HTTP request fails or the response cannot be deserialized.

§Examples
use ironflow_sdk::IronflowClient;
use uuid::Uuid;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let schedule = client.trigger_schedule(Uuid::nil()).await?;
Source§

impl IronflowClient

Source

pub async fn send_signal( &self, request: &SendSignalRequest, ) -> Result<ApiResponse<SignalDeliveryResponse>, Error>

Send a signal, resuming every run waiting for its (name, key).

The caller must be an admin, or use an API key with the signals_send scope. Sending again with the same idempotency_id delivers nothing and returns duplicate: true.

§Errors

Returns an error if the HTTP request fails, the signal is invalid (empty name or key), the caller lacks the permission, or the response cannot be deserialized.

§Examples
use ironflow_sdk::IronflowClient;
use ironflow_sdk::types::SendSignalRequest;
use serde_json::json;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let request: SendSignalRequest = serde_json::from_value(json!({
    "name": "ci.pipeline_finished",
    "key": "4f2a9c1",
    "payload": {"status": "success"},
    "idempotency_id": "delivery-42"
}))?;
let delivery = client.send_signal(&request).await?;
println!("{} runs resumed", delivery.data.resumed.len());
Source

pub async fn list_signals( &self, filter: &ListSignalsFilter, ) -> Result<ApiResponse<Vec<SignalResponse>>, Error>

List received signals, newest first, with filters and pagination.

§Errors

Returns an error if the HTTP request fails or the response cannot be deserialized.

§Examples
use ironflow_sdk::IronflowClient;
use ironflow_sdk::client::ListSignalsFilter;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let filter = ListSignalsFilter {
    name: Some("ci.pipeline_finished".to_string()),
    ..Default::default()
};
let signals = client.list_signals(&filter).await?;
Source§

impl IronflowClient

Source

pub async fn events( &self, run_id: Option<Uuid>, types: Option<&[&str]>, ) -> Result<EventStream, Error>

Connect to the SSE event stream at GET /api/v1/events.

Returns a Stream of SseEvents. Optionally filter by run_id and/or event types.

§Errors

Returns Error::Http if the connection fails, or Error::Api if the server responds with a non-2xx status code.

§Examples
use ironflow_sdk::IronflowClient;
use futures_util::StreamExt;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let mut stream = client.events(None, None).await?;

while let Some(event) = stream.next().await {
    let event = event?;
}
Source

pub async fn subscribe_run_events( &self, run_id: Uuid, ) -> Result<EventStream, Error>

Subscribe to SSE events for a specific run.

Connects to GET /api/v1/runs/{run_id}/events and returns a Stream of SseEvents. The stream ends when the connection drops; the caller is responsible for reconnection if needed.

§Errors

Returns Error::Http if the connection fails, or Error::Api on a non-2xx status code.

§Examples
use ironflow_sdk::IronflowClient;
use futures_util::StreamExt;
use uuid::Uuid;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let mut stream = client.subscribe_run_events(Uuid::nil()).await?;

while let Some(event) = stream.next().await {
    let event = event?;
}
Source

pub async fn subscribe_global_events(&self) -> Result<EventStream, Error>

Subscribe to the global SSE event stream.

Connects to GET /api/v1/events and returns a Stream of SseEvents for all runs.

§Errors

Returns Error::Http if the connection fails, or Error::Api on a non-2xx status code.

§Examples
use ironflow_sdk::IronflowClient;
use futures_util::StreamExt;

let client = IronflowClient::new("https://ironflow.example.com", "key");
let mut stream = client.subscribe_global_events().await?;

while let Some(event) = stream.next().await {
    let event = event?;
}

Trait Implementations§

Source§

impl Clone for IronflowClient

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IronflowClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more