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. An activity is a task which you write in any programming language and host on any machine which has access to AWS Step Functions. Activities must poll Step Functions using the GetActivityTask API action and respond using SendTask* API actions. This function lets Step Functions know the existence of your activity and returns an identifier for use in a state machine and when polling from the 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 for 90 days. For more information, see Limits Related to State Machine Executions in the AWS Step Functions Developer Guide.

      A name must not contain:

      • whitespace

      • brackets < > { } [ ]

      • wildcard characters ? *

      • special characters " # % \ ^ | ~ $ & , ; : /

      • control characters (U+0000-001F, U+007F-009F)

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 is created.

Returns:

  • (AWS.Request)

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

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

Creates a state machine. A state machine consists of a collection of states that can do work (Task states), determine to which states to transition next (Choice states), stop an execution with an error (Fail states), and so on. State machines are specified using a JSON-based, structured language.

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 for 90 days. For more information, see Limits Related to State Machine Executions in the AWS Step Functions Developer Guide.

      A name must not contain:

      • whitespace

      • brackets < > { } [ ]

      • wildcard characters ? *

      • special characters " # % \ ^ | ~ $ & , ; : /

      • control characters (U+0000-001F, U+007F-009F)

    • 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 is 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 deletion process. Each state machine execution is deleted the next time it makes a state transition.

Note: The state machine itself is deleted after all executions are completed or deleted.

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.

        A name must not contain:

        • whitespace

        • brackets < > { } [ ]

        • wildcard characters ? *

        • special characters " # % \ ^ | ~ $ & , ; : /

        • control characters (U+0000-001F, U+007F-009F)

      • creationDate — (Date)

        The date the activity is 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.

        A name must not contain:

        • whitespace

        • brackets < > { } [ ]

        • wildcard characters ? *

        • special characters " # % \ ^ | ~ $ & , ; : /

        • control characters (U+0000-001F, U+007F-009F)

      • status — (String)

        The current status of the execution.

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

        The date the execution is started.

      • stopDate — (Date)

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

      • input — (String)

        The string that contains the JSON input data of the execution.

      • output — (String)

        The JSON output data of the execution.

        Note: This field is set only if the execution succeeds. If the execution fails, this field is null.

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.

        A name must not contain:

        • whitespace

        • brackets < > { } [ ]

        • wildcard characters ? *

        • special characters " # % \ ^ | ~ $ & , ; : /

        • control characters (U+0000-001F, U+007F-009F)

      • 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 when creating this state machine. (The IAM role maintains security by granting Step Functions access to AWS resources.)

      • creationDate — (Date)

        The date the state machine is created.

Returns:

  • (AWS.Request)

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

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

Describes the state machine associated with a specific execution.

Examples:

Calling the describeStateMachineForExecution operation

var params = {
  executionArn: 'STRING_VALUE' /* required */
};
stepfunctions.describeStateMachineForExecution(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 you want state machine information for.

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) of the state machine associated with the execution.

      • name — (String)

        The name of the state machine associated with the execution.

      • definition — (String)

        The Amazon States Language definition of the state machine.

      • roleArn — (String)

        The Amazon Resource Name (ARN) of the IAM role of the State Machine for the execution.

      • updateDate — (Date)

        The date and time the state machine associated with an execution was updated. For a newly created state machine, this is the creation date.

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

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 (assigned when you create the task using CreateActivity.)

    • workerName — (String)

      You can provide an arbitrary name in order to identify the worker that the task is assigned to. This name is 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 string that contains 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.

If a nextToken is 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.

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 are returned per call. You can use nextToken to obtain further pages of results. The default is 100 and the maximum allowed page size is 100. A value of 0 uses the default.

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

    • reverseOrder — (Boolean)

      Lists events in descending order of their timeStamp.

    • nextToken — (String)

      If a nextToken is 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 occurred.

        • 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"
          • "TaskStateAborted"
          • "TaskStateEntered"
          • "TaskStateExited"
          • "PassStateEntered"
          • "PassStateExited"
          • "ParallelStateAborted"
          • "ParallelStateEntered"
          • "ParallelStateExited"
          • "ParallelStateFailed"
          • "ParallelStateStarted"
          • "ParallelStateSucceeded"
          • "WaitStateAborted"
          • "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)

          Contains details about an activity which failed during an execution.

          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the failure.

        • activityScheduleFailedEventDetails — (map)

          Contains details about an activity schedule event which failed during an execution.

          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the failure.

        • activityScheduledEventDetails — (map)

          Contains details about an activity scheduled during an execution.

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

          Contains details about the start of an activity during an execution.

          • workerName — (String)

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

        • activitySucceededEventDetails — (map)

          Contains details about an activity which successfully terminated during an execution.

          • output — (String)

            The JSON data output by the activity task.

        • activityTimedOutEventDetails — (map)

          Contains details about an activity timeout which occurred during an execution.

          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the timeout.

        • executionFailedEventDetails — (map)

          Contains details about an execution failure event.

          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the failure.

        • executionStartedEventDetails — (map)

          Contains details about the start of the execution.

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

          Contains details about the successful termination of the execution.

          • output — (String)

            The JSON data output by the execution.

        • executionAbortedEventDetails — (map)

          Contains details about an abort of an execution.

          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the failure.

        • executionTimedOutEventDetails — (map)

          Contains details about the execution timeout which occurred during the execution.

          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the timeout.

        • lambdaFunctionFailedEventDetails — (map)

          Contains details about a lambda function which failed during an execution.

          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the failure.

        • lambdaFunctionScheduleFailedEventDetails — (map)

          Contains details about a failed lambda function schedule event which occurred during an execution.

          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the failure.

        • lambdaFunctionScheduledEventDetails — (map)

          Contains details about a lambda function scheduled during an execution.

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

          Contains details about a lambda function which failed to start during an execution.

          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the failure.

        • lambdaFunctionSucceededEventDetails — (map)

          Contains details about a lambda function which terminated successfully during an execution.

          • output — (String)

            The JSON data output by the lambda function.

        • lambdaFunctionTimedOutEventDetails — (map)

          Contains details about a lambda function timeout which occurred during an execution.

          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the timeout.

        • stateEnteredEventDetails — (map)

          Contains details about a state entered during an execution.

          • namerequired — (String)

            The name of the state.

          • input — (String)

            The string that contains the JSON input data for the state.

        • stateExitedEventDetails — (map)

          Contains details about an exit from a state during an execution.

          • namerequired — (String)

            The name of the state.

            A name must not contain:

            • whitespace

            • brackets < > { } [ ]

            • wildcard characters ? *

            • special characters " # % \ ^ | ~ $ & , ; : /

            • control characters (U+0000-001F, U+007F-009F)

          • output — (String)

            The JSON output data of the state.

      • nextToken — (String)

        If a nextToken is 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.

