Class: AWS.StepFunctions
- Inherits:
-
AWS.Service
- Object
- AWS.Service
- AWS.StepFunctions
- 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();
Constructor Summary
-
new AWS.StepFunctions(options = {}) ⇒ Object
constructor
Constructs a service object.
Property Summary
-
endpoint ⇒ AWS.Endpoint
readwrite
An Endpoint object representing the endpoint URL for service requests.
Properties inherited from AWS.Service
Method Summary
-
createActivity(params = {}, callback) ⇒ AWS.Request
Creates an activity.
-
createStateMachine(params = {}, callback) ⇒ AWS.Request
Creates a state machine.
-
deleteActivity(params = {}, callback) ⇒ AWS.Request
Deletes an activity.
-
deleteStateMachine(params = {}, callback) ⇒ AWS.Request
Deletes a state machine.
-
describeActivity(params = {}, callback) ⇒ AWS.Request
Describes an activity.
-
describeExecution(params = {}, callback) ⇒ AWS.Request
Describes an execution.
-
describeStateMachine(params = {}, callback) ⇒ AWS.Request
Describes a state machine.
-
describeStateMachineForExecution(params = {}, callback) ⇒ AWS.Request
Describes the state machine associated with a specific execution.
-
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.
-
getExecutionHistory(params = {}, callback) ⇒ AWS.Request
Returns the history of the specified execution as a list of events.
-
listActivities(params = {}, callback) ⇒ AWS.Request
Lists the existing activities.
-
listExecutions(params = {}, callback) ⇒ AWS.Request
Lists the executions of a state machine that meet the filtering criteria.
-
listStateMachines(params = {}, callback) ⇒ AWS.Request
Lists the existing state machines.
-
listTagsForResource(params = {}, callback) ⇒ AWS.Request
List tags for a given resource.
-
sendTaskFailure(params = {}, callback) ⇒ AWS.Request
Used by workers to report that the task identified by the taskToken failed.
-
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.
-
sendTaskSuccess(params = {}, callback) ⇒ AWS.Request
Used by workers to report that the task identified by the taskToken completed successfully.
-
startExecution(params = {}, callback) ⇒ AWS.Request
Starts a state machine execution.
-
stopExecution(params = {}, callback) ⇒ AWS.Request
Stops an execution.
-
tagResource(params = {}, callback) ⇒ AWS.Request
Add a tag to a Step Functions resource.
-
untagResource(params = {}, callback) ⇒ AWS.Request
Remove a tag from a Step Functions resource.
-
updateStateMachine(params = {}, callback) ⇒ AWS.Request
Updates an existing state machine by modifying its definition and/or roleArn.
Methods inherited from AWS.Service
makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService
Constructor Details
Property Details
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.
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.
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.
describeActivity(params = {}, callback) ⇒ AWS.Request
Describes an activity.
describeExecution(params = {}, callback) ⇒ AWS.Request
Describes an execution.
describeStateMachine(params = {}, callback) ⇒ AWS.Request
Describes a state machine.
describeStateMachineForExecution(params = {}, callback) ⇒ AWS.Request
Describes the state machine associated with a specific execution.
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.
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.
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.
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.
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.
sendTaskFailure(params = {}, callback) ⇒ AWS.Request
Used by workers to report that the task identified by the taskToken
failed.
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.
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. sendTaskSuccess(params = {}, callback) ⇒ AWS.Request
Used by workers to report that the task identified by the taskToken
completed successfully.
startExecution(params = {}, callback) ⇒ AWS.Request
Starts a state machine execution.
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. 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.
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
.