pub trait ActivityDefinition: Send + Sync {
type Input: Serialize + DeserializeOwned + Send + Sync;
type Output: Serialize + DeserializeOwned + Send + Sync;
// Required methods
fn activity_type() -> &'static str;
fn execute(
ctx: ActivityContext,
input: Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, CoreError>> + Send>>;
}Expand description
A trait for defining activity types
Activities are the individual units of work that execute within a workflow. They represent operations like API calls, database queries, or Claude decisions.
Required Associated Types§
Required Methods§
Sourcefn activity_type() -> &'static str
fn activity_type() -> &'static str
Get the activity type name
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.