pub struct ActivityTask {
pub workflow_id: WorkflowId,
pub activity_id: ActivityId,
pub run_id: RunId,
pub activity_type: String,
pub attempt: u32,
pub completion_token: String,
pub idempotency_key: String,
pub input: Payload,
pub labels: BTreeMap<String, String>,
}Expand description
SDK-level activity task envelope decoded from the AW-owned worker proto.
Fields§
§workflow_id: WorkflowIdOwning workflow id, required later when reporting this task’s outcome.
activity_id: ActivityIdActivity id correlating reports and heartbeats with this task.
run_id: RunIdConcrete workflow run that staged this task — the generation axis.
REQUIRED, not optional: a continue-as-new chain reuses one workflow id
while activity ordinals and attempt numbers restart in every generation,
so (workflow, activity, attempt) alone does not name a dispatch. The
run is what every transcript event this task emits is keyed by, and
crate::ActivityContext hands it to the handler as a plain value —
a handler must never have to invent one. Decoding refuses a wire task
without it ([MalformedActivityTask::MissingRunId]), so a hand-built
test task names its generation exactly as a live dispatch does.
activity_type: StringRegistered activity type name requested by the engine.
attempt: u32One-based delivery attempt stamped by the dispatching engine seam and read from the wire. Zero is malformed and rejected at decode.
completion_token: StringOpaque execution-generation token echoed verbatim on every outcome.
idempotency_key: StringStable external-effect key for this run and action site. Identical across
retries and available to handlers through crate::ActivityContext.
input: PayloadOpaque activity input payload, preserving its content-type tag.
labels: BTreeMap<String, String>Human-meaningful display labels the workflow attached to the activity
(for example brief=IP-001). Display metadata only — surfaced in the
worker’s logs. BTreeMap keeps the rendered order stable; empty when
the workflow attached none.
Trait Implementations§
Source§impl Clone for ActivityTask
impl Clone for ActivityTask
Source§fn clone(&self) -> ActivityTask
fn clone(&self) -> ActivityTask
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ActivityTask
impl Debug for ActivityTask
impl Eq for ActivityTask
Source§impl PartialEq for ActivityTask
impl PartialEq for ActivityTask
impl StructuralPartialEq for ActivityTask
Source§impl TryFrom<ProtoActivityTask> for ActivityTask
impl TryFrom<ProtoActivityTask> for ActivityTask
Source§type Error = WorkerError
type Error = WorkerError
Auto Trait Implementations§
impl Freeze for ActivityTask
impl RefUnwindSafe for ActivityTask
impl Send for ActivityTask
impl Sync for ActivityTask
impl Unpin for ActivityTask
impl UnsafeUnpin for ActivityTask
impl UnwindSafe for ActivityTask
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request