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.

Service Description

AWS Step Functions is a service that lets you coordinate the components of distributed applications and microservices using visual workflows.

You can use Step Functions to build applications from individual components, each of which performs a discrete function, or task, allowing you to scale and change applications quickly. Step Functions provides a console that helps visualize the components of your application as a series of steps. Step Functions automatically triggers and tracks each step, and retries steps when there are errors, so your application executes predictably and in the right order every time. Step Functions logs the state of each step, so you can quickly diagnose and debug any issues.

Step Functions manages operations and underlying infrastructure to ensure your application is available at any scale. You can run tasks on AWS, your own servers, or any system that has access to AWS. You can access and use Step Functions using the console, the AWS SDKs, or an HTTP API. For more information about Step Functions, see the AWS Step Functions Developer Guide .

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

Property Summary

Properties inherited from AWS.Service

apiVersions

Method Summary

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.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean)

    whether to enable endpoint discovery for operations that allow optionally using an endpoint returned by the service. Defaults to 'false'

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to 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 that you write in any programming language and host on any machine that 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.

Note: This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.

Service Reference:

Examples:

Calling the createActivity operation

var params = {
  name: 'STRING_VALUE', /* required */
  tags: [
    {
      key: 'STRING_VALUE',
      value: 'STRING_VALUE'
    },
    /* more items */
  ]
};
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)

    • tags — (Array<map>)

      The list of tags to add to a resource.

      • key — (String)

        The key of a tag.

      • value — (String)

        The value of a tag.

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.

Note: This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.

Service Reference:

Examples:

Calling the createStateMachine operation

var params = {
  definition: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE', /* required */
  roleArn: 'STRING_VALUE', /* required */
  tags: [
    {
      key: 'STRING_VALUE',
      value: 'STRING_VALUE'
    },
    /* more items */
  ]
};
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.

      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. See Amazon States Language.

    • roleArn — (String)

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

    • tags — (Array<map>)

      Tags to be added when creating a state machine.

      • key — (String)

        The key of a tag.

      • value — (String)

        The value of a tag.

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.

Note: This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.

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.

Note: This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.

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.

Note: This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.

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. See Amazon States Language.

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

Note: This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.

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. See Amazon States Language.

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

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

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 nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

Service Reference:

Examples:

Calling the getExecutionHistory operation

