By default, an async node created from a UBlueprintAsyncActionBase subclass does not expose the task object. However, if you create a helper class like UCancellableAsyncAction that provides a Cancel() method and use ExposedAsyncProxy in your implementation, the resulting Blueprint node will feature an extra output pin. This pin provides a reference to the async action instance, enabling the user to call Cancel() on it later in the Blueprint graph.
// Base class providing cancellation logic
UCLASS(Abstract, BlueprintType, meta = (ExposedAsyncProxy = AsyncAction), MinimalAPI)
class UCancellableAsyncAction : public UBlueprintAsyncActionBase
{
UFUNCTION(BlueprintCallable, Category = "Async Action")
ENGINE_API virtual void Cancel();
};
// Implementation using the proxy
UCLASS(Blueprintable, BlueprintType, meta = (ExposedAsyncProxy = MyAsyncObject))
class INSIDER_API UMyFunction_Async : public UCancellableAsyncAction
{
GENERATED_BODY()
};