AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Used by workers to retrieve a task (with the specified activity ARN) which has been scheduled for execution by a running state machine. This initiates a long poll, where the service holds the HTTP connection open and responds as soon as a task becomes available (i.e. an execution of a task of this type is needed.) The maximum time the service holds on to the request before responding is 60 seconds. If no task is available within 60 seconds, the poll returns a taskToken with a null string.

This API action isn't logged in CloudTrail.

Workers should set their client side socket timeout to at least 65 seconds (5 seconds higher than the maximum time the service may hold the poll request).

Polling with GetActivityTask can cause latency in some implementations. See Avoid Latency When Polling for Activity Tasks in the Step Functions Developer Guide.

Note:

This is an asynchronous operation using the standard naming convention for .NET 4.5 or higher. For .NET 3.5 the operation is implemented as a pair of methods using the standard naming convention of BeginGetActivityTask and EndGetActivityTask.

Namespace: Amazon.StepFunctions
Assembly: AWSSDK.StepFunctions.dll
Version: 3.x.y.z

Syntax

C#
public virtual Task<GetActivityTaskResponse> GetActivityTaskAsync(
         GetActivityTaskRequest request,
         CancellationToken cancellationToken
)

Parameters

request
Type: Amazon.StepFunctions.Model.GetActivityTaskRequest

Container for the necessary parameters to execute the GetActivityTask service method.

cancellationToken
Type: System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Return Value


The response from the GetActivityTask service method, as returned by StepFunctions.

Exceptions

ExceptionCondition
ActivityDoesNotExistException The specified activity does not exist.
ActivityWorkerLimitExceededException The maximum number of workers concurrently polling for activity tasks has been reached.
InvalidArnException The provided Amazon Resource Name (ARN) is not valid.

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5

See Also