Class: AWS.StepFunctions

Inherits:
AWS.Service show all
Identifier:
stepfunctions
API Version:
2016-11-23
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Sending a Request Using StepFunctions

var stepfunctions = new AWS.StepFunctions();
stepfunctions.createActivity(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the StepFunctions object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var stepfunctions = new AWS.StepFunctions({apiVersion: '2016-11-23'});

You can also set the API version globally in AWS.config.apiVersions using the stepfunctions service identifier:

AWS.config.apiVersions = {
  stepfunctions: '2016-11-23',
  // other service API versions
};

var stepfunctions = new AWS.StepFunctions();

Version:

  • 2016-11-23

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.StepFunctions(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a StepFunctions object

var stepfunctions = new AWS.StepFunctions({apiVersion: '2016-11-23'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com'.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.StepFunctions.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.StepFunctions.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.StepFunctions.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and returns the amount of time to delay in milliseconds. The base option will be ignored if this option is supplied.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

createActivity(params = {}, callback) ⇒ AWS.Request

Creates an activity.

Service Reference:

Examples:

Calling the createActivity operation

var params = {
  name: 'STRING_VALUE' /* required */
};
stepfunctions.createActivity(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • name — (String)

      The name of the activity to create. This name must be unique for your AWS account and region.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • activityArn — (String)

        The Amazon Resource Name (ARN) that identifies the created activity.

      • creationDate — (Date)

        The date the activity was created.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createStateMachine(params = {}, callback) ⇒ AWS.Request

Creates a state machine.

Service Reference:

Examples:

Calling the createStateMachine operation

var params = {
  definition: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE', /* required */
  roleArn: 'STRING_VALUE' /* required */
};
stepfunctions.createStateMachine(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • name — (String)

      The name of the state machine. This name must be unique for your AWS account and region.

    • definition — (String)

      The Amazon States Language definition of the state machine.

    • roleArn — (String)

      The Amazon Resource Name (ARN) of the IAM role to use for this state machine.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • stateMachineArn — (String)

        The Amazon Resource Name (ARN) that identifies the created state machine.

      • creationDate — (Date)

        The date the state machine was created.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteActivity(params = {}, callback) ⇒ AWS.Request

Deletes an activity.

Service Reference:

Examples:

Calling the deleteActivity operation

var params = {
  activityArn: 'STRING_VALUE' /* required */
};
stepfunctions.deleteActivity(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • activityArn — (String)

      The Amazon Resource Name (ARN) of the activity to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteStateMachine(params = {}, callback) ⇒ AWS.Request

Deletes a state machine. This is an asynchronous operation-- it sets the state machine's status to "DELETING" and begins the delete process.

Service Reference:

Examples:

Calling the deleteStateMachine operation

var params = {
  stateMachineArn: 'STRING_VALUE' /* required */
};
stepfunctions.deleteStateMachine(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • stateMachineArn — (String)

      The Amazon Resource Name (ARN) of the state machine to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeActivity(params = {}, callback) ⇒ AWS.Request

Describes an activity.

Service Reference:

Examples:

Calling the describeActivity operation

var params = {
  activityArn: 'STRING_VALUE' /* required */
};
stepfunctions.describeActivity(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • activityArn — (String)

      The Amazon Resource Name (ARN) of the activity to describe.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • activityArn — (String)

        The Amazon Resource Name (ARN) that identifies the activity.

      • name — (String)

        The name of the activity.

      • creationDate — (Date)

        The date the activity was created.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeExecution(params = {}, callback) ⇒ AWS.Request

Describes an execution.

Service Reference:

Examples:

Calling the describeExecution operation

var params = {
  executionArn: 'STRING_VALUE' /* required */
};
stepfunctions.describeExecution(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • executionArn — (String)

      The Amazon Resource Name (ARN) of the execution to describe.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • executionArn — (String)

        The Amazon Resource Name (ARN) that identifies the execution.

      • stateMachineArn — (String)

        The Amazon Resource Name (ARN) of the executed stated machine.

      • name — (String)

        The name of the execution.

      • status — (String)

        The current status of the execution.

        Possible values include:
        • "RUNNING"
        • "SUCCEEDED"
        • "FAILED"
        • "TIMED_OUT"
        • "ABORTED"
      • startDate — (Date)

        The date the execution was started.

      • stopDate — (Date)

        If the execution has already ended, the date the execution stopped.

      • input — (String)

        The JSON input data of the execution.

      • output — (String)

        The JSON output data of the execution.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeStateMachine(params = {}, callback) ⇒ AWS.Request

Describes a state machine.

Service Reference:

Examples:

Calling the describeStateMachine operation

var params = {
  stateMachineArn: 'STRING_VALUE' /* required */
};
stepfunctions.describeStateMachine(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • stateMachineArn — (String)

      The Amazon Resource Name (ARN) of the state machine to describe.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • stateMachineArn — (String)

        The Amazon Resource Name (ARN) that identifies the state machine.

      • name — (String)

        The name of the state machine.

      • status — (String)

        The current status of the state machine.

        Possible values include:
        • "ACTIVE"
        • "DELETING"
      • definition — (String)

        The Amazon States Language definition of the state machine.

      • roleArn — (String)

        The Amazon Resource Name (ARN) of the IAM role used for executing this state machine.

      • creationDate — (Date)

        The date the state machine was created.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getActivityTask(params = {}, callback) ⇒ AWS.Request

Used by workers to retrieve a task (with the specified activity ARN) 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 will return an empty result, that is, the taskToken returned is an empty string.

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).

Service Reference:

Examples:

Calling the getActivityTask operation

var params = {
  activityArn: 'STRING_VALUE', /* required */
  workerName: 'STRING_VALUE'
};
stepfunctions.getActivityTask(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • activityArn — (String)

      The Amazon Resource Name (ARN) of the activity to retrieve tasks from.

    • workerName — (String)

      An arbitrary name may be provided in order to identify the worker that the task is assigned to. This name will be used when it is logged in the execution history.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • taskToken — (String)

        A token that identifies the scheduled task. This token must be copied and included in subsequent calls to SendTaskHeartbeat, SendTaskSuccess or SendTaskFailure in order to report the progress or completion of the task.

      • input — (String)

        The JSON input data for the task.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getExecutionHistory(params = {}, callback) ⇒ AWS.Request

Returns the history of the specified execution as a list of events. By default, the results are returned in ascending order of the timeStamp of the events. Use the reverseOrder parameter to get the latest events first. The results may be split into multiple pages. To retrieve subsequent pages, make the call again using the nextToken returned by the previous call.

Service Reference:

Examples:

Calling the getExecutionHistory operation

var params = {
  executionArn: 'STRING_VALUE', /* required */
  maxResults: 0,
  nextToken: 'STRING_VALUE',
  reverseOrder: true || false
};
stepfunctions.getExecutionHistory(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • executionArn — (String)

      The Amazon Resource Name (ARN) of the execution.

    • maxResults — (Integer)

      The maximum number of results that will be returned per call. nextToken can be used to obtain further pages of results. The default is 100 and the maximum allowed page size is 1000.

      This is an upper limit only; the actual number of results returned per call may be fewer than the specified maximum.

    • reverseOrder — (Boolean)

      Lists events in descending order of their timeStamp.

    • nextToken — (String)

      If a nextToken was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in nextToken. Keep all other arguments unchanged.

      The configured maxResults determines how many results can be returned in a single call.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • events — (Array<map>)

        The list of events that occurred in the execution.

        • timestamprequired — (Date)

          The date the event occured.

        • typerequired — (String)

          The type of the event.

          Possible values include:
          • "ActivityFailed"
          • "ActivityScheduleFailed"
          • "ActivityScheduled"
          • "ActivityStarted"
          • "ActivitySucceeded"
          • "ActivityTimedOut"
          • "ChoiceStateEntered"
          • "ChoiceStateExited"
          • "ExecutionFailed"
          • "ExecutionStarted"
          • "ExecutionSucceeded"
          • "ExecutionAborted"
          • "ExecutionTimedOut"
          • "FailStateEntered"
          • "LambdaFunctionFailed"
          • "LambdaFunctionScheduleFailed"
          • "LambdaFunctionScheduled"
          • "LambdaFunctionStartFailed"
          • "LambdaFunctionStarted"
          • "LambdaFunctionSucceeded"
          • "LambdaFunctionTimedOut"
          • "SucceedStateEntered"
          • "SucceedStateExited"
          • "TaskStateEntered"
          • "TaskStateExited"
          • "PassStateEntered"
          • "PassStateExited"
          • "ParallelStateEntered"
          • "ParallelStateExited"
          • "WaitStateEntered"
          • "WaitStateExited"
        • idrequired — (Integer)

          The id of the event. Events are numbered sequentially, starting at one.

        • previousEventId — (Integer)

          The id of the previous event.

        • activityFailedEventDetails — (map)
          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the failure.

        • activityScheduleFailedEventDetails — (map)
          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the failure.

        • activityScheduledEventDetails — (map)
          • resourcerequired — (String)

            The Amazon Resource Name (ARN) of the scheduled activity.

          • input — (String)

            The JSON data input to the activity task.

          • timeoutInSeconds — (Integer)

            The maximum allowed duration of the activity task.

          • heartbeatInSeconds — (Integer)

            The maximum allowed duration between two heartbeats for the activity task.

        • activityStartedEventDetails — (map)
          • workerName — (String)

            The name of the worker that the task was assigned to. These names are provided by the workers when calling GetActivityTask.

        • activitySucceededEventDetails — (map)
          • output — (String)

            The JSON data output by the activity task.

        • activityTimedOutEventDetails — (map)
          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the timeout.

        • executionFailedEventDetails — (map)
          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the failure.

        • executionStartedEventDetails — (map)
          • input — (String)

            The JSON data input to the execution.

          • roleArn — (String)

            The Amazon Resource Name (ARN) of the IAM role used for executing AWS Lambda tasks.

        • executionSucceededEventDetails — (map)
          • output — (String)

            The JSON data output by the execution.

        • executionAbortedEventDetails — (map)
          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the failure.

        • executionTimedOutEventDetails — (map)
          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the timeout.

        • lambdaFunctionFailedEventDetails — (map)
          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the failure.

        • lambdaFunctionScheduleFailedEventDetails — (map)
          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the failure.

        • lambdaFunctionScheduledEventDetails — (map)
          • resourcerequired — (String)

            The Amazon Resource Name (ARN) of the scheduled lambda function.

          • input — (String)

            The JSON data input to the lambda function.

          • timeoutInSeconds — (Integer)

            The maximum allowed duration of the lambda function.

        • lambdaFunctionStartFailedEventDetails — (map)
          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the failure.

        • lambdaFunctionSucceededEventDetails — (map)
          • output — (String)

            The JSON data output by the lambda function.

        • lambdaFunctionTimedOutEventDetails — (map)
          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the timeout.

        • stateEnteredEventDetails — (map)
          • namerequired — (String)

            The name of the state.

          • input — (String)

            The JSON input data to the state.

        • stateExitedEventDetails — (map)
          • namerequired — (String)

            The name of the state.

          • output — (String)

            The JSON output data of the state.

      • nextToken — (String)

        If a nextToken is returned, there are more results available. To retrieve the next page of results, make the call again using the returned token in nextToken. Keep all other arguments unchanged.

        The configured maxResults determines how many results can be returned in a single call.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listActivities(params = {}, callback) ⇒ AWS.Request

Lists the existing activities. The results may be split into multiple pages. To retrieve subsequent pages, make the call again using the nextToken returned by the previous call.

Service Reference:

Examples:

Calling the listActivities operation

var params = {
  maxResults: 0,
  nextToken: 'STRING_VALUE'
};
stepfunctions.listActivities(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • maxResults — (Integer)

      The maximum number of results that will be returned per call. nextToken can be used to obtain further pages of results. The default is 100 and the maximum allowed page size is 1000.

      This is an upper limit only; the actual number of results returned per call may be fewer than the specified maximum.

    • nextToken — (String)

      If a nextToken was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in nextToken. Keep all other arguments unchanged.

      The configured maxResults determines how many results can be returned in a single call.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • activities — (Array<map>)

        The list of activities.

        • activityArnrequired — (String)

          The Amazon Resource Name (ARN) that identifies the activity.

        • namerequired — (String)

          The name of the activity.

        • creationDaterequired — (Date)

          The date the activity was created.

      • nextToken — (String)

        If a nextToken is returned, there are more results available. To retrieve the next page of results, make the call again using the returned token in nextToken. Keep all other arguments unchanged.

        The configured maxResults determines how many results can be returned in a single call.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listExecutions(params = {}, callback) ⇒ AWS.Request

Lists the executions of a state machine that meet the filtering criteria. The results may be split into multiple pages. To retrieve subsequent pages, make the call again using the nextToken returned by the previous call.

Service Reference:

Examples:

Calling the listExecutions operation

var params = {
  stateMachineArn: 'STRING_VALUE', /* required */
  maxResults: 0,
  nextToken: 'STRING_VALUE',
  statusFilter: RUNNING | SUCCEEDED | FAILED | TIMED_OUT | ABORTED
};
stepfunctions.listExecutions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • stateMachineArn — (String)

      The Amazon Resource Name (ARN) of the state machine whose executions will be listed.

    • statusFilter — (String)

      If specified, only list the executions whose current execution status matches the given filter.

      Possible values include:
      • "RUNNING"
      • "SUCCEEDED"
      • "FAILED"
      • "TIMED_OUT"
      • "ABORTED"
    • maxResults — (Integer)

      The maximum number of results that will be returned per call. nextToken can be used to obtain further pages of results. The default is 100 and the maximum allowed page size is 1000.

      This is an upper limit only; the actual number of results returned per call may be fewer than the specified maximum.

    • nextToken — (String)

      If a nextToken was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in nextToken. Keep all other arguments unchanged.

      The configured maxResults determines how many results can be returned in a single call.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • executions — (Array<map>)

        The list of matching executions.

        • executionArnrequired — (String)

          The Amazon Resource Name (ARN) that identifies the execution.

        • stateMachineArnrequired — (String)

          The Amazon Resource Name (ARN) of the executed state machine.

        • namerequired — (String)

          The name of the execution.

        • statusrequired — (String)

          The current status of the execution.

          Possible values include:
          • "RUNNING"
          • "SUCCEEDED"
          • "FAILED"
          • "TIMED_OUT"
          • "ABORTED"
        • startDaterequired — (Date)

          The date the execution started.

        • stopDate — (Date)

          If the execution already ended, the date the execution stopped.

      • nextToken — (String)

        If a nextToken is returned, there are more results available. To retrieve the next page of results, make the call again using the returned token in nextToken. Keep all other arguments unchanged.

        The configured maxResults determines how many results can be returned in a single call.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listStateMachines(params = {}, callback) ⇒ AWS.Request

Lists the existing state machines. The results may be split into multiple pages. To retrieve subsequent pages, make the call again using the nextToken returned by the previous call.

Service Reference:

Examples:

Calling the listStateMachines operation

var params = {
  maxResults: 0,
  nextToken: 'STRING_VALUE'
};
stepfunctions.listStateMachines(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • maxResults — (Integer)

      The maximum number of results that will be returned per call. nextToken can be used to obtain further pages of results. The default is 100 and the maximum allowed page size is 1000.

      This is an upper limit only; the actual number of results returned per call may be fewer than the specified maximum.

    • nextToken — (String)

      If a nextToken was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in nextToken. Keep all other arguments unchanged.

      The configured maxResults determines how many results can be returned in a single call.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • stateMachines — (Array<map>)
        • stateMachineArnrequired — (String)

          The Amazon Resource Name (ARN) that identifies the state machine.

        • namerequired — (String)

          The name of the state machine.

        • creationDaterequired — (Date)

          The date the state machine was created.

      • nextToken — (String)

        If a nextToken is returned, there are more results available. To retrieve the next page of results, make the call again using the returned token in nextToken. Keep all other arguments unchanged.

        The configured maxResults determines how many results can be returned in a single call.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

sendTaskFailure(params = {}, callback) ⇒ AWS.Request

Used by workers to report that the task identified by the taskToken failed.

Service Reference:

Examples:

Calling the sendTaskFailure operation

var params = {
  taskToken: 'STRING_VALUE', /* required */
  cause: 'STRING_VALUE',
  error: 'STRING_VALUE'
};
stepfunctions.sendTaskFailure(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • taskToken — (String)

      The token that represents this task. Task tokens are generated by the service when the tasks are assigned to a worker (see GetActivityTask::taskToken).

    • error — (String)

      An arbitrary error code that identifies the cause of the failure.

    • cause — (String)

      A more detailed explanation of the cause of the failure.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

sendTaskHeartbeat(params = {}, callback) ⇒ AWS.Request

Used by workers to report to the service that the task represented by the specified taskToken is still making progress. This action resets the Heartbeat clock. The Heartbeat threshold is specified in the state machine's Amazon States Language definition. This action does not in itself create an event in the execution history. However, if the task times out, the execution history will contain an ActivityTimedOut event.

Note: The Timeout of a task, defined in the state machine's Amazon States Language definition, is its maximum allowed duration, regardless of the number of SendTaskHeartbeat requests received.
Note: This operation is only useful for long-lived tasks to report the liveliness of the task.

Service Reference:

Examples:

Calling the sendTaskHeartbeat operation

var params = {
  taskToken: 'STRING_VALUE' /* required */
};
stepfunctions.sendTaskHeartbeat(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • taskToken — (String)

      The token that represents this task. Task tokens are generated by the service when the tasks are assigned to a worker (see GetActivityTask::taskToken).

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

sendTaskSuccess(params = {}, callback) ⇒ AWS.Request

Used by workers to report that the task identified by the taskToken completed successfully.

Service Reference:

Examples:

Calling the sendTaskSuccess operation

var params = {
  output: 'STRING_VALUE', /* required */
  taskToken: 'STRING_VALUE' /* required */
};
stepfunctions.sendTaskSuccess(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • taskToken — (String)

      The token that represents this task. Task tokens are generated by the service when the tasks are assigned to a worker (see GetActivityTask::taskToken).

    • output — (String)

      The JSON output of the task.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

startExecution(params = {}, callback) ⇒ AWS.Request

Starts a state machine execution.

Service Reference:

Examples:

Calling the startExecution operation

var params = {
  stateMachineArn: 'STRING_VALUE', /* required */
  input: 'STRING_VALUE',
  name: 'STRING_VALUE'
};
stepfunctions.startExecution(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • stateMachineArn — (String)

      The Amazon Resource Name (ARN) of the state machine to execute.

    • name — (String)

      The name of the execution. This name must be unique for your AWS account and region.

    • input — (String)

      The JSON input data for the execution.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • executionArn — (String)

        The Amazon Resource Name (ARN) that identifies the execution.

      • startDate — (Date)

        The date the execution was started.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

stopExecution(params = {}, callback) ⇒ AWS.Request

Stops an execution.

Service Reference:

Examples:

Calling the stopExecution operation

var params = {
  executionArn: 'STRING_VALUE', /* required */
  cause: 'STRING_VALUE',
  error: 'STRING_VALUE'
};
stepfunctions.stopExecution(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • executionArn — (String)

      The Amazon Resource Name (ARN) of the execution to stop.

    • error — (String)

      An arbitrary error code that identifies the cause of the termination.

    • cause — (String)

      A more detailed explanation of the cause of the termination.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • stopDate — (Date)

        The date the execution was stopped.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.