pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
Sourcepub async fn renew_activity_task_lease(
&self,
task_id: &str,
activity_attempt_id: &str,
lease_owner: &str,
request_window: Duration,
) -> Result<Value>
pub async fn renew_activity_task_lease( &self, task_id: &str, activity_attempt_id: &str, lease_owner: &str, request_window: Duration, ) -> Result<Value>
Renew one original activity claim without recording application progress.
A worker-authenticated registration, poll or discovery must advertise
the boolean activity_lease_renewal=true. Clones share this observation
until an explicit capability refusal. Discovery, lock waiting and renewal share
request_window, which must be positive and at most five seconds. Use
any earlier claim or execution deadline as an additional caller ceiling.
This returns the Server reply. Before extending local publication authority, the caller must validate the original task/run/execution, attempt and owner, the granted lease and unchanged business deadlines. A successful HTTP response alone does not authorize continued execution.
Source§impl Client
impl Client
Sourcepub async fn open_cancellation_scope_on_claim(
&self,
task: &WorkflowTask,
sequence: u64,
parent_scope_id: &str,
shield_parent: bool,
) -> Result<CancellationScopeOpenReceipt>
pub async fn open_cancellation_scope_on_claim( &self, task: &WorkflowTask, sequence: u64, parent_scope_id: &str, shield_parent: bool, ) -> Result<CancellationScopeOpenReceipt>
Open a scope and prove its canonical identity on the original claim.
This explicit protocol 1.20 operation keeps one five-second budget for lost acknowledgement recovery and all history pages. No lease, worker capability or cancellation execution authority is added by this proof.
Source§impl Client
impl Client
Sourcepub async fn acknowledge_activity_cancellation(
&self,
task_id: &str,
activity_attempt_id: &str,
lease_owner: &str,
request_id: &str,
) -> Result<Value>
pub async fn acknowledge_activity_cancellation( &self, task_id: &str, activity_attempt_id: &str, lease_owner: &str, request_id: &str, ) -> Result<Value>
Report a stopped and dropped remote callback under its original claim.
Call only after callback execution has ended. This explicit protocol 1.20 operation preserves the original cancellation request and grants no lease or result publication authority. The request has one five-second budget.
Sourcepub async fn activity_task_status(
&self,
task_id: &str,
activity_attempt_id: &str,
lease_owner: &str,
) -> Result<Value>
pub async fn activity_task_status( &self, task_id: &str, activity_attempt_id: &str, lease_owner: &str, ) -> Result<Value>
Observe an exact activity attempt without renewing its lease or progress.
This explicit worker-protocol 1.20 operation has one five-second budget. A pending workflow request alone does not cancel an activity. Its reply reports the runtime’s current continuation authority after delivery.
Sourcepub async fn poll_cooperative_workflow_task(
&self,
worker_id: &str,
task_queue: &str,
timeout: Duration,
) -> Result<CooperativeWorkflowTaskPoll>
pub async fn poll_cooperative_workflow_task( &self, worker_id: &str, task_queue: &str, timeout: Duration, ) -> Result<CooperativeWorkflowTaskPoll>
Acquire a claim with protocol 1.20 and retain its pending observation.
The Server must have admitted a capable worker registration. This method
registers no capability and does not change ordinary Worker polling.
It never substitutes a worker ID for a missing lease owner or invents a
task attempt. Poll retries reuse one request ID. Poll and history loading
share one long-poll budget plus five seconds, with at most 128 pages.
Managed Workers separately budget claimed hydration using the Client
timeout while maintaining task authority.
Sourcepub async fn heartbeat_workflow_task(
&self,
task: &WorkflowTask,
original: Option<&CancellationRequest>,
) -> Result<WorkflowTaskHeartbeat>
pub async fn heartbeat_workflow_task( &self, task: &WorkflowTask, original: Option<&CancellationRequest>, ) -> Result<WorkflowTaskHeartbeat>
Renew the exact selected workflow-task lease using worker protocol 1.20.
The reply must acknowledge the actual task, owner and attempt. Renewal neither commits cancellation delivery nor extends its cleanup deadline.
Sourcepub async fn deliver_workflow_cancellation(
&self,
task: &WorkflowTask,
delivery: &CancellationDelivery,
) -> Result<CancellationDeliveryReply>
pub async fn deliver_workflow_cancellation( &self, task: &WorkflowTask, delivery: &CancellationDelivery, ) -> Result<CancellationDeliveryReply>
Commit cooperative delivery on the exact selected workflow-task claim.
This explicit worker-protocol 1.20 operation renews no lease and advertises no worker capability. The Server requires a previously admitted capable claim. Reload canonical history before exposing cancellation to workflow code, including when an acknowledgment is lost. A cancellation wait explicitly releases the claim and must return the worker to polling.
Sourcepub async fn refresh_workflow_cancellation_history(
&self,
task: &WorkflowTask,
observation: &CancellationRequest,
) -> Result<Vec<HistoryEvent>>
pub async fn refresh_workflow_cancellation_history( &self, task: &WorkflowTask, observation: &CancellationRequest, ) -> Result<Vec<HistoryEvent>>
Reload canonical history with the Server-issued token and exact claim.
The refresh has one five-second budget, at most 128 pages, and the existing SDK page-size limit. Invalid, repeated or non-progressing tokens and pages fail closed. This returns fresh history without modifying the caller’s previous task snapshot or its original request identity.
Sourcepub async fn request_workflow_cancellation(
&self,
workflow_id: &str,
options: CooperativeCancellationOptions,
) -> Result<WorkflowCancellationRequest>
pub async fn request_workflow_cancellation( &self, workflow_id: &str, options: CooperativeCancellationOptions, ) -> Result<WorkflowCancellationRequest>
Request bounded workflow-authored cleanup on a capable runtime.
This is separate from terminal cancellation. Discovery must advertise cooperative support and compatible protocol 1.20. The Server also refuses an active workflow claim that cannot deliver cooperation. Repeated requests retain its original request identity and deadline.
Sourcepub async fn request_workflow_run_cancellation(
&self,
workflow_id: &str,
run_id: &str,
options: CooperativeCancellationOptions,
) -> Result<WorkflowCancellationRequest>
pub async fn request_workflow_run_cancellation( &self, workflow_id: &str, run_id: &str, options: CooperativeCancellationOptions, ) -> Result<WorkflowCancellationRequest>
Request cleanup only if the selected run remains current.
Source§impl Client
impl Client
Sourcepub fn with_metrics_recorder(self, recorder: Arc<dyn MetricsRecorder>) -> Self
pub fn with_metrics_recorder(self, recorder: Arc<dyn MetricsRecorder>) -> Self
Replace this client’s recorder. Clones and new workers inherit it.
Source§impl Client
impl Client
Sourcepub async fn list_workflows(
&self,
options: WorkflowListOptions,
) -> Result<WorkflowListPage>
pub async fn list_workflows( &self, options: WorkflowListOptions, ) -> Result<WorkflowListPage>
Read one page, preserving the Server’s filters, validation and ordering. Published Server2.11 defaults to50 rows and accepts1..=200 per page.
Sourcepub fn iter_workflows(&self, options: WorkflowListOptions) -> WorkflowIterator
pub fn iter_workflows(&self, options: WorkflowListOptions) -> WorkflowIterator
Lazily enumerate list results, retaining the original namespace/filters.
Sourcepub async fn get_workflow_history(
&self,
workflow_id: &str,
run_id: &str,
options: WorkflowHistoryOptions,
) -> Result<WorkflowHistoryPage>
pub async fn get_workflow_history( &self, workflow_id: &str, run_id: &str, options: WorkflowHistoryOptions, ) -> Result<WorkflowHistoryPage>
Read one page of a selected run’s history. This is not a complete export.
Published Server2.11 defaults to100 events and accepts1..=1000 per page.
Use export_workflow_history for the self-contained replay bundle.
Sourcepub fn iter_workflow_history(
&self,
workflow_id: impl Into<String>,
run_id: impl Into<String>,
options: WorkflowHistoryOptions,
) -> WorkflowHistoryIterator
pub fn iter_workflow_history( &self, workflow_id: impl Into<String>, run_id: impl Into<String>, options: WorkflowHistoryOptions, ) -> WorkflowHistoryIterator
Lazily enumerate one selected run. It does not follow continue-as-new into another run or subscribe indefinitely after history is exhausted.
Source§impl Client
impl Client
Sourcepub async fn control_plane_request(
&self,
request: RawRequest,
) -> Result<RawResponse>
pub async fn control_plane_request( &self, request: RawRequest, ) -> Result<RawResponse>
Send a control-plane request with this client’s base URL (including any path prefix), TLS settings, namespace, control token, timeout and metrics recorder.
Every HTTP response is returned as a RawResponse, including 4xx
and 5xx. Use RawResponse::error_for_status or
RawResponse::refusal to classify a refusal. Transport failures,
including timeouts, are Error::Transport.
Sourcepub async fn worker_plane_request(
&self,
request: RawRequest,
) -> Result<RawResponse>
pub async fn worker_plane_request( &self, request: RawRequest, ) -> Result<RawResponse>
Send a worker-plane request with the worker token. Otherwise like
Client::control_plane_request.
A 2xx response must echo a compatible protocol version (see
worker_protocol_compatible) in its header, and its JSON body must
carry the same protocol_version; otherwise the result is
Error::Protocol with reason invalid_worker_protocol_response.
A numeric body value is compared in its JSON spelling (1.2 stays
"1.2", 1.20 becomes "1.2"). Servers send it as a string.
Non-2xx responses are not checked.
Source§impl Client
impl Client
Sourcepub async fn get_run_activities(
&self,
workflow_id: &str,
run_id: &str,
) -> Result<WorkflowActivityList>
pub async fn get_run_activities( &self, workflow_id: &str, run_id: &str, ) -> Result<WorkflowActivityList>
Inspect activity and attempt metadata for one explicit run.
This uses the existing namespace-scoped control-plane route, distinct
from standalone activities. Nullable metadata stays optional, and no
workflow payload is fetched or decoded. Unknown fields remain in raw.
Source§impl Client
impl Client
Sourcepub async fn signal_with_start<I: Serialize, S: Serialize>(
&self,
workflow_type: &str,
task_queue: &str,
workflow_id: &str,
signal_name: &str,
input: I,
signal_input: S,
options: SignalWithStartOptions,
) -> Result<Value>
pub async fn signal_with_start<I: Serialize, S: Serialize>( &self, workflow_type: &str, task_queue: &str, workflow_id: &str, signal_name: &str, input: I, signal_input: S, options: SignalWithStartOptions, ) -> Result<Value>
Start the workflow or reuse its open run, and signal it, in one Server
transaction (native Server capabilities.signal_with_start).
- No run: a new run starts with
inputandoptions.start; the receipt’sstart_outcomeisstarted_new. - An open run, including the newest run after continue-as-new: the
signal joins it and
start_outcomeisreturned_existing_active.OpenRunPolicy::Failrefuses it withinstance_already_started. - A closed run: refused with
run_not_activeunlessClosedRunPolicy::StartNewRun, which starts a fresh run after it (closed_run_idnames the closed run).
workflow_type must be the instance’s type and task_queue the open
run’s queue. The receipt carries the signal’s command_id,
command_sequence, run_id and outcome, the start’s
start_command_id, start_outcome and start_command_status,
intake_group_id and request_id. A retry with the same key, signal
name, arguments and workflow type returns the original receipt with
retained: true, even after the run closed or continued, and starts
nothing.
Before sending, the client checks discovery and returns
Error::SignalWithStartUnavailable when the Server does not
advertise the capability. Every Server refusal is an Error::Http
whose body reason names the cause (for example run_not_active,
workflow_type_conflict, task_queue_conflict, unknown_signal); see
Error::signal_with_start_refusal. Nothing was written for any of
them. An admitted signal is admitted once; effects it triggers still
need their own idempotency.
Sourcepub fn generate_signal_with_start_request_id() -> String
pub fn generate_signal_with_start_request_id() -> String
A fresh caller command key for one logical signal-with-start
(sdk-rust-signal-with-start-<uuid>). Obtain it up front and pass it
in SignalWithStartOptions::request_id so a transport failure does
not lose the key needed for a safe retry.
Source§impl Client
impl Client
Sourcepub async fn update_outcome(
&self,
workflow_id: &str,
update_id: &str,
wait_timeout_seconds: Option<u64>,
) -> Result<Value>
pub async fn update_outcome( &self, workflow_id: &str, update_id: &str, wait_timeout_seconds: Option<u64>, ) -> Result<Value>
Read an accepted update’s outcome later by its update id, without submitting it again.
This waits for the outcome, like Client::update_workflow, for up to
wait_timeout_seconds (the Server’s update wait default when None).
It returns the decoded result of a completed update, including Null
when the handler returned null. While the update is still running it
returns Error::UpdateStillPending: call it again with the same
update id to keep waiting.
A failed update is Error::Http with status 422 and the failure
receipt, and a rejected update keeps its original rejection status. An
unknown or pruned update id is 404 update_not_found
(Error::is_update_not_found), which does not prove the update was
never admitted.
Needs a Server that advertises capabilities.update_outcome_reads
(native 3.6.0 and later). Any other Server is refused with
Error::UpdateOutcomeReadsUnavailable before anything is read: the
SDK never resubmits an update as a substitute for reading it.
Sourcepub async fn update_outcome_avro_value(
&self,
workflow_id: &str,
update_id: &str,
wait_timeout_seconds: Option<u64>,
) -> Result<AvroValue>
pub async fn update_outcome_avro_value( &self, workflow_id: &str, update_id: &str, wait_timeout_seconds: Option<u64>, ) -> Result<AvroValue>
Client::update_outcome that retains a bytes-capable Avro result.
Sourcepub async fn update_outcome_receipt(
&self,
workflow_id: &str,
update_id: &str,
wait_for: UpdateWaitStage,
wait_timeout_seconds: Option<u64>,
) -> Result<Value>
pub async fn update_outcome_receipt( &self, workflow_id: &str, update_id: &str, wait_for: UpdateWaitStage, wait_timeout_seconds: Option<u64>, ) -> Result<Value>
Read an accepted update’s Server receipt by update id. It writes nothing.
UpdateWaitStage::Accepted answers at once; a still-running update
comes back as a receipt with update_status: "accepted", never as an
error. UpdateWaitStage::Completed waits up to
wait_timeout_seconds first. Failures, rejections, update_not_found
and the capability check behave as in Client::update_outcome.
Source§impl Client
impl Client
Sourcepub async fn create_worker_session(
&self,
worker_id: &str,
options: &WorkerSessionOptions,
) -> Result<Value>
pub async fn create_worker_session( &self, worker_id: &str, options: &WorkerSessionOptions, ) -> Result<Value>
Create, reuse or reacquire a session for this registered worker.
Server owns admission, requirements, capacity and holder authority. An admitted reacquisition requires rebuilding worker-local resources.
Source§impl Client
impl Client
Sourcepub fn with_telemetry(self, telemetry: ExecutionTelemetry) -> Self
pub fn with_telemetry(self, telemetry: ExecutionTelemetry) -> Self
Configure optional propagation. Actual cluster discovery must advertise the exact supported capability before any command carries context.
pub fn new(base_url: impl Into<String>) -> Result<Self>
pub fn builder(base_url: impl Into<String>) -> ClientBuilder
pub async fn health(&self) -> Result<Value>
pub async fn cluster_info(&self) -> Result<Value>
pub async fn start_workflow<T: Serialize>( &self, workflow_type: &str, task_queue: &str, workflow_id: &str, input: T, ) -> Result<WorkflowHandle>
Sourcepub async fn start_workflow_with_options<T: Serialize>(
&self,
workflow_type: &str,
task_queue: &str,
workflow_id: &str,
options: WorkflowStartOptions,
input: T,
) -> Result<WorkflowHandle>
pub async fn start_workflow_with_options<T: Serialize>( &self, workflow_type: &str, task_queue: &str, workflow_id: &str, options: WorkflowStartOptions, input: T, ) -> Result<WorkflowHandle>
Start a workflow with explicit server-enforced execution and run deadlines.
Sourcepub async fn signal_workflow<T: Serialize>(
&self,
workflow_id: &str,
signal_name: &str,
input: T,
) -> Result<Value>
pub async fn signal_workflow<T: Serialize>( &self, workflow_id: &str, signal_name: &str, input: T, ) -> Result<Value>
Send a signal with an SDK-generated caller command key.
The key is sent as the request_id body field and is present in the
returned receipt’s request_id. A Server that already retains the key
for the same signal intent returns the original receipt with
retained: true; a different intent is refused with
Error::is_request_id_conflict. Choose the key yourself with
Client::signal_workflow_with_request_id when the application must be
able to retry the same logical signal after a transport failure.
Sourcepub async fn signal_workflow_with_request_id<T: Serialize>(
&self,
workflow_id: &str,
signal_name: &str,
input: T,
request_id: &str,
) -> Result<Value>
pub async fn signal_workflow_with_request_id<T: Serialize>( &self, workflow_id: &str, signal_name: &str, input: T, request_id: &str, ) -> Result<Value>
Send a signal with an explicit caller command key (1 to 255 Unicode characters).
Resend the identical signal with the same key after an uncertain outcome: the Server returns the retained receipt instead of admitting a second signal, for as long as the retained run’s details are kept.
Sourcepub fn generate_signal_request_id() -> String
pub fn generate_signal_request_id() -> String
A fresh caller command key for one logical signal (sdk-rust-signal-<uuid>).
Methods without an explicit key generate one of these per call. Obtain it
up front and pass it to Client::signal_workflow_with_request_id so a
transport failure does not lose the key needed for a safe retry.
Sourcepub fn generate_update_request_id() -> String
pub fn generate_update_request_id() -> String
A fresh caller command key for one logical update (sdk-rust-update-<uuid>).
Client::update_workflow generates one of these when request_id is
None. Obtain it up front and pass it explicitly so a transport failure
does not lose the key needed for a safe retry.
Sourcepub async fn append_message_stream<T: Serialize>(
&self,
workflow_id: &str,
stream_name: &str,
message_id: &str,
input: T,
) -> Result<Value>
pub async fn append_message_stream<T: Serialize>( &self, workflow_id: &str, stream_name: &str, message_id: &str, input: T, ) -> Result<Value>
Append one idempotently identified item to an instance-scoped input stream.
Sourcepub async fn signal_workflow_run<T: Serialize>(
&self,
workflow_id: &str,
run_id: &str,
signal_name: &str,
input: T,
) -> Result<Value>
pub async fn signal_workflow_run<T: Serialize>( &self, workflow_id: &str, run_id: &str, signal_name: &str, input: T, ) -> Result<Value>
Signal only if run_id is still the current run for this instance,
with an SDK-generated caller command key.
Sourcepub async fn signal_workflow_run_with_request_id<T: Serialize>(
&self,
workflow_id: &str,
run_id: &str,
signal_name: &str,
input: T,
request_id: &str,
) -> Result<Value>
pub async fn signal_workflow_run_with_request_id<T: Serialize>( &self, workflow_id: &str, run_id: &str, signal_name: &str, input: T, request_id: &str, ) -> Result<Value>
Signal only if run_id is still the current run for this instance,
with an explicit caller command key (1 to 255 Unicode characters).
The selected run is part of the signal’s intent: retrying with the same
key and a different run target is a request_id_conflict refusal.
Sourcepub async fn cancel_workflow(
&self,
workflow_id: &str,
options: WorkflowCommandOptions,
) -> Result<WorkflowCommandResult>
pub async fn cancel_workflow( &self, workflow_id: &str, options: WorkflowCommandOptions, ) -> Result<WorkflowCommandResult>
Close the current run as cancelled immediately.
Server revokes open tasks and timers without resuming workflow code for
cleanup. Use Client::request_workflow_cancellation for a separate cooperative
request on a supporting runtime and opted-in worker.
Sourcepub async fn cancel_workflow_run(
&self,
workflow_id: &str,
run_id: &str,
options: WorkflowCommandOptions,
) -> Result<WorkflowCommandResult>
pub async fn cancel_workflow_run( &self, workflow_id: &str, run_id: &str, options: WorkflowCommandOptions, ) -> Result<WorkflowCommandResult>
Close the selected run as cancelled, only if run_id is still current.
Sourcepub async fn terminate_workflow(
&self,
workflow_id: &str,
options: WorkflowCommandOptions,
) -> Result<WorkflowCommandResult>
pub async fn terminate_workflow( &self, workflow_id: &str, options: WorkflowCommandOptions, ) -> Result<WorkflowCommandResult>
Forcefully terminate the current run for an instance.
Sourcepub async fn terminate_workflow_run(
&self,
workflow_id: &str,
run_id: &str,
options: WorkflowCommandOptions,
) -> Result<WorkflowCommandResult>
pub async fn terminate_workflow_run( &self, workflow_id: &str, run_id: &str, options: WorkflowCommandOptions, ) -> Result<WorkflowCommandResult>
Forcefully terminate only if run_id is still current.
Sourcepub async fn redrive_workflow_run(
&self,
workflow_id: &str,
failed_run_id: &str,
request_id: Option<&str>,
) -> Result<WorkflowRedriveResult>
pub async fn redrive_workflow_run( &self, workflow_id: &str, failed_run_id: &str, request_id: Option<&str>, ) -> Result<WorkflowRedriveResult>
Continue a failed run from its recorded activity failure boundary.
Sourcepub async fn query_workflow<T: Serialize>(
&self,
workflow_id: &str,
query_name: &str,
input: T,
) -> Result<Value>
pub async fn query_workflow<T: Serialize>( &self, workflow_id: &str, query_name: &str, input: T, ) -> Result<Value>
Execute a named, read-only query against a running or completed workflow.
Arguments and results use the platform payload envelope. Server and
worker rejections are returned as Error::QueryFailed with a stable
reason, HTTP status, and original response body.
Sourcepub async fn query_workflow_run<T: Serialize>(
&self,
workflow_id: &str,
run_id: &str,
query_name: &str,
input: T,
) -> Result<Value>
pub async fn query_workflow_run<T: Serialize>( &self, workflow_id: &str, run_id: &str, query_name: &str, input: T, ) -> Result<Value>
Query only if run_id is still current, preventing accidental retargeting.
Sourcepub async fn query_workflow_avro_value<T: Serialize>(
&self,
workflow_id: &str,
query_name: &str,
input: T,
) -> Result<AvroValue>
pub async fn query_workflow_avro_value<T: Serialize>( &self, workflow_id: &str, query_name: &str, input: T, ) -> Result<AvroValue>
Query a workflow and return the lossless fixed Avro Value result.
Sourcepub async fn query_workflow_run_avro_value<T: Serialize>(
&self,
workflow_id: &str,
run_id: &str,
query_name: &str,
input: T,
) -> Result<AvroValue>
pub async fn query_workflow_run_avro_value<T: Serialize>( &self, workflow_id: &str, run_id: &str, query_name: &str, input: T, ) -> Result<AvroValue>
Query a selected run and return the lossless fixed Avro Value result.
Sourcepub async fn update_workflow<T: Serialize>(
&self,
workflow_id: &str,
update_name: &str,
input: T,
request_id: Option<&str>,
) -> Result<Value>
pub async fn update_workflow<T: Serialize>( &self, workflow_id: &str, update_name: &str, input: T, request_id: Option<&str>, ) -> Result<Value>
Send a synchronous update using fixed Avro Value arguments.
request_id is the caller command key (1 to 255 Unicode characters), sent as the
request_id body field; None generates one with
Client::generate_update_request_id. A Server that already retains the
key for the same update intent returns the original update’s receipt and
result instead of admitting a second update; a different intent is
refused with Error::is_request_id_conflict.
The Server waits for the update to complete. When its wait ends first,
this returns Error::UpdateStillPending, never Null: read the
outcome later with Client::update_outcome and the pending update’s
id, or send the update again with the same request_id. A handler that
returned null is Ok(Value::Null).
Sourcepub async fn update_workflow_receipt<T: Serialize>(
&self,
workflow_id: &str,
update_name: &str,
input: T,
request_id: Option<&str>,
) -> Result<Value>
pub async fn update_workflow_receipt<T: Serialize>( &self, workflow_id: &str, update_name: &str, input: T, request_id: Option<&str>, ) -> Result<Value>
Send a synchronous update and return the Server’s full receipt instead of only its result.
The request is the one Client::update_workflow sends, with the same
caller command key rules, and it is sent once. The receipt carries the
request_id, update_id, run_id, update_status and, on a Server
that advertises capabilities.command_request_keys, the retained and
intent_verified flags. Use it when the caller must tell a verified
retry from a legacy readback: a receipt with retained: true and
intent_verified: false is the original update for a key retained
before the Server compared intent, so its result is not proof that this
call’s name and arguments match the original. A pending update is
returned as its receipt (update_status is not completed), never as
an error.
Sourcepub async fn update_workflow_avro_value<T: Serialize>(
&self,
workflow_id: &str,
update_name: &str,
input: T,
request_id: Option<&str>,
) -> Result<AvroValue>
pub async fn update_workflow_avro_value<T: Serialize>( &self, workflow_id: &str, update_name: &str, input: T, request_id: Option<&str>, ) -> Result<AvroValue>
Send a synchronous update and retain a bytes-capable Avro result.
pub async fn describe_workflow( &self, workflow_id: &str, ) -> Result<WorkflowDescription>
Sourcepub async fn describe_workflow_run(
&self,
workflow_id: &str,
run_id: &str,
) -> Result<WorkflowDescription>
pub async fn describe_workflow_run( &self, workflow_id: &str, run_id: &str, ) -> Result<WorkflowDescription>
Describe one selected run, including historical terminal runs.
Sourcepub async fn list_workflow_streams(
&self,
workflow_id: &str,
run_id: &str,
) -> Result<Vec<WorkflowStreamDescription>>
pub async fn list_workflow_streams( &self, workflow_id: &str, run_id: &str, ) -> Result<Vec<WorkflowStreamDescription>>
List the run-scoped output streams already opened by a workflow.
Sourcepub async fn describe_workflow_stream(
&self,
workflow_id: &str,
run_id: &str,
stream_name: &str,
) -> Result<WorkflowStreamDescription>
pub async fn describe_workflow_stream( &self, workflow_id: &str, run_id: &str, stream_name: &str, ) -> Result<WorkflowStreamDescription>
Describe stream lifecycle, offsets, pending count, and terminal error.
Sourcepub async fn subscribe_workflow_stream(
&self,
workflow_id: &str,
run_id: &str,
stream_name: &str,
from_offset: u64,
max_items: usize,
wait: Duration,
) -> Result<WorkflowStreamPage>
pub async fn subscribe_workflow_stream( &self, workflow_id: &str, run_id: &str, stream_name: &str, from_offset: u64, max_items: usize, wait: Duration, ) -> Result<WorkflowStreamPage>
Read one bounded page beginning at a zero-based offset.
Delivery is at least once: persist next_offset only after processing
the page. The future is cancellation-safe; dropping it cancels the
in-flight request. Long polling is capped at 60 seconds by the SDK and
service contract.
Sourcepub async fn append_workflow_stream(
&self,
workflow_id: &str,
run_id: &str,
stream_name: &str,
items: &[WorkflowStreamAppendItem],
max_pending_items: Option<u64>,
) -> Result<WorkflowStreamAppendResult>
pub async fn append_workflow_stream( &self, workflow_id: &str, run_id: &str, stream_name: &str, items: &[WorkflowStreamAppendItem], max_pending_items: Option<u64>, ) -> Result<WorkflowStreamAppendResult>
Append inline Avro envelopes or opaque external payload references.
Sourcepub async fn close_workflow_stream(
&self,
workflow_id: &str,
run_id: &str,
stream_name: &str,
error_reason: Option<&str>,
retention_seconds: Option<u64>,
) -> Result<WorkflowStreamDescription>
pub async fn close_workflow_stream( &self, workflow_id: &str, run_id: &str, stream_name: &str, error_reason: Option<&str>, retention_seconds: Option<u64>, ) -> Result<WorkflowStreamDescription>
Close a stream, or mark it errored when error_reason is supplied.
pub async fn register_worker( &self, worker_id: &str, task_queue: &str, supported_workflow_types: Vec<String>, supported_activity_types: Vec<String>, max_concurrent_workflow_tasks: usize, max_concurrent_activity_tasks: usize, ) -> Result<RegisterWorkerResponse>
Sourcepub async fn register_worker_with_capabilities(
&self,
worker_id: &str,
task_queue: &str,
supported_workflow_types: Vec<String>,
supported_activity_types: Vec<String>,
max_concurrent_workflow_tasks: usize,
max_concurrent_activity_tasks: usize,
capabilities: Vec<String>,
) -> Result<RegisterWorkerResponse>
pub async fn register_worker_with_capabilities( &self, worker_id: &str, task_queue: &str, supported_workflow_types: Vec<String>, supported_activity_types: Vec<String>, max_concurrent_workflow_tasks: usize, max_concurrent_activity_tasks: usize, capabilities: Vec<String>, ) -> Result<RegisterWorkerResponse>
Register a worker and explicitly advertise additive worker capabilities.
Sourcepub async fn register_worker_with_command_contracts(
&self,
worker_id: &str,
task_queue: &str,
supported_workflow_types: Vec<String>,
supported_activity_types: Vec<String>,
max_concurrent_workflow_tasks: usize,
max_concurrent_activity_tasks: usize,
capabilities: Vec<String>,
workflow_command_contracts: Value,
) -> Result<RegisterWorkerResponse>
pub async fn register_worker_with_command_contracts( &self, worker_id: &str, task_queue: &str, supported_workflow_types: Vec<String>, supported_activity_types: Vec<String>, max_concurrent_workflow_tasks: usize, max_concurrent_activity_tasks: usize, capabilities: Vec<String>, workflow_command_contracts: Value, ) -> Result<RegisterWorkerResponse>
Register a worker and advertise its named query and update handlers.
This Rust SDK cannot execute synchronous pre-accept update validation,
so a workflow contract with a non-empty or malformed
update_validators declaration returns
Error::UnsupportedUpdateValidators before registration transport.
Sourcepub async fn deregister_worker_registration(
&self,
worker_id: &str,
) -> Result<WorkerDeregistrationEnvelope>
pub async fn deregister_worker_registration( &self, worker_id: &str, ) -> Result<WorkerDeregistrationEnvelope>
Gracefully remove one worker’s registration through the worker plane.
This operation is separate from operator-facing worker management. It uses worker-protocol authentication and returns the server’s lease recovery result.
Sourcepub async fn poll_query_task(
&self,
worker_id: &str,
task_queue: &str,
timeout: Duration,
) -> Result<Option<QueryTask>>
pub async fn poll_query_task( &self, worker_id: &str, task_queue: &str, timeout: Duration, ) -> Result<Option<QueryTask>>
Long-poll for an ephemeral, read-only workflow query task.
Sourcepub async fn poll_query_task_response(
&self,
worker_id: &str,
task_queue: &str,
timeout: Duration,
) -> Result<PollQueryTaskResponse>
pub async fn poll_query_task_response( &self, worker_id: &str, task_queue: &str, timeout: Duration, ) -> Result<PollQueryTaskResponse>
Poll a query task while preserving server stop and drain metadata.
Sourcepub async fn complete_query_task<T: Serialize>(
&self,
query_task_id: &str,
lease_owner: &str,
query_task_attempt: u64,
result: T,
codec: &str,
) -> Result<Value>
pub async fn complete_query_task<T: Serialize>( &self, query_task_id: &str, lease_owner: &str, query_task_attempt: u64, result: T, codec: &str, ) -> Result<Value>
Complete a query task without appending workflow history.
Sourcepub async fn fail_query_task(
&self,
query_task_id: &str,
lease_owner: &str,
query_task_attempt: u64,
message: impl Into<String>,
reason: impl Into<String>,
failure_type: impl Into<String>,
) -> Result<Value>
pub async fn fail_query_task( &self, query_task_id: &str, lease_owner: &str, query_task_attempt: u64, message: impl Into<String>, reason: impl Into<String>, failure_type: impl Into<String>, ) -> Result<Value>
Report a stable machine-readable query-task failure.
pub async fn heartbeat_worker( &self, worker_id: &str, workflow_available: usize, activity_available: usize, ) -> Result<Value>
pub async fn poll_workflow_task( &self, worker_id: &str, task_queue: &str, timeout: Duration, ) -> Result<Option<WorkflowTask>>
pub async fn poll_workflow_task_response( &self, worker_id: &str, task_queue: &str, timeout: Duration, ) -> Result<PollWorkflowTaskResponse>
pub async fn complete_workflow_task( &self, task_id: &str, lease_owner: &str, workflow_task_attempt: u64, commands: Vec<Value>, ) -> Result<Value>
pub async fn fail_workflow_task( &self, task_id: &str, lease_owner: &str, workflow_task_attempt: u64, message: impl Into<String>, ) -> Result<Value>
Sourcepub async fn fail_workflow_task_with_failure(
&self,
task_id: &str,
lease_owner: &str,
workflow_task_attempt: u64,
failure: Value,
) -> Result<Value>
pub async fn fail_workflow_task_with_failure( &self, task_id: &str, lease_owner: &str, workflow_task_attempt: u64, failure: Value, ) -> Result<Value>
Report a workflow-task failure using the existing Server failure schema.
The published schema supports message, type, reason, sequence
and stack_trace. Oversized data is bounded before transport; original
sizes and omissions are marked in the existing message field.
pub async fn poll_activity_task( &self, worker_id: &str, task_queue: &str, timeout: Duration, ) -> Result<Option<ActivityTask>>
Sourcepub async fn poll_activity_task_response(
&self,
worker_id: &str,
task_queue: &str,
timeout: Duration,
) -> Result<PollActivityTaskResponse>
pub async fn poll_activity_task_response( &self, worker_id: &str, task_queue: &str, timeout: Duration, ) -> Result<PollActivityTaskResponse>
Poll an activity task while preserving server stop and drain metadata.
pub async fn complete_activity_task<T: Serialize>( &self, task_id: &str, activity_attempt_id: &str, lease_owner: &str, result: T, codec: &str, ) -> Result<Value>
pub async fn fail_activity_task( &self, task_id: &str, activity_attempt_id: &str, lease_owner: &str, message: impl Into<String>, non_retryable: bool, ) -> Result<Value>
Sourcepub async fn fail_activity_task_with_error(
&self,
task_id: &str,
activity_attempt_id: &str,
lease_owner: &str,
error: &ActivityError,
) -> Result<Value>
pub async fn fail_activity_task_with_error( &self, task_id: &str, activity_attempt_id: &str, lease_owner: &str, error: &ActivityError, ) -> Result<Value>
Report an activity’s application-defined failure type and retry marker.
Sourcepub async fn fail_activity_task_with_failure(
&self,
task_id: &str,
activity_attempt_id: &str,
lease_owner: &str,
failure: Value,
) -> Result<Value>
pub async fn fail_activity_task_with_failure( &self, task_id: &str, activity_attempt_id: &str, lease_owner: &str, failure: Value, ) -> Result<Value>
Report a structured activity failure using existing Server fields such as
message, type, stack_trace, non_retryable and Avro details.
The final encoded report is bounded without changing claim identity or
retry flags. Invalid or unfit required data is a reporting error.
Sourcepub async fn heartbeat_activity_task<T: Serialize>(
&self,
task_id: &str,
activity_attempt_id: &str,
lease_owner: &str,
details: T,
) -> Result<ActivityHeartbeatResponse>
pub async fn heartbeat_activity_task<T: Serialize>( &self, task_id: &str, activity_attempt_id: &str, lease_owner: &str, details: T, ) -> Result<ActivityHeartbeatResponse>
Record a flat map of scalar/null activity progress metadata.
Heartbeat details use the Server’s bounded JSON progress contract. They are not workflow payload envelopes.