Returns:

  • (AWS.Request)

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

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

Lists the existing activities.

If a nextToken is 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.

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 are returned per call. You can use nextToken to obtain further pages of results. The default is 100 and the maximum allowed page size is 100. A value of 0 uses the default.

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

    • nextToken — (String)

      If a nextToken is 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.

          A name must not contain:

          • whitespace

          • brackets < > { } [ ]

          • wildcard characters ? *

          • special characters " # % \ ^ | ~ $ & , ; : /

          • control characters (U+0000-001F, U+007F-009F)

        • creationDaterequired — (Date)

          The date the activity is created.

      • nextToken — (String)

        If a nextToken is 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.

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.

If a nextToken is 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.

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 is 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 are returned per call. You can use nextToken to obtain further pages of results. The default is 100 and the maximum allowed page size is 100. A value of 0 uses the default.

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

    • nextToken — (String)

      If a nextToken is 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.

          A name must not contain:

          • whitespace

          • brackets < > { } [ ]

          • wildcard characters ? *

          • special characters " # % \ ^ | ~ $ & , ; : /

          • control characters (U+0000-001F, U+007F-009F)

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

Returns:

  • (AWS.Request)

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

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

Lists the existing state machines.

If a nextToken is 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.

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 are returned per call. You can use nextToken to obtain further pages of results. The default is 100 and the maximum allowed page size is 100. A value of 0 uses the default.

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

    • nextToken — (String)

      If a nextToken is 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.

          A name must not contain:

          • whitespace

          • brackets < > { } [ ]

          • wildcard characters ? *

          • special characters " # % \ ^ | ~ $ & , ; : /

          • control characters (U+0000-001F, U+007F-009F)

        • creationDaterequired — (Date)

          The date the state machine is created.

      • nextToken — (String)

        If a nextToken is 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.

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 contains 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 GetActivityTaskOutput$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 GetActivityTaskOutput$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 for 90 days. For more information, see Limits Related to State Machine Executions in the AWS Step Functions Developer Guide.

      An execution can't use the name of another execution for 90 days.

      When you make multiple StartExecution calls with the same name, the new execution doesn't run and the following rules apply:

      • When the original execution is open and the execution input from the new call is different, the ExecutionAlreadyExists message is returned.

      • When the original execution is open and the execution input from the new call is identical, the Success message is returned.

      • When the original execution is closed, the ExecutionAlreadyExists message is returned regardless of input.

      A name must not contain:

      • whitespace

      • brackets < > { } [ ]

      • wildcard characters ? *

      • special characters " # % \ ^ | ~ $ & , ; : /

      • control characters (U+0000-001F, U+007F-009F)

    • input — (String)

      The string that contains the JSON input data for the execution, for example:

      "input": "{\"first_name\" : \"test\"}"

      Note: If you don't include any JSON input data, you still must include the two braces, for example: "input": "{}"

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 is 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 is stopped.

Returns:

  • (AWS.Request)

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

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

Updates an existing state machine by modifying its definition and/or roleArn. Running executions will continue to use the previous definition and roleArn.

Note: All StartExecution calls within a few seconds will use the updated definition and roleArn. Executions started immediately after calling UpdateStateMachine may use the previous state machine definition and roleArn. You must include at least one of definition or roleArn or you will receive a MissingRequiredParameter error.

Service Reference:

Examples:

Calling the updateStateMachine operation

var params = {
  stateMachineArn: 'STRING_VALUE', /* required */
  definition: 'STRING_VALUE',
  roleArn: 'STRING_VALUE'
};
stepfunctions.updateStateMachine(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.

    • definition — (String)

      The Amazon States Language definition of the state machine.

    • roleArn — (String)

      The Amazon Resource Name (ARN) of the IAM role of the 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:

      • updateDate — (Date)

        The date and time the state machine was updated.

Returns:

  • (AWS.Request)

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