Skip to content

ActivityHandler

dart
abstract interface class ActivityHandler<I, O> {
  Future<O> handle(ActivityContext context, I input);
}

ActivityHandler.from((context, input) async => ...) is the function form. Bind handlers in a WorkflowModule with ActivityBinding.from.

ActivityContext provides:

  • runId, commandId, operationKey, attempt
  • idempotencyKey
  • heartbeat()

Graph TaskExecutor and TaskSuccess / TaskFailure effects are legacy.

See Also