var params = {
  executionArn: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  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 1000. 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 nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

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 and time the event occurred.

        • typerequired — (String)

          The type of the event.

          Possible values include:
          • "ActivityFailed"
          • "ActivityScheduleFailed"
          • "ActivityScheduled"
          • "ActivityStarted"
          • "ActivitySucceeded"
          • "ActivityTimedOut"
          • "ChoiceStateEntered"
          • "ChoiceStateExited"
          • "TaskFailed"
          • "TaskScheduled"
          • "TaskStartFailed"
          • "TaskStarted"
          • "TaskSubmitFailed"
          • "TaskSubmitted"
          • "TaskSucceeded"
          • "TaskTimedOut"
          • "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 that 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 that 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 that successfully terminated during an execution.

          • output — (String)

            The JSON data output by the activity task.

        • activityTimedOutEventDetails — (map)

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

          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the timeout.

        • taskFailedEventDetails — (map)

          Contains details about the failure of a task.

          • resourceTyperequired — (String)

            The action of the resource called by a task state.

          • resourcerequired — (String)

            The service name of the resource in a task state.

          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the failure.

        • taskScheduledEventDetails — (map)

          Contains details about a task that was scheduled.

          • resourceTyperequired — (String)

            The action of the resource called by a task state.

          • resourcerequired — (String)

            The service name of the resource in a task state.

          • regionrequired — (String)

            The region of the scheduled task

          • parametersrequired — (String)

            The JSON data passed to the resource referenced in a task state.

          • timeoutInSeconds — (Integer)

            The maximum allowed duration of the task.

        • taskStartFailedEventDetails — (map)

          Contains details about a task that failed to start.

          • resourceTyperequired — (String)

            The action of the resource called by a task state.

          • resourcerequired — (String)

            The service name of the resource in a task state.

          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the failure.

        • taskStartedEventDetails — (map)

          Contains details about a task that was started.

          • resourceTyperequired — (String)

            The action of the resource called by a task state.

          • resourcerequired — (String)

            The service name of the resource in a task state.

        • taskSubmitFailedEventDetails — (map)

          Contains details about a task that where the submit failed.

          • resourceTyperequired — (String)

            The action of the resource called by a task state.

          • resourcerequired — (String)

            The service name of the resource in a task state.

          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the failure.

        • taskSubmittedEventDetails — (map)

          Contains details about a submitted task.

          • resourceTyperequired — (String)

            The action of the resource called by a task state.

          • resourcerequired — (String)

            The service name of the resource in a task state.

          • output — (String)

            The response from a resource when a task has started.

        • taskSucceededEventDetails — (map)

          Contains details about a task that succeeded.

          • resourceTyperequired — (String)

            The action of the resource called by a task state.

          • resourcerequired — (String)

            The service name of the resource in a task state.

          • output — (String)

            The full JSON response from a resource when a task has succeeded. This response becomes the output of the related task.

        • taskTimedOutEventDetails — (map)

          Contains details about a task that timed out.

          • resourceTyperequired — (String)

            The action of the resource called by a task state.

          • resourcerequired — (String)

            The service name of the resource in a task state.

          • error — (String)

            The error code of the failure.

          • cause — (String)

            A more detailed explanation of the cause of the failure.

        • 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 that 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 that 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 that 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 that 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 that terminated successfully during an execution.

          • output — (String)

            The JSON data output by the lambda function.

        • lambdaFunctionTimedOutEventDetails — (map)

          Contains details about a lambda function timeout that 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 nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

Returns:

  • (AWS.Request)

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

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

Lists the existing activities.

If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

Note: This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.

Service Reference:

Examples:

Calling the listActivities operation

var params = {
  maxResults: 'NUMBER_VALUE',
  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 1000. 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 nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

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 nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

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. Results are sorted by time, with the most recent execution first.

If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

Note: This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.

Service Reference:

Examples:

Calling the listExecutions operation

var params = {
  stateMachineArn: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  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 1000. 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 nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

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 nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

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 nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

Note: This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.

Service Reference:

Examples:

Calling the listStateMachines operation

var params = {
  maxResults: 'NUMBER_VALUE',
  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 1000. 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 nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

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 nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

Returns:

  • (AWS.Request)

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

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

List tags for a given resource.

Service Reference:

Examples:

Calling the listTagsForResource operation

var params = {
  resourceArn: 'STRING_VALUE' /* required */
};
stepfunctions.listTagsForResource(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: {})
    • resourceArn — (String)

      The Amazon Resource Name (ARN) for the Step Functions state machine or activity.

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:

      • tags — (Array<map>)

        An array of tags associated with the resource.

        • key — (String)

          The key of a tag.

        • value — (String)

          The value of a tag.

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)

      The error code 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.

Note: StartExecution is idempotent. If StartExecution is called with the same name and input as a running execution, the call will succeed and return the same response as the original request. If the execution is closed or if the input is different, it will return a 400 ExecutionAlreadyExists error. Names can be reused after 90 days.

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, region, and state machine 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)

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

      The error code 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. 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.

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

Add a tag to a Step Functions resource.

Service Reference:

Examples:

Calling the tagResource operation

var params = {
  resourceArn: 'STRING_VALUE', /* required */
  tags: [ /* required */
    {
      key: 'STRING_VALUE',
      value: 'STRING_VALUE'
    },
    /* more items */
  ]
};
stepfunctions.tagResource(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: {})
    • resourceArn — (String)

      The Amazon Resource Name (ARN) for the Step Functions state machine or activity.

    • tags — (Array<map>)

      The list of tags to add to a resource.

      Tags may only contain unicode letters, digits, whitespace, or these symbols: _ . : / = + - @.

      • key — (String)

        The key of a tag.

      • value — (String)

        The value of a tag.

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.

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

Remove a tag from a Step Functions resource

Service Reference:

Examples:

Calling the untagResource operation

var params = {
  resourceArn: 'STRING_VALUE', /* required */
  tagKeys: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
stepfunctions.untagResource(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: {})
    • resourceArn — (String)

      The Amazon Resource Name (ARN) for the Step Functions state machine or activity.

    • tagKeys — (Array<String>)

      The list of tags to remove from the resource.

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.

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. You must include at least one of definition or roleArn or you will receive a MissingRequiredParameter error.

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.

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. See Amazon States Language.

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