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
impl IronflowClient
Sourcepub async fn download_artifact(
&self,
run_id: Uuid,
step_name: &str,
artifact_name: &str,
) -> Result<ArtifactDownload, Error>
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;Sourcepub async fn download_artifact_by_step_id(
&self,
run_id: Uuid,
step_id: Uuid,
artifact_name: &str,
) -> Result<ArtifactDownload, Error>
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
impl IronflowClient
Source§impl IronflowClient
impl IronflowClient
Sourcepub fn new(base_url: &str, api_key: &str) -> Self
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");Sourcepub fn from_config(config: ClientConfig) -> Self
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);Sourcepub fn from_config_with_retry(
config: ClientConfig,
retry_config: RetryConfig,
rate_limiter: RateLimiter,
) -> Self
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.
Sourcepub async fn health_check(&self) -> Result<(), Error>
pub async fn health_check(&self) -> Result<(), Error>
Sourcepub async fn list_runs(&self) -> Result<ApiResponse<Vec<RunResponse>>, Error>
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.
Sourcepub async fn list_runs_filtered(
&self,
filter: &ListRunsFilter<'_>,
) -> Result<ApiResponse<Vec<RunResponse>>, Error>
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?;Sourcepub async fn create_run(
&self,
request: &CreateRunRequest,
) -> Result<ApiResponse<RunResponse>, Error>
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.
Sourcepub async fn create_run_idempotent(
&self,
request: &CreateRunRequest,
idempotency_key: &str,
) -> Result<ApiResponse<RunResponse>, Error>
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?;Sourcepub async fn get_run(
&self,
id: Uuid,
) -> Result<ApiResponse<RunDetailResponse>, Error>
pub async fn get_run( &self, id: Uuid, ) -> Result<ApiResponse<RunDetailResponse>, Error>
Sourcepub async fn cancel_run(
&self,
id: Uuid,
) -> Result<ApiResponse<CancelRunResponse>, Error>
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).
Sourcepub async fn pause_run(
&self,
id: Uuid,
) -> Result<ApiResponse<PauseRunResponse>, Error>
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).
Sourcepub async fn resume_run(
&self,
id: Uuid,
) -> Result<ApiResponse<ResumeRunResponse>, Error>
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).
Sourcepub async fn approve_run(
&self,
id: Uuid,
) -> Result<ApiResponse<RunResponse>, Error>
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.
Sourcepub async fn reject_run(
&self,
id: Uuid,
) -> Result<ApiResponse<RunResponse>, Error>
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.
Sourcepub async fn submit_input<T: Serialize + ?Sized>(
&self,
run_id: Uuid,
step_id: Uuid,
value: &T,
) -> Result<ApiResponse<RunResponse>, Error>
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).
Sourcepub async fn reject_input(
&self,
run_id: Uuid,
step_id: Uuid,
reason: Option<&str>,
) -> Result<ApiResponse<RunResponse>, Error>
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).
Sourcepub async fn retry_run(
&self,
id: Uuid,
force: bool,
) -> Result<ApiResponse<RunResponse>, Error>
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).
Sourcepub async fn replay_run(
&self,
id: Uuid,
) -> Result<ApiResponse<RunResponse>, Error>
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).
Sourcepub async fn list_workflows(
&self,
) -> Result<ApiResponse<Vec<WorkflowSummary>>, Error>
pub async fn list_workflows( &self, ) -> Result<ApiResponse<Vec<WorkflowSummary>>, Error>
Sourcepub async fn get_workflow(
&self,
name: &str,
) -> Result<ApiResponse<WorkflowDetailResponse>, Error>
pub async fn get_workflow( &self, name: &str, ) -> Result<ApiResponse<WorkflowDetailResponse>, Error>
Sourcepub async fn plan_workflow(
&self,
name: &str,
request: &PlanWorkflowRequest,
) -> Result<ApiResponse<ExecutionPlanResponse>, Error>
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).
Sourcepub async fn pause_workflow(
&self,
name: &str,
) -> Result<ApiResponse<WorkflowPauseResponse>, Error>
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).
Sourcepub async fn resume_workflow(
&self,
name: &str,
) -> Result<ApiResponse<WorkflowPauseResponse>, Error>
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).
Sourcepub async fn get_stats(&self) -> Result<ApiResponse<StatsResponse>, Error>
pub async fn get_stats(&self) -> Result<ApiResponse<StatsResponse>, Error>
Sourcepub async fn stats_history(
&self,
workflow: Option<&str>,
period: Option<&str>,
granularity: Option<&str>,
) -> Result<ApiResponse<StatsHistoryResponse>, Error>
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.
Sourcepub async fn stats_history_with(
&self,
params: &StatsHistoryParams<'_>,
) -> Result<ApiResponse<StatsHistoryResponse>, Error>
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(¶ms).await?;
for bucket in &history.data.buckets {
println!("{}: {:?}", bucket.time, bucket.success_rate_percent);
}§Errors
Returns Error::Api on 401 or 400.
Sourcepub async fn agent_role_stats(
&self,
period: Option<&str>,
) -> Result<ApiResponse<AgentRoleStatsResponse>, Error>
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).
Sourcepub async fn list_steps(
&self,
params: &ListStepsParams<'_>,
) -> Result<ApiResponse<Vec<StepResponse>>, Error>
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(¶ms).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).
Sourcepub async fn sign_in(&self, request: &SignInRequest) -> Result<(), Error>
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).
Sourcepub async fn me(&self) -> Result<ApiResponse<MeResponse>, Error>
pub async fn me(&self) -> Result<ApiResponse<MeResponse>, Error>
Sourcepub async fn list_api_keys(
&self,
) -> Result<ApiResponse<Vec<ApiKeyResponse>>, Error>
pub async fn list_api_keys( &self, ) -> Result<ApiResponse<Vec<ApiKeyResponse>>, Error>
Sourcepub async fn create_api_key(
&self,
request: &CreateApiKeyRequest,
) -> Result<ApiResponse<CreateApiKeyResponse>, Error>
pub async fn create_api_key( &self, request: &CreateApiKeyRequest, ) -> Result<ApiResponse<CreateApiKeyResponse>, Error>
Sourcepub async fn available_scopes(
&self,
) -> Result<ApiResponse<Vec<ScopeEntry>>, Error>
pub async fn available_scopes( &self, ) -> Result<ApiResponse<Vec<ScopeEntry>>, Error>
Sourcepub async fn list_users(&self) -> Result<ApiResponse<Vec<UserResponse>>, Error>
pub async fn list_users(&self) -> Result<ApiResponse<Vec<UserResponse>>, Error>
Sourcepub async fn create_user(
&self,
request: &CreateUserRequest,
) -> Result<ApiResponse<UserResponse>, Error>
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.
Sourcepub async fn delete_user(&self, id: Uuid) -> Result<(), Error>
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.
Sourcepub async fn update_role(
&self,
id: Uuid,
request: &UpdateRoleRequest,
) -> Result<ApiResponse<UserResponse>, Error>
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.
Sourcepub async fn get_user_groups(
&self,
id: Uuid,
) -> Result<ApiResponse<UserGroupsResponse>, Error>
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.
Sourcepub async fn update_user_groups(
&self,
id: Uuid,
groups: &[String],
) -> Result<ApiResponse<UserGroupsResponse>, Error>
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.
Sourcepub async fn list_secrets(
&self,
) -> Result<ApiResponse<Vec<SecretResponse>>, Error>
pub async fn list_secrets( &self, ) -> Result<ApiResponse<Vec<SecretResponse>>, Error>
Sourcepub async fn create_secret(
&self,
request: &SetSecretRequest,
) -> Result<ApiResponse<SecretResponse>, Error>
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.
Sourcepub async fn update_secret(
&self,
key: &str,
request: &UpdateSecretRequest,
) -> Result<ApiResponse<SecretResponse>, Error>
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.
Sourcepub async fn delete_secret(&self, key: &str) -> Result<(), Error>
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.
Sourcepub async fn rotate_secrets(
&self,
request: &RotateSecretsRequest,
) -> Result<ApiResponse<RotateSecretsResponse>, Error>
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.
Sourcepub async fn secret_key_versions(
&self,
) -> Result<ApiResponse<KeyVersionsResponse>, Error>
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.
Sourcepub async fn get_run_logs(
&self,
run_id: Uuid,
filter: &ListRunLogsFilter<'_>,
) -> Result<ApiResponse<Vec<LogEntry>>, Error>
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?;Sourcepub async fn list_audit_logs(
&self,
) -> Result<ApiResponse<Vec<AuditLogEntry>>, Error>
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.
Sourcepub async fn list_audit_logs_filtered(
&self,
filter: &ListAuditLogsFilter<'_>,
) -> Result<ApiResponse<Vec<AuditLogEntry>>, Error>
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
impl IronflowClient
Sourcepub async fn list_approval_delegations(
&self,
) -> Result<ApiResponse<Vec<ApprovalDelegationResponse>>, Error>
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?;Sourcepub async fn list_approval_delegations_filtered(
&self,
filter: &ListApprovalDelegationsFilter,
) -> Result<ApiResponse<Vec<ApprovalDelegationResponse>>, Error>
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?;Sourcepub async fn create_approval_delegation(
&self,
request: &CreateApprovalDelegationRequest,
) -> Result<ApiResponse<ApprovalDelegationResponse>, Error>
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§impl IronflowClient
impl IronflowClient
Sourcepub async fn list_provider_accounts(
&self,
) -> Result<ApiResponse<Vec<ProviderAccountResponse>>, Error>
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?;Sourcepub async fn create_provider_account(
&self,
request: &CreateProviderAccountRequest,
) -> Result<ApiResponse<ProviderAccountResponse>, Error>
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?;Sourcepub async fn get_provider_account(
&self,
account: &str,
) -> Result<ApiResponse<ProviderAccountResponse>, Error>
pub async fn get_provider_account( &self, account: &str, ) -> Result<ApiResponse<ProviderAccountResponse>, Error>
Sourcepub async fn update_provider_account(
&self,
account: &str,
request: &UpdateProviderAccountRequest,
) -> Result<ApiResponse<ProviderAccountResponse>, Error>
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?;Sourcepub async fn clear_provider_account_max_concurrency(
&self,
account: &str,
) -> Result<ApiResponse<ProviderAccountResponse>, Error>
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?;Sourcepub async fn test_provider_account(
&self,
account: &str,
) -> Result<ApiResponse<ProviderAccountTestResponse>, Error>
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?;Sourcepub async fn provider_account_usage(
&self,
account: &str,
) -> Result<ApiResponse<ProviderAccountUsageResponse>, Error>
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
impl IronflowClient
Sourcepub async fn list_schedules(
&self,
) -> Result<ApiResponse<Vec<ScheduleResponse>>, Error>
pub async fn list_schedules( &self, ) -> Result<ApiResponse<Vec<ScheduleResponse>>, Error>
Sourcepub async fn create_schedule(
&self,
request: &CreateScheduleRequest,
) -> Result<ApiResponse<ScheduleResponse>, Error>
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?;Sourcepub async fn get_schedule(
&self,
id: Uuid,
) -> Result<ApiResponse<ScheduleResponse>, Error>
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?;Sourcepub async fn pause_schedule(
&self,
id: Uuid,
) -> Result<ApiResponse<ScheduleResponse>, Error>
pub async fn pause_schedule( &self, id: Uuid, ) -> Result<ApiResponse<ScheduleResponse>, Error>
Sourcepub async fn resume_schedule(
&self,
id: Uuid,
) -> Result<ApiResponse<ScheduleResponse>, Error>
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?;Sourcepub async fn trigger_schedule(
&self,
id: Uuid,
) -> Result<ApiResponse<ScheduleResponse>, Error>
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
impl IronflowClient
Sourcepub async fn send_signal(
&self,
request: &SendSignalRequest,
) -> Result<ApiResponse<SignalDeliveryResponse>, Error>
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());Sourcepub async fn list_signals(
&self,
filter: &ListSignalsFilter,
) -> Result<ApiResponse<Vec<SignalResponse>>, Error>
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
impl IronflowClient
Sourcepub async fn events(
&self,
run_id: Option<Uuid>,
types: Option<&[&str]>,
) -> Result<EventStream, Error>
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?;
}Sourcepub async fn subscribe_run_events(
&self,
run_id: Uuid,
) -> Result<EventStream, Error>
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?;
}Sourcepub async fn subscribe_global_events(&self) -> Result<EventStream, Error>
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?;
}