This documentation is for the developer preview release of the AWS CDK. Do not use this version of the AWS CDK in production. Subsequent releases of the AWS CDK will likely include breaking changes.

@aws-cdk/aws-stepfunctions

AWS Step Functions Construct Library

The @aws-cdk/aws-stepfunctions package contains constructs for building serverless workflows. Using objects. Defining a workflow looks like this (for the Step Functions Job Poller example):

TypeScript example

const submitLambda = new lambda.Function(this, 'SubmitLambda', { ... });
const getStatusLambda = new lambda.Function(this, 'CheckLambda', { ... });

const submitJob = new stepfunctions.Task(this, 'Submit Job', {
    resource: submitLambda,
    // Put Lambda's result here in the execution's state object
    resultPath: '$.guid',
});

const waitX = new stepfunctions.Wait(this, 'Wait X Seconds', { secondsPath: '$.wait_time' });

const getStatus = new stepfunctions.Task(this, 'Get Job Status', {
    resource: getStatusLambda,
    // Pass just the field named "guid" into the Lambda, put the
    // Lambda's result in a field called "status"
    inputPath: '$.guid',
    resultPath: '$.status',
});

const jobFailed = new stepfunctions.Fail(this, 'Job Failed', {
    cause: 'AWS Batch Job Failed',
    error: 'DescribeJob returned FAILED',
});

const finalStatus = new stepfunctions.Task(this, 'Get Final Job Status', {
    resource: getStatusLambda,
    // Use "guid" field as input, output of the Lambda becomes the
    // entire state machine output.
    inputPath: '$.guid',
});

const definition = submitJob
    .next(waitX)
    .next(getStatus)
    .next(new stepfunctions.Choice(this, 'Job Complete?')
        // Look at the "status" field
        .when(stepfunctions.Condition.stringEquals('$.status', 'FAILED'), jobFailed)
        .when(stepfunctions.Condition.stringEquals('$.status', 'SUCCEEDED'), finalStatus)
        .otherwise(waitX));

new stepfunctions.StateMachine(this, 'StateMachine', {
    definition,
    timeoutSec: 300
});

.NET Example

var submitLambda = new Function(this, "SubmitLambda", new FunctionProps
{
    // ...
});

var getStatusLambda = new Function(this, "CheckLambda", new FunctionProps
{
    // ...
});

var submitJob = new Task(this, "Submit Job", new TaskProps
{
    Resource = submitLambda,
    ResultPath = "$.guid"
});

var waitX = new Wait(this, "Wait X Seconds", new WaitProps
{
    SecondsPath = "$.wait_time"
});

var getStatus = new Task(this, "Get Job Status", new TaskProps
{
    Resource = getStatusLambda,
    InputPath = "$.guid",
    ResultPath = "$.status"
});

var jobFailed = new Fail(this, "Job Failed", new FailProps
{
    Cause = "AWS Batch Job Failed",
    Error = "DescribeJob returned FAILED"
});

var finalStatus = new Task(this, "Get Final Job Status", new TaskProps
{
    Resource = getStatusLambda,
    // Use "guid" field as input, output of the Lambda becomes the
    // entire state machine output.
    InputPath = "$.guid"
});

var definition = submitJob
    .Next(waitX)
    .Next(getStatus)
    .Next(new Choice(this, "Job Complete?", new ChoiceProps())
        .When(Amazon.CDK.AWS.StepFunctions.Condition.StringEquals("$.status", "FAILED"), jobFailed)
        .When(Amazon.CDK.AWS.StepFunctions.Condition.StringEquals("$.status", "SUCCEEDED"), finalStatus)
        .Otherwise(waitX));

new StateMachine(this, "StateMachine", new StateMachineProps
{
    Definition = definition,
    TimeoutSec = 300
});

State Machine

A stepfunctions.StateMachine is a resource that takes a state machine definition. The definition is specified by its start state, and encompasses all states reachable from the start state:

const startState = new stepfunctions.Pass(this, 'StartState');

new stepfunctions.StateMachine(this, 'StateMachine', {
    definition: startState
});

State machines execute using an IAM Role, which will automatically have all permissions added that are required to make all state machine tasks execute properly (for example, permissions to invoke any Lambda functions you add to your workflow). A role will be created by default, but you can supply an existing one as well.

Amazon States Language

This library comes with a set of classes that model the Amazon States Language. The following State classes are supported:

  • Task
  • Pass
  • Wait
  • Choice
  • Parallel
  • Succeed
  • Fail

An arbitrary JSON object (specified at execution start) is passed from state to state and transformed during the execution of the workflow. For more information, see the States Language spec.

Task

A Task represents some work that needs to be done. It takes a resource property that is either a Lambda Function or a Step Functions Activity (A Lambda Function runs your task’s code on AWS Lambda, whereas an Activity is used to run your task’s code on an arbitrary compute fleet you manage).

const task = new stepfunctions.Task(this, 'Invoke The Lambda', {
    resource: myLambda,
    inputPath: '$.input',
    timeoutSeconds: 300,
});

// Add a retry policy
task.addRetry({
    intervalSeconds: 5,
    maxAttempts: 10
});

// Add an error handler
task.addCatch(errorHandlerState);

// Set the next state
task.next(nextState);

Pass

A Pass state does no work, but it can optionally transform the execution’s JSON state.

// Makes the current JSON state { ..., "subObject": { "hello": "world" } }
const pass = new stepfunctions.Pass(this, 'Add Hello World', {
    result: { hello: "world" },
    resultPath: '$.subObject',
});

// Set the next state
pass.next(nextState);

Wait

A Wait state waits for a given number of seconds, or until the current time hits a particular time. The time to wait may be taken from the execution’s JSON state.

// Wait until it's the time mentioned in the the state object's "triggerTime"
// field.
const wait = new stepfunctions.Wait(this, 'Wait For Trigger Time', {
    timestampPath: '$.triggerTime',
});

// Set the next state
wait.next(startTheWork);

Choice

A Choice state can take a differen path through the workflow based on the values in the execution’s JSON state:

const choice = new stepfunctions.Choice(this, 'Did it work?');

// Add conditions with .when()
choice.when(stepfunctions.Condition.stringEqual('$.status', 'SUCCESS'), successState);
choice.when(stepfunctions.Condition.numberGreaterThan('$.attempts', 5), failureState);

// Use .otherwise() to indicate what should be done if none of the conditions match
choice.otherwise(tryAgainState);

If you want to temporarily branch your workflow based on a condition, but have all branches come together and continuing as one (similar to how an if ... then ... else works in a programming language), use the .afterwards() method:

const choice = new stepfunctions.Choice(this, 'What color is it?');
choice.when(stepfunctions.Condition.stringEqual('$.color', 'BLUE'), handleBlueItem);
choice.when(stepfunctions.Condition.stringEqual('$.color', 'RED'), handleRedItem);
choice.otherwise(handleOtherItemColor);

// Use .afterwards() to join all possible paths back together and continue
choice.afterwards().next(shipTheItem);

If your Choice doesn’t have an otherwise() and none of the conditions match the JSON state, a NoChoiceMatched error will be thrown. Wrap the state machine in a Parallel state if you want to catch and recover from this.

Parallel

A Parallel state executes one or more subworkflows in parallel. It can also be used to catch and recover from errors in subworkflows.

const parallel = new stepfunctions.Parallel(this, 'Do the work in parallel');

// Add branches to be executed in parallel
parallel.branch(shipItem);
parallel.branch(sendInvoice);
parallel.branch(restock);

// Retry the whole workflow if something goes wrong
parallel.addRetry({ maxAttempts: 1 });

// How to recover from errors
parallel.addCatch(sendFailureNotification);

// What to do in case everything succeeded
parallel.next(closeOrder);

Succeed

Reaching a Succeed state terminates the state machine execution with a succesful status.

const success = new stepfunctions.Succeed(this, 'We did it!');

Fail

Reaching a Fail state terminates the state machine execution with a failure status. The fail state should report the reason for the failure. Failures can be caught by encompassing Parallel states.

const success = new stepfunctions.Fail(this, 'Fail', {
    error: 'WorkflowFailure',
    cause: "Something went wrong"
});

Task Chaining

To make defining work flows as convenient (and readable in a top-to-bottom way) as writing regular programs, it is possible to chain most methods invocations. In particular, the .next() method can be repeated. The result of a series of .next() calls is called a Chain, and can be used when defining the jump targets of Choice.on or Parallel.branch:

const definition = step1
    .next(step2)
    .next(choice
        .when(condition1, step3.next(step4).next(step5))
        .otherwise(step6)
        .afterwards())
    .next(parallel
        .branch(step7.next(step8))
        .branch(step9.next(step10)))
    .next(finish);

new stepfunctions.StateMachine(this, 'StateMachine', {
    definition,
});

If you don’t like the visual look of starting a chain directly off the first step, you can use Chain.start:

const definition = stepfunctions.Chain
    .start(step1)
    .next(step2)
    .next(step3)
    // ...

State Machine Fragments

It is possible to define reusable (or abstracted) mini-state machines by defining a construct that implements IChainable, which requires you to define two fields:

  • startState: State, representing the entry point into this state machine.
  • endStates: INextable[], representing the (one or more) states that outgoing transitions will be added to if you chain onto the fragment.

Since states will be named after their construct IDs, you may need to prefix the IDs of states if you plan to instantiate the same state machine fragment multiples times (otherwise all states in every instantiation would have the same name).

The class StateMachineFragment contains some helper functions (like prefixStates()) to make it easier for you to do this. If you define your state machine as a subclass of this, it will be convenient to use:

interface MyJobProps {
    jobFlavor: string;
}

class MyJob extends stepfunctions.StateMachineFragment {
    public readonly startState: State;
    public readonly endStates: INextable[];

    constructor(parent: cdk.Construct, id: string, props: MyJobProps) {
        super(parent, id);

        const first = new stepfunctions.Task(this, 'First', { ... });
        // ...
        const last = new stepfunctions.Task(this, 'Last', { ... });

        this.startState = first;
        this.endStates = [last];
    }
}

// Do 3 different variants of MyJob in parallel
new stepfunctions.Parallel(this, 'All jobs')
    .branch(new MyJob(this, 'Quick', { jobFlavor: 'quick' }).prefixStates())
    .branch(new MyJob(this, 'Medium', { jobFlavor: 'medium' }).prefixStates())
    .branch(new MyJob(this, 'Slow', { jobFlavor: 'slow' }).prefixStates());

Activity

Activities represent work that is done on some non-Lambda worker pool. The Step Functions workflow will submit work to this Activity, and a worker pool that you run yourself, probably on EC2, will pull jobs from the Activity and submit the results of individual jobs back.

You need the ARN to do so, so if you use Activities be sure to pass the Activity ARN into your worker pool:

const activity = new stepfunctions.Activity(this, 'Activity');

// Read this Output from your application and use it to poll for work on
// the activity.
new cdk.Output(this, 'ActivityArn', { value: activity.activityArn });

Metrics

Task object expose various metrics on the execution of that particular task. For example, to create an alarm on a particular task failing:

new cloudwatch.Alarm(this, 'TaskAlarm', {
    metric: task.metricFailed(),
    threshold: 1,
    evaluationPeriods: 1,
});

There are also metrics on the complete state machine:

new cloudwatch.Alarm(this, 'StateMachineAlarm', {
    metric: stateMachine.metricFailed(),
    threshold: 1,
    evaluationPeriods: 1,
});

And there are metrics on the capacity of all state machines in your account:

new cloudwatch.Alarm(this, 'ThrottledAlarm', {
    metric: StateTransitionMetrics.metricThrottledEvents(),
    threshold: 10,
    evaluationPeriods: 2,
});

Future work

Contributions welcome:

  • [ ] A single LambdaTask class that is both a Lambda and a Task in one might make for a nice API.
  • [ ] Expression parser for Conditions.
  • [ ] Simulate state machines in unit tests.

Reference

View in Nuget

csproj:

<PackageReference Include="Amazon.CDK.AWS.StepFunctions" Version="0.24.1" />

dotnet:

dotnet add package Amazon.CDK.AWS.StepFunctions --version 0.24.1

packages.config:

<package id="Amazon.CDK.AWS.StepFunctions" version="0.24.1" />

View in Maven Central

Apache Buildr:

'software.amazon.awscdk:stepfunctions:jar:0.24.1'

Apache Ivy:

<dependency groupId="software.amazon.awscdk" name="stepfunctions" rev="0.24.1"/>

Apache Maven:

<dependency>
  <groupId>software.amazon.awscdk</groupId>
  <artifactId>stepfunctions</artifactId>
  <version>0.24.1</version>
</dependency>

Gradle / Grails:

compile 'software.amazon.awscdk:stepfunctions:0.24.1'

Groovy Grape:

@Grapes(
@Grab(group='software.amazon.awscdk', module='stepfunctions', version='0.24.1')
)

View in NPM

npm:

$ npm i @aws-cdk/aws-stepfunctions@0.24.1

package.json:

{
  "@aws-cdk/aws-stepfunctions": "^0.24.1"
}

yarn:

$ yarn add @aws-cdk/aws-stepfunctions@0.24.1

View in NPM

npm:

$ npm i @aws-cdk/aws-stepfunctions@0.24.1

package.json:

{
  "@aws-cdk/aws-stepfunctions": "^0.24.1"
}

yarn:

$ yarn add @aws-cdk/aws-stepfunctions@0.24.1

Activity

class @aws-cdk/aws-stepfunctions.Activity(scope, id[, props])

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.Activity;
const { Activity } = require('@aws-cdk/aws-stepfunctions');
import { Activity } from '@aws-cdk/aws-stepfunctions';

Define a new StepFunctions activity

Extends:

@aws-cdk/cdk.Construct

Implements:

IStepFunctionsTaskResource

Parameters:
asStepFunctionsTaskResource(_callingTask) → @aws-cdk/aws-stepfunctions.StepFunctionsTaskResourceProps

Implements @aws-cdk/aws-stepfunctions.IStepFunctionsTaskResource.asStepFunctionsTaskResource()

Return the properties required for using this object as a Task resource

Parameters:_callingTask (Task) –
Return type:StepFunctionsTaskResourceProps
metric(metricName[, props]) → @aws-cdk/aws-cloudwatch.Metric

Return the given named metric for this Activity

Parameters:
Return type:

@aws-cdk/aws-cloudwatch.Metric

metricFailed([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of times this activity fails

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricHeartbeatTimedOut([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of times the heartbeat times out for this activity

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricRunTime([props]) → @aws-cdk/aws-cloudwatch.Metric

The interval, in milliseconds, between the time the activity starts and the time it closes.

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricScheduled([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of times this activity is scheduled

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricScheduleTime([props]) → @aws-cdk/aws-cloudwatch.Metric

The interval, in milliseconds, for which the activity stays in the schedule state.

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricStarted([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of times this activity is started

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricSucceeded([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of times this activity succeeds

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricTime([props]) → @aws-cdk/aws-cloudwatch.Metric

The interval, in milliseconds, between the time the activity is scheduled and the time it closes.

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricTimedOut([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of times this activity times out

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
activityArn
Type:string (readonly)
activityName
Type:string (readonly)
apply(aspect)

Inherited from @aws-cdk/cdk.Construct

Applies the aspect to this Constructs node

Parameters:aspect (@aws-cdk/cdk.IAspect) –
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

ActivityProps (interface)

class @aws-cdk/aws-stepfunctions.ActivityProps

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.ActivityProps;
// ActivityProps is an interface
import { ActivityProps } from '@aws-cdk/aws-stepfunctions';
activityName

The name for this activity.

Type:string (optional)
Default:If not supplied, a name is generated

AfterwardsOptions (interface)

class @aws-cdk/aws-stepfunctions.AfterwardsOptions

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.AfterwardsOptions;
// AfterwardsOptions is an interface
import { AfterwardsOptions } from '@aws-cdk/aws-stepfunctions';

Options for selecting the choice paths

includeErrorHandlers

Whether to include error handling states

If this is true, all states which are error handlers (added through ‘onError’)

and states reachable via error handlers will be included as well.

Type:boolean (optional)
Default:false
includeOtherwise

Whether to include the default/otherwise transition for the current Choice state

If this is true and the current Choice does not have a default outgoing

transition, one will be added included when .next() is called on the chain.

Type:boolean (optional)
Default:false

CatchProps (interface)

class @aws-cdk/aws-stepfunctions.CatchProps

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.CatchProps;
// CatchProps is an interface
import { CatchProps } from '@aws-cdk/aws-stepfunctions';

Error handler details

errors

Errors to recover from by going to the given state

A list of error strings to retry, which can be either predefined errors

(for example Errors.NoChoiceMatched) or a self-defined error.

Type:string[] (optional)
Default:All errors
resultPath

JSONPath expression to indicate where to inject the error data

May also be the special value DISCARD, which will cause the error

data to be discarded.

Type:string (optional)
Default:$

CfnActivity

class @aws-cdk/aws-stepfunctions.CfnActivity(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.CfnActivity;
const { CfnActivity } = require('@aws-cdk/aws-stepfunctions');
import { CfnActivity } from '@aws-cdk/aws-stepfunctions';
Extends:

@aws-cdk/cdk.Resource

Parameters:
renderProperties(properties) → string => any

Overrides @aws-cdk/cdk.Resource.renderProperties()

Protected method

Parameters:properties (any) –
Return type:string => any
resourceTypeName

The CloudFormation resource type name for this resource class.

Type:string (readonly) (static)
activityArn
Type:string (readonly)
activityName
Type:string (readonly)
propertyOverrides
Type:CfnActivityProps (readonly)
apply(aspect)

Inherited from @aws-cdk/cdk.Construct

Applies the aspect to this Constructs node

Parameters:aspect (@aws-cdk/cdk.IAspect) –
toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)
ref

Inherited from @aws-cdk/cdk.Referenceable

Returns a token to a CloudFormation { Ref } that references this entity based on it’s logical ID.

Type:string (readonly)
addDeletionOverride(path)

Inherited from @aws-cdk/cdk.Resource

Syntactic sugar for addOverride(path, undefined).

Parameters:path (string) – The path of the value to delete
addDependsOn(resource)

Inherited from @aws-cdk/cdk.Resource

Indicates that this resource depends on another resource and cannot be provisioned

unless the other resource has been successfully provisioned.

Parameters:resource (@aws-cdk/cdk.Resource) –
addOverride(path, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to the synthesized CloudFormation resource. To add a

property override, either use addPropertyOverride or prefix path with

“Properties.” (i.e. Properties.TopicName).

Parameters:
  • path (string) – The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
  • value (any) – The value. Could be primitive or complex.
addPropertyDeletionOverride(propertyPath)

Inherited from @aws-cdk/cdk.Resource

Adds an override that deletes the value of a property from the resource definition.

Parameters:propertyPath (string) – The path to the property.
addPropertyOverride(propertyPath, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to a resource property.

Syntactic sugar for addOverride(“Properties.<…>”, value).

Parameters:
  • propertyPath (string) – The path of the property
  • value (any) – The value
getAtt(attributeName) → @aws-cdk/cdk.CfnReference

Inherited from @aws-cdk/cdk.Resource

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility

in case there is no generated attribute.

Parameters:attributeName (string) – The name of the attribute.
Return type:@aws-cdk/cdk.CfnReference
toCloudFormation() → json

Inherited from @aws-cdk/cdk.Resource

Emits CloudFormation for this resource.

Return type:json
options

Inherited from @aws-cdk/cdk.Resource

Options for this resource, such as condition, update policy etc.

Type:@aws-cdk/cdk.ResourceOptions (readonly)
properties

Inherited from @aws-cdk/cdk.Resource

AWS resource properties.

This object is rendered via a call to “renderProperties(this.properties)”.

Protected property

Type:any (readonly)
resourceType

Inherited from @aws-cdk/cdk.Resource

AWS resource type.

Type:string (readonly)
untypedPropertyOverrides

Inherited from @aws-cdk/cdk.Resource

AWS resource property overrides.

During synthesis, the method “renderProperties(this.overrides)” is called

with this object, and merged on top of the output of

“renderProperties(this.properties)”.

Derived classes should expose a strongly-typed version of this object as

a public property called propertyOverrides.

Protected property

Type:any (readonly)
overrideLogicalId(newLogicalId)

Inherited from @aws-cdk/cdk.StackElement

Overrides the auto-generated logical ID with a specific ID.

Parameters:newLogicalId (string) – The new logical ID to use for this stack element.
prepare()

Inherited from @aws-cdk/cdk.StackElement

Automatically detect references in this StackElement

Protected method

creationStackTrace

Inherited from @aws-cdk/cdk.StackElement

Type:string[] (readonly)
logicalId

Inherited from @aws-cdk/cdk.StackElement

The logical ID for this CloudFormation stack element. The logical ID of the element

is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Type:string (readonly)
stackPath

Inherited from @aws-cdk/cdk.StackElement

Return the path with respect to the stack

Type:string (readonly)
stack

Inherited from @aws-cdk/cdk.StackElement

The stack this Construct has been made a part of

Protected property

Type:@aws-cdk/cdk.Stack

CfnActivityProps (interface)

class @aws-cdk/aws-stepfunctions.CfnActivityProps

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.CfnActivityProps;
// CfnActivityProps is an interface
import { CfnActivityProps } from '@aws-cdk/aws-stepfunctions';
name

AWS::StepFunctions::Activity.Name

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-activity.html#cfn-stepfunctions-activity-name

Type:string

CfnStateMachine

class @aws-cdk/aws-stepfunctions.CfnStateMachine(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.CfnStateMachine;
const { CfnStateMachine } = require('@aws-cdk/aws-stepfunctions');
import { CfnStateMachine } from '@aws-cdk/aws-stepfunctions';
Extends:

@aws-cdk/cdk.Resource

Parameters:
renderProperties(properties) → string => any

Overrides @aws-cdk/cdk.Resource.renderProperties()

Protected method

Parameters:properties (any) –
Return type:string => any
resourceTypeName

The CloudFormation resource type name for this resource class.

Type:string (readonly) (static)
propertyOverrides
Type:CfnStateMachineProps (readonly)
stateMachineArn
Type:string (readonly)
stateMachineName
Type:string (readonly)
apply(aspect)

Inherited from @aws-cdk/cdk.Construct

Applies the aspect to this Constructs node

Parameters:aspect (@aws-cdk/cdk.IAspect) –
toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)
ref

Inherited from @aws-cdk/cdk.Referenceable

Returns a token to a CloudFormation { Ref } that references this entity based on it’s logical ID.

Type:string (readonly)
addDeletionOverride(path)

Inherited from @aws-cdk/cdk.Resource

Syntactic sugar for addOverride(path, undefined).

Parameters:path (string) – The path of the value to delete
addDependsOn(resource)

Inherited from @aws-cdk/cdk.Resource

Indicates that this resource depends on another resource and cannot be provisioned

unless the other resource has been successfully provisioned.

Parameters:resource (@aws-cdk/cdk.Resource) –
addOverride(path, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to the synthesized CloudFormation resource. To add a

property override, either use addPropertyOverride or prefix path with

“Properties.” (i.e. Properties.TopicName).

Parameters:
  • path (string) – The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
  • value (any) – The value. Could be primitive or complex.
addPropertyDeletionOverride(propertyPath)

Inherited from @aws-cdk/cdk.Resource

Adds an override that deletes the value of a property from the resource definition.

Parameters:propertyPath (string) – The path to the property.
addPropertyOverride(propertyPath, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to a resource property.

Syntactic sugar for addOverride(“Properties.<…>”, value).

Parameters:
  • propertyPath (string) – The path of the property
  • value (any) – The value
getAtt(attributeName) → @aws-cdk/cdk.CfnReference

Inherited from @aws-cdk/cdk.Resource

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility

in case there is no generated attribute.

Parameters:attributeName (string) – The name of the attribute.
Return type:@aws-cdk/cdk.CfnReference
toCloudFormation() → json

Inherited from @aws-cdk/cdk.Resource

Emits CloudFormation for this resource.

Return type:json
options

Inherited from @aws-cdk/cdk.Resource

Options for this resource, such as condition, update policy etc.

Type:@aws-cdk/cdk.ResourceOptions (readonly)
properties

Inherited from @aws-cdk/cdk.Resource

AWS resource properties.

This object is rendered via a call to “renderProperties(this.properties)”.

Protected property

Type:any (readonly)
resourceType

Inherited from @aws-cdk/cdk.Resource

AWS resource type.

Type:string (readonly)
untypedPropertyOverrides

Inherited from @aws-cdk/cdk.Resource

AWS resource property overrides.

During synthesis, the method “renderProperties(this.overrides)” is called

with this object, and merged on top of the output of

“renderProperties(this.properties)”.

Derived classes should expose a strongly-typed version of this object as

a public property called propertyOverrides.

Protected property

Type:any (readonly)
overrideLogicalId(newLogicalId)

Inherited from @aws-cdk/cdk.StackElement

Overrides the auto-generated logical ID with a specific ID.

Parameters:newLogicalId (string) – The new logical ID to use for this stack element.
prepare()

Inherited from @aws-cdk/cdk.StackElement

Automatically detect references in this StackElement

Protected method

creationStackTrace

Inherited from @aws-cdk/cdk.StackElement

Type:string[] (readonly)
logicalId

Inherited from @aws-cdk/cdk.StackElement

The logical ID for this CloudFormation stack element. The logical ID of the element

is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Type:string (readonly)
stackPath

Inherited from @aws-cdk/cdk.StackElement

Return the path with respect to the stack

Type:string (readonly)
stack

Inherited from @aws-cdk/cdk.StackElement

The stack this Construct has been made a part of

Protected property

Type:@aws-cdk/cdk.Stack

CfnStateMachineProps (interface)

class @aws-cdk/aws-stepfunctions.CfnStateMachineProps

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.CfnStateMachineProps;
// CfnStateMachineProps is an interface
import { CfnStateMachineProps } from '@aws-cdk/aws-stepfunctions';
definitionString

AWS::StepFunctions::StateMachine.DefinitionString

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-definitionstring

Type:string
roleArn

AWS::StepFunctions::StateMachine.RoleArn

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-rolearn

Type:string
stateMachineName

AWS::StepFunctions::StateMachine.StateMachineName

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html#cfn-stepfunctions-statemachine-statemachinename

Type:string (optional)

Chain

class @aws-cdk/aws-stepfunctions.Chain

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.Chain;
const { Chain } = require('@aws-cdk/aws-stepfunctions');
import { Chain } from '@aws-cdk/aws-stepfunctions';

A collection of states to chain onto

A Chain has a start and zero or more chainable ends. If there are

zero ends, calling next() on the Chain will fail.

Implements:IChainable
static custom(startState, endStates, lastAdded) → @aws-cdk/aws-stepfunctions.Chain

Make a Chain with specific start and end states, and a last-added Chainable

Parameters:
Return type:

Chain

static sequence(start, next) → @aws-cdk/aws-stepfunctions.Chain

Make a Chain with the start from one chain and the ends from another

Parameters:
Return type:

Chain

static start(state) → @aws-cdk/aws-stepfunctions.Chain

Begin a new Chain from one chainable

Parameters:state (IChainable) –
Return type:Chain
next(next) → @aws-cdk/aws-stepfunctions.Chain

Continue normal execution with the given state

Parameters:next (IChainable) –
Return type:Chain
toSingleState(id[, props]) → @aws-cdk/aws-stepfunctions.Parallel

Return a single state that encompasses all states in the chain

This can be used to add error handling to a sequence of states.

Be aware that this changes the result of the inner state machine

to be an array with the result of the state machine in it. Adjust

your paths accordingly. For example, change ‘outputPath’ to

‘$[0]’.

Parameters:
Return type:

Parallel

endStates

Implements @aws-cdk/aws-stepfunctions.IChainable.endStates()

The chainable end state(s) of this chain

Type:INextable[] (readonly)
id

Implements @aws-cdk/aws-stepfunctions.IChainable.id()

Identify this Chain

Type:string (readonly)
lastAdded
Type:IChainable (readonly)
startState

Implements @aws-cdk/aws-stepfunctions.IChainable.startState()

The start state of this chain

Type:State (readonly)

Choice

class @aws-cdk/aws-stepfunctions.Choice(scope, id[, props])

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.Choice;
const { Choice } = require('@aws-cdk/aws-stepfunctions');
import { Choice } from '@aws-cdk/aws-stepfunctions';

Define a Choice in the state machine

A choice state can be used to make decisions based on the execution

state.

Extends:

State

Parameters:
afterwards([options]) → @aws-cdk/aws-stepfunctions.Chain

Return a Chain that contains all reachable end states from this Choice

Use this to combine all possible choice paths back.

Parameters:options (AfterwardsOptions (optional)) –
Return type:Chain
otherwise(def) → @aws-cdk/aws-stepfunctions.Choice

If none of the given conditions match, continue execution with the given state

If no conditions match and no otherwise() has been given, an execution

error will be raised.

Parameters:def (IChainable) –
Return type:Choice
toStateJson() → json

Implements @aws-cdk/aws-stepfunctions.State.toStateJson()

Return the Amazon States Language object for this state

Return type:json
when(condition, next) → @aws-cdk/aws-stepfunctions.Choice

If the given condition matches, continue execution with the given state

Parameters:
Return type:

Choice

endStates

Implements @aws-cdk/aws-stepfunctions.State.endStates()

Continuable states of this Chainable

Type:INextable[] (readonly)
addBranch(branch)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a paralle branch to this state

Protected method

Parameters:branch (StateGraph) –
addChoice(condition, next)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a choice branch to this state

Protected method

Parameters:
addPrefix(x)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a prefix to the stateId of this state

Parameters:x (string) –
bindToGraph(graph)

Inherited from @aws-cdk/aws-stepfunctions.State

Register this state as part of the given graph

Don’t call this. It will be called automatically when you work

states normally.

Parameters:graph (StateGraph) –
makeDefault(def)

Inherited from @aws-cdk/aws-stepfunctions.State

Make the indicated state the default choice transition of this state

Protected method

Parameters:def (State) –
makeNext(next)

Inherited from @aws-cdk/aws-stepfunctions.State

Make the indicated state the default transition of this state

Protected method

Parameters:next (State) –
onBindToGraph(graph)

Inherited from @aws-cdk/aws-stepfunctions.State

Called whenever this state is bound to a graph

Can be overridden by subclasses.

Protected method

Parameters:graph (StateGraph) –
renderBranches() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render parallel branches in ASL JSON format

Protected method

Return type:any
renderChoices() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render the choices in ASL JSON format

Protected method

Return type:any
renderInputOutput() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render InputPath/Parameters/OutputPath in ASL JSON format

Protected method

Return type:any
renderNextEnd() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render the default next state in ASL JSON format

Protected method

Return type:any
renderRetryCatch() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render error recovery options in ASL JSON format

Protected method

Return type:any
branches

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:StateGraph[] (readonly)
id

Inherited from @aws-cdk/aws-stepfunctions.State

Descriptive identifier for this chainable

Type:string (readonly)
startState

Inherited from @aws-cdk/aws-stepfunctions.State

First state of this Chainable

Type:State (readonly)
stateId

Inherited from @aws-cdk/aws-stepfunctions.State

Tokenized string that evaluates to the state’s ID

Type:string (readonly)
comment

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
inputPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
outputPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
parameters

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:json (optional) (readonly)
resultPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
defaultChoice

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:State (optional)
apply(aspect)

Inherited from @aws-cdk/cdk.Construct

Applies the aspect to this Constructs node

Parameters:aspect (@aws-cdk/cdk.IAspect) –
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

ChoiceProps (interface)

class @aws-cdk/aws-stepfunctions.ChoiceProps

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.ChoiceProps;
// ChoiceProps is an interface
import { ChoiceProps } from '@aws-cdk/aws-stepfunctions';

Properties for defining a Choice state

comment

An optional description for this state

Type:string (optional)
Default:No comment
inputPath

JSONPath expression to select part of the state to be the input to this state.

May also be the special value DISCARD, which will cause the effective

input to be the empty object {}.

Type:string (optional)
Default:$
outputPath

JSONPath expression to select part of the state to be the output to this state.

May also be the special value DISCARD, which will cause the effective

output to be the empty object {}.

Type:string (optional)
Default:$

Condition

class @aws-cdk/aws-stepfunctions.Condition

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.Condition;
const { Condition } = require('@aws-cdk/aws-stepfunctions');
import { Condition } from '@aws-cdk/aws-stepfunctions';

A Condition for use in a Choice state branch

Abstract:Yes
static and(*conditions) → @aws-cdk/aws-stepfunctions.Condition

Combine two or more conditions with a logical AND

Parameters:*conditions (Condition) –
Return type:Condition
static booleanEquals(variable, value) → @aws-cdk/aws-stepfunctions.Condition

Matches if a boolean field has the given value

Parameters:
  • variable (string) –
  • value (boolean) –
Return type:

Condition

static not(condition) → @aws-cdk/aws-stepfunctions.Condition

Negate a condition

Parameters:condition (Condition) –
Return type:Condition
static numberEquals(variable, value) → @aws-cdk/aws-stepfunctions.Condition

Matches if a numeric field has the given value

Parameters:
  • variable (string) –
  • value (number) –
Return type:

Condition

static numberGreaterThan(variable, value) → @aws-cdk/aws-stepfunctions.Condition

Matches if a numeric field is greater than the given value

Parameters:
  • variable (string) –
  • value (number) –
Return type:

Condition

static numberGreaterThanEquals(variable, value) → @aws-cdk/aws-stepfunctions.Condition

Matches if a numeric field is greater than or equal to the given value

Parameters:
  • variable (string) –
  • value (number) –
Return type:

Condition

static numberLessThan(variable, value) → @aws-cdk/aws-stepfunctions.Condition

Matches if a numeric field is less than the given value

Parameters:
  • variable (string) –
  • value (number) –
Return type:

Condition

static numberLessThanEquals(variable, value) → @aws-cdk/aws-stepfunctions.Condition

Matches if a numeric field is less than or equal to the given value

Parameters:
  • variable (string) –
  • value (number) –
Return type:

Condition

static or(*conditions) → @aws-cdk/aws-stepfunctions.Condition

Combine two or more conditions with a logical OR

Parameters:*conditions (Condition) –
Return type:Condition
static stringEquals(variable, value) → @aws-cdk/aws-stepfunctions.Condition

Matches if a string field has the given value

Parameters:
  • variable (string) –
  • value (string) –
Return type:

Condition

static stringGreaterThan(variable, value) → @aws-cdk/aws-stepfunctions.Condition

Matches if a string field sorts after a given value

Parameters:
  • variable (string) –
  • value (string) –
Return type:

Condition

static stringGreaterThanEquals(variable, value) → @aws-cdk/aws-stepfunctions.Condition

Matches if a string field sorts after or equal to a given value

Parameters:
  • variable (string) –
  • value (string) –
Return type:

Condition

static stringLessThan(variable, value) → @aws-cdk/aws-stepfunctions.Condition

Matches if a string field sorts before a given value

Parameters:
  • variable (string) –
  • value (string) –
Return type:

Condition

static stringLessThanEquals(variable, value) → @aws-cdk/aws-stepfunctions.Condition

Matches if a string field sorts equal to or before a given value

Parameters:
  • variable (string) –
  • value (string) –
Return type:

Condition

static timestampEquals(variable, value) → @aws-cdk/aws-stepfunctions.Condition

Matches if a timestamp field is the same time as the given timestamp

Parameters:
  • variable (string) –
  • value (string) –
Return type:

Condition

static timestampGreaterThan(variable, value) → @aws-cdk/aws-stepfunctions.Condition

Matches if a timestamp field is after the given timestamp

Parameters:
  • variable (string) –
  • value (string) –
Return type:

Condition

static timestampGreaterThanEquals(variable, value) → @aws-cdk/aws-stepfunctions.Condition

Matches if a timestamp field is after or equal to the given timestamp

Parameters:
  • variable (string) –
  • value (string) –
Return type:

Condition

static timestampLessThan(variable, value) → @aws-cdk/aws-stepfunctions.Condition

Matches if a timestamp field is before the given timestamp

Parameters:
  • variable (string) –
  • value (string) –
Return type:

Condition

static timestampLessThanEquals(variable, value) → @aws-cdk/aws-stepfunctions.Condition

Matches if a timestamp field is before or equal to the given timestamp

Parameters:
  • variable (string) –
  • value (string) –
Return type:

Condition

renderCondition() → any

Render Amazon States Language JSON for the condition

Return type:any
Abstract:Yes

Errors

class @aws-cdk/aws-stepfunctions.Errors

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.Errors;
const { Errors } = require('@aws-cdk/aws-stepfunctions');
import { Errors } from '@aws-cdk/aws-stepfunctions';

Predefined error strings

All

Matches any Error.

Type:string (readonly) (static)
BranchFailed

A branch of a Parallel state failed.

Type:string (readonly) (static)
NoChoiceMatched

A Choice state failed to find a match for the condition field extracted

from its input.

Type:string (readonly) (static)
Permissions

A Task State failed because it had insufficient privileges to execute

the specified code.

Type:string (readonly) (static)
ResultPathMatchFailure

A Task State’s “ResultPath” field cannot be applied to the input the state received.

Type:string (readonly) (static)
TaskFailed

A Task State failed during the execution.

Type:string (readonly) (static)
Timeout

A Task State either ran longer than the “TimeoutSeconds” value, or

failed to heartbeat for a time longer than the “HeartbeatSeconds” value.

Type:string (readonly) (static)

Fail

class @aws-cdk/aws-stepfunctions.Fail(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.Fail;
const { Fail } = require('@aws-cdk/aws-stepfunctions');
import { Fail } from '@aws-cdk/aws-stepfunctions';

Define a Fail state in the state machine

Reaching a Fail state terminates the state execution in failure.

Extends:

State

Parameters:
toStateJson() → json

Implements @aws-cdk/aws-stepfunctions.State.toStateJson()

Return the Amazon States Language object for this state

Return type:json
endStates

Implements @aws-cdk/aws-stepfunctions.State.endStates()

Continuable states of this Chainable

Type:INextable[] (readonly)
addBranch(branch)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a paralle branch to this state

Protected method

Parameters:branch (StateGraph) –
addChoice(condition, next)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a choice branch to this state

Protected method

Parameters:
addPrefix(x)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a prefix to the stateId of this state

Parameters:x (string) –
bindToGraph(graph)

Inherited from @aws-cdk/aws-stepfunctions.State

Register this state as part of the given graph

Don’t call this. It will be called automatically when you work

states normally.

Parameters:graph (StateGraph) –
makeDefault(def)

Inherited from @aws-cdk/aws-stepfunctions.State

Make the indicated state the default choice transition of this state

Protected method

Parameters:def (State) –
makeNext(next)

Inherited from @aws-cdk/aws-stepfunctions.State

Make the indicated state the default transition of this state

Protected method

Parameters:next (State) –
onBindToGraph(graph)

Inherited from @aws-cdk/aws-stepfunctions.State

Called whenever this state is bound to a graph

Can be overridden by subclasses.

Protected method

Parameters:graph (StateGraph) –
renderBranches() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render parallel branches in ASL JSON format

Protected method

Return type:any
renderChoices() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render the choices in ASL JSON format

Protected method

Return type:any
renderInputOutput() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render InputPath/Parameters/OutputPath in ASL JSON format

Protected method

Return type:any
renderNextEnd() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render the default next state in ASL JSON format

Protected method

Return type:any
renderRetryCatch() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render error recovery options in ASL JSON format

Protected method

Return type:any
branches

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:StateGraph[] (readonly)
id

Inherited from @aws-cdk/aws-stepfunctions.State

Descriptive identifier for this chainable

Type:string (readonly)
startState

Inherited from @aws-cdk/aws-stepfunctions.State

First state of this Chainable

Type:State (readonly)
stateId

Inherited from @aws-cdk/aws-stepfunctions.State

Tokenized string that evaluates to the state’s ID

Type:string (readonly)
comment

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
inputPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
outputPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
parameters

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:json (optional) (readonly)
resultPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
defaultChoice

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:State (optional)
apply(aspect)

Inherited from @aws-cdk/cdk.Construct

Applies the aspect to this Constructs node

Parameters:aspect (@aws-cdk/cdk.IAspect) –
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

FailProps (interface)

class @aws-cdk/aws-stepfunctions.FailProps

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.FailProps;
// FailProps is an interface
import { FailProps } from '@aws-cdk/aws-stepfunctions';

Properties for defining a Fail state

error

Error code used to represent this failure

Type:string
cause

A description for the cause of the failure

Type:string (optional)
Default:No description
comment

An optional description for this state

Type:string (optional)
Default:No comment

FindStateOptions (interface)

class @aws-cdk/aws-stepfunctions.FindStateOptions

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.FindStateOptions;
// FindStateOptions is an interface
import { FindStateOptions } from '@aws-cdk/aws-stepfunctions';

Options for finding reachable states

includeErrorHandlers

Whether or not to follow error-handling transitions

Type:boolean (optional)
Default:false

IChainable (interface)

class @aws-cdk/aws-stepfunctions.IChainable

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.IChainable;
// IChainable is an interface
import { IChainable } from '@aws-cdk/aws-stepfunctions';

Interface for objects that can be used in a Chain

endStates

The chainable end state(s) of this chainable

Type:INextable[] (readonly)
id

Descriptive identifier for this chainable

Type:string (readonly)
startState

The start state of this chainable

Type:State (readonly)

INextable (interface)

class @aws-cdk/aws-stepfunctions.INextable

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.INextable;
// INextable is an interface
import { INextable } from '@aws-cdk/aws-stepfunctions';

Interface for states that can have ‘next’ states

next(state) → @aws-cdk/aws-stepfunctions.Chain
Parameters:state (IChainable) –
Return type:Chain
Abstract:Yes

IStateMachine (interface)

class @aws-cdk/aws-stepfunctions.IStateMachine

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.IStateMachine;
// IStateMachine is an interface
import { IStateMachine } from '@aws-cdk/aws-stepfunctions';

A State Machine

Extends:@aws-cdk/cdk.IConstruct
stateMachineArn

The ARN of the state machine

Type:string (readonly)
export() → @aws-cdk/aws-stepfunctions.StateMachineImportProps

Export this state machine

Return type:StateMachineImportProps
Abstract:Yes
node

Inherited from @aws-cdk/cdk.IConstruct

The construct node in the scope tree.

Type:@aws-cdk/cdk.ConstructNode (readonly)
dependencyRoots

Inherited from @aws-cdk/cdk.IDependable

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)

IStepFunctionsTaskResource (interface)

class @aws-cdk/aws-stepfunctions.IStepFunctionsTaskResource

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.IStepFunctionsTaskResource;
// IStepFunctionsTaskResource is an interface
import { IStepFunctionsTaskResource } from '@aws-cdk/aws-stepfunctions';

Interface for objects that can be invoked in a Task state

asStepFunctionsTaskResource(callingTask) → @aws-cdk/aws-stepfunctions.StepFunctionsTaskResourceProps

Return the properties required for using this object as a Task resource

Parameters:callingTask (Task) –
Return type:StepFunctionsTaskResourceProps
Abstract:Yes

Parallel

class @aws-cdk/aws-stepfunctions.Parallel(scope, id[, props])

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.Parallel;
const { Parallel } = require('@aws-cdk/aws-stepfunctions');
import { Parallel } from '@aws-cdk/aws-stepfunctions';

Define a Parallel state in the state machine

A Parallel state can be used to run one or more state machines at the same

time.

The Result of a Parallel state is an array of the results of its substatemachines.

Extends:

State

Implements:

INextable

Parameters:
addCatch(handler[, props]) → @aws-cdk/aws-stepfunctions.Parallel

Add a recovery handler for this state

When a particular error occurs, execution will continue at the error

handler instead of failing the state machine execution.

Parameters:
Return type:

Parallel

addRetry([props]) → @aws-cdk/aws-stepfunctions.Parallel

Add retry configuration for this state

This controls if and how the execution will be retried if a particular

error occurs.

Parameters:props (RetryProps (optional)) –
Return type:Parallel
branch(*branches) → @aws-cdk/aws-stepfunctions.Parallel

Define one or more branches to run in parallel

Parameters:*branches (IChainable) –
Return type:Parallel
next(next) → @aws-cdk/aws-stepfunctions.Chain

Implements @aws-cdk/aws-stepfunctions.INextable.next()

Continue normal execution with the given state

Parameters:next (IChainable) –
Return type:Chain
toStateJson() → json

Implements @aws-cdk/aws-stepfunctions.State.toStateJson()

Return the Amazon States Language object for this state

Return type:json
validate() → string[]

Overrides @aws-cdk/cdk.Construct.validate()

Validate this state

Protected method

Return type:string[]
endStates

Implements @aws-cdk/aws-stepfunctions.State.endStates()

Continuable states of this Chainable

Type:INextable[] (readonly)
addBranch(branch)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a paralle branch to this state

Protected method

Parameters:branch (StateGraph) –
addChoice(condition, next)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a choice branch to this state

Protected method

Parameters:
addPrefix(x)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a prefix to the stateId of this state

Parameters:x (string) –
bindToGraph(graph)

Inherited from @aws-cdk/aws-stepfunctions.State

Register this state as part of the given graph

Don’t call this. It will be called automatically when you work

states normally.

Parameters:graph (StateGraph) –
makeDefault(def)

Inherited from @aws-cdk/aws-stepfunctions.State

Make the indicated state the default choice transition of this state

Protected method

Parameters:def (State) –
makeNext(next)

Inherited from @aws-cdk/aws-stepfunctions.State

Make the indicated state the default transition of this state

Protected method

Parameters:next (State) –
onBindToGraph(graph)

Inherited from @aws-cdk/aws-stepfunctions.State

Called whenever this state is bound to a graph

Can be overridden by subclasses.

Protected method

Parameters:graph (StateGraph) –
renderBranches() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render parallel branches in ASL JSON format

Protected method

Return type:any
renderChoices() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render the choices in ASL JSON format

Protected method

Return type:any
renderInputOutput() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render InputPath/Parameters/OutputPath in ASL JSON format

Protected method

Return type:any
renderNextEnd() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render the default next state in ASL JSON format

Protected method

Return type:any
renderRetryCatch() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render error recovery options in ASL JSON format

Protected method

Return type:any
branches

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:StateGraph[] (readonly)
id

Inherited from @aws-cdk/aws-stepfunctions.State

Descriptive identifier for this chainable

Type:string (readonly)
startState

Inherited from @aws-cdk/aws-stepfunctions.State

First state of this Chainable

Type:State (readonly)
stateId

Inherited from @aws-cdk/aws-stepfunctions.State

Tokenized string that evaluates to the state’s ID

Type:string (readonly)
comment

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
inputPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
outputPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
parameters

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:json (optional) (readonly)
resultPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
defaultChoice

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:State (optional)
apply(aspect)

Inherited from @aws-cdk/cdk.Construct

Applies the aspect to this Constructs node

Parameters:aspect (@aws-cdk/cdk.IAspect) –
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

ParallelProps (interface)

class @aws-cdk/aws-stepfunctions.ParallelProps

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.ParallelProps;
// ParallelProps is an interface
import { ParallelProps } from '@aws-cdk/aws-stepfunctions';

Properties for defining a Parallel state

comment

An optional description for this state

Type:string (optional)
Default:No comment
inputPath

JSONPath expression to select part of the state to be the input to this state.

May also be the special value DISCARD, which will cause the effective

input to be the empty object {}.

Type:string (optional)
Default:$
outputPath

JSONPath expression to select part of the state to be the output to this state.

May also be the special value DISCARD, which will cause the effective

output to be the empty object {}.

Type:string (optional)
Default:$
resultPath

JSONPath expression to indicate where to inject the state’s output

May also be the special value DISCARD, which will cause the state’s

input to become its output.

Type:string (optional)
Default:$

Pass

class @aws-cdk/aws-stepfunctions.Pass(scope, id[, props])

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.Pass;
const { Pass } = require('@aws-cdk/aws-stepfunctions');
import { Pass } from '@aws-cdk/aws-stepfunctions';

Define a Pass in the state machine

A Pass state can be used to transform the current exeuction’s state.

Extends:

State

Implements:

INextable

Parameters:
next(next) → @aws-cdk/aws-stepfunctions.Chain

Implements @aws-cdk/aws-stepfunctions.INextable.next()

Continue normal execution with the given state

Parameters:next (IChainable) –
Return type:Chain
toStateJson() → json

Implements @aws-cdk/aws-stepfunctions.State.toStateJson()

Return the Amazon States Language object for this state

Return type:json
endStates

Implements @aws-cdk/aws-stepfunctions.State.endStates()

Continuable states of this Chainable

Type:INextable[] (readonly)
addBranch(branch)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a paralle branch to this state

Protected method

Parameters:branch (StateGraph) –
addChoice(condition, next)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a choice branch to this state

Protected method

Parameters:
addPrefix(x)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a prefix to the stateId of this state

Parameters:x (string) –
bindToGraph(graph)

Inherited from @aws-cdk/aws-stepfunctions.State

Register this state as part of the given graph

Don’t call this. It will be called automatically when you work

states normally.

Parameters:graph (StateGraph) –
makeDefault(def)

Inherited from @aws-cdk/aws-stepfunctions.State

Make the indicated state the default choice transition of this state

Protected method

Parameters:def (State) –
makeNext(next)

Inherited from @aws-cdk/aws-stepfunctions.State

Make the indicated state the default transition of this state

Protected method

Parameters:next (State) –
onBindToGraph(graph)

Inherited from @aws-cdk/aws-stepfunctions.State

Called whenever this state is bound to a graph

Can be overridden by subclasses.

Protected method

Parameters:graph (StateGraph) –
renderBranches() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render parallel branches in ASL JSON format

Protected method

Return type:any
renderChoices() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render the choices in ASL JSON format

Protected method

Return type:any
renderInputOutput() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render InputPath/Parameters/OutputPath in ASL JSON format

Protected method

Return type:any
renderNextEnd() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render the default next state in ASL JSON format

Protected method

Return type:any
renderRetryCatch() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render error recovery options in ASL JSON format

Protected method

Return type:any
branches

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:StateGraph[] (readonly)
id

Inherited from @aws-cdk/aws-stepfunctions.State

Descriptive identifier for this chainable

Type:string (readonly)
startState

Inherited from @aws-cdk/aws-stepfunctions.State

First state of this Chainable

Type:State (readonly)
stateId

Inherited from @aws-cdk/aws-stepfunctions.State

Tokenized string that evaluates to the state’s ID

Type:string (readonly)
comment

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
inputPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
outputPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
parameters

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:json (optional) (readonly)
resultPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
defaultChoice

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:State (optional)
apply(aspect)

Inherited from @aws-cdk/cdk.Construct

Applies the aspect to this Constructs node

Parameters:aspect (@aws-cdk/cdk.IAspect) –
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

PassProps (interface)

class @aws-cdk/aws-stepfunctions.PassProps

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.PassProps;
// PassProps is an interface
import { PassProps } from '@aws-cdk/aws-stepfunctions';

Properties for defining a Pass state

comment

An optional description for this state

Type:string (optional)
Default:No comment
inputPath

JSONPath expression to select part of the state to be the input to this state.

May also be the special value DISCARD, which will cause the effective

input to be the empty object {}.

Type:string (optional)
Default:$
outputPath

JSONPath expression to select part of the state to be the output to this state.

May also be the special value DISCARD, which will cause the effective

output to be the empty object {}.

Type:string (optional)
Default:$
result

If given, treat as the result of this operation

Can be used to inject or replace the current execution state.

Type:any (optional)
Default:No injected result
resultPath

JSONPath expression to indicate where to inject the state’s output

May also be the special value DISCARD, which will cause the state’s

input to become its output.

Type:string (optional)
Default:$

RetryProps (interface)

class @aws-cdk/aws-stepfunctions.RetryProps

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.RetryProps;
// RetryProps is an interface
import { RetryProps } from '@aws-cdk/aws-stepfunctions';

Retry details

backoffRate

Multiplication for how much longer the wait interval gets on every retry

Type:number (optional)
Default:2
errors

Errors to retry

A list of error strings to retry, which can be either predefined errors

(for example Errors.NoChoiceMatched) or a self-defined error.

Type:string[] (optional)
Default:All errors
intervalSeconds

How many seconds to wait initially before retrying

Type:number (optional)
Default:1
maxAttempts

How many times to retry this particular error.

May be 0 to disable retry for specific errors (in case you have

a catch-all retry policy).

Type:number (optional)
Default:3

SingleStateOptions (interface)

class @aws-cdk/aws-stepfunctions.SingleStateOptions

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.SingleStateOptions;
// SingleStateOptions is an interface
import { SingleStateOptions } from '@aws-cdk/aws-stepfunctions';

Options for creating a single state

Extends:ParallelProps
prefixStates

String to prefix all stateIds in the state machine with

Type:string (optional)
Default:stateId
stateId

ID of newly created containing state

Type:string (optional)
Default:Construct ID of the StateMachineFragment
comment

Inherited from @aws-cdk/aws-stepfunctions.ParallelProps

An optional description for this state

Type:string (optional)
Default:No comment
inputPath

Inherited from @aws-cdk/aws-stepfunctions.ParallelProps

JSONPath expression to select part of the state to be the input to this state.

May also be the special value DISCARD, which will cause the effective

input to be the empty object {}.

Type:string (optional)
Default:$
outputPath

Inherited from @aws-cdk/aws-stepfunctions.ParallelProps

JSONPath expression to select part of the state to be the output to this state.

May also be the special value DISCARD, which will cause the effective

output to be the empty object {}.

Type:string (optional)
Default:$
resultPath

Inherited from @aws-cdk/aws-stepfunctions.ParallelProps

JSONPath expression to indicate where to inject the state’s output

May also be the special value DISCARD, which will cause the state’s

input to become its output.

Type:string (optional)
Default:$

State

class @aws-cdk/aws-stepfunctions.State(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.State;
const { State } = require('@aws-cdk/aws-stepfunctions');
import { State } from '@aws-cdk/aws-stepfunctions';

Base class for all other state classes

Extends:

@aws-cdk/cdk.Construct

Implements:

IChainable

Abstract:

Yes

Parameters:
static filterNextables(states) → @aws-cdk/aws-stepfunctions.INextable[]

Return only the states that allow chaining from an array of states

Parameters:states (State[]) –
Return type:INextable[]
static findReachableEndStates(start[, options]) → @aws-cdk/aws-stepfunctions.State[]

Find the set of end states states reachable through transitions from the given start state

Parameters:
Return type:

State[]

static prefixStates(root, prefix)

Add a prefix to the stateId of all States found in a construct tree

Parameters:
addBranch(branch)

Add a paralle branch to this state

Protected method

Parameters:branch (StateGraph) –
addChoice(condition, next)

Add a choice branch to this state

Protected method

Parameters:
addPrefix(x)

Add a prefix to the stateId of this state

Parameters:x (string) –
bindToGraph(graph)

Register this state as part of the given graph

Don’t call this. It will be called automatically when you work

states normally.

Parameters:graph (StateGraph) –
makeDefault(def)

Make the indicated state the default choice transition of this state

Protected method

Parameters:def (State) –
makeNext(next)

Make the indicated state the default transition of this state

Protected method

Parameters:next (State) –
onBindToGraph(graph)

Called whenever this state is bound to a graph

Can be overridden by subclasses.

Protected method

Parameters:graph (StateGraph) –
renderBranches() → any

Render parallel branches in ASL JSON format

Protected method

Return type:any
renderChoices() → any

Render the choices in ASL JSON format

Protected method

Return type:any
renderInputOutput() → any

Render InputPath/Parameters/OutputPath in ASL JSON format

Protected method

Return type:any
renderNextEnd() → any

Render the default next state in ASL JSON format

Protected method

Return type:any
renderRetryCatch() → any

Render error recovery options in ASL JSON format

Protected method

Return type:any
toStateJson() → json

Render the state as JSON

Return type:json
Abstract:Yes
branches

Protected property

Type:StateGraph[] (readonly)
endStates

Implements @aws-cdk/aws-stepfunctions.IChainable.endStates()

Continuable states of this Chainable

Type:INextable[] (readonly) (abstract)
id

Implements @aws-cdk/aws-stepfunctions.IChainable.id()

Descriptive identifier for this chainable

Type:string (readonly)
startState

Implements @aws-cdk/aws-stepfunctions.IChainable.startState()

First state of this Chainable

Type:State (readonly)
stateId

Tokenized string that evaluates to the state’s ID

Type:string (readonly)
comment

Protected property

Type:string (optional) (readonly)
inputPath

Protected property

Type:string (optional) (readonly)
outputPath

Protected property

Type:string (optional) (readonly)
parameters

Protected property

Type:json (optional) (readonly)
resultPath

Protected property

Type:string (optional) (readonly)
defaultChoice

Protected property

Type:State (optional)
apply(aspect)

Inherited from @aws-cdk/cdk.Construct

Applies the aspect to this Constructs node

Parameters:aspect (@aws-cdk/cdk.IAspect) –
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

StateGraph

class @aws-cdk/aws-stepfunctions.StateGraph(startState, graphDescription)

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.StateGraph;
const { StateGraph } = require('@aws-cdk/aws-stepfunctions');
import { StateGraph } from '@aws-cdk/aws-stepfunctions';

A collection of connected states

A StateGraph is used to keep track of all states that are connected (have

transitions between them). It does not include the substatemachines in

a Parallel’s branches: those are their own StateGraphs, but the graphs

themselves have a hierarchical relationship as well.

By assigning states to a definintive StateGraph, we verify that no state

machines are constructed. In particular:

  • Every state object can only ever be in 1 StateGraph, and not inadvertently

    be used in two graphs.

  • Every stateId must be unique across all states in the entire state

    machine.

All policy statements in all states in all substatemachines are bubbled so

that the top-level StateMachine instantiation can read them all and add

them to the IAM Role.

You do not need to instantiate this class; it is used internally.

Parameters:
  • startState (State) –
  • graphDescription (string) –
registerPolicyStatement(statement)

Register a Policy Statement used by states in this graph

Parameters:statement (@aws-cdk/aws-iam.PolicyStatement) –
registerState(state)

Register a state as part of this graph

Called by State.bindToGraph().

Parameters:state (State) –
registerSuperGraph(graph)

Register this graph as a child of the given graph

Resource changes will be bubbled up to the given graph.

Parameters:graph (StateGraph) –
toGraphJson() → json

Return the Amazon States Language JSON for this graph

Return type:json
toString() → string

Return a string description of this graph

Return type:string
graphDescription
Type:string (readonly)
policyStatements

The accumulated policy statements

Type:@aws-cdk/aws-iam.PolicyStatement[] (readonly)
startState
Type:State (readonly)
timeoutSeconds

Set a timeout to render into the graph JSON.

Read/write. Only makes sense on the top-level graph, subgraphs

do not support this feature.

Type:number (optional)
Default:No timeout

StateMachine

class @aws-cdk/aws-stepfunctions.StateMachine(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.StateMachine;
const { StateMachine } = require('@aws-cdk/aws-stepfunctions');
import { StateMachine } from '@aws-cdk/aws-stepfunctions';

Define a StepFunctions State Machine

Extends:

@aws-cdk/cdk.Construct

Implements:

IStateMachine

Implements:

@aws-cdk/aws-events.IEventRuleTarget

Parameters:
static import(scope, id, props) → @aws-cdk/aws-stepfunctions.IStateMachine

Import a state machine

Parameters:
Return type:

IStateMachine

addToRolePolicy(statement)

Add the given statement to the role’s policy

Parameters:statement (@aws-cdk/aws-iam.PolicyStatement) –
asEventRuleTarget(_ruleArn, _ruleId) → @aws-cdk/aws-events.EventRuleTargetProps

Implements @aws-cdk/aws-events.IEventRuleTarget.asEventRuleTarget()

Allows using state machines as event rule targets.

Parameters:
  • _ruleArn (string) –
  • _ruleId (string) –
Return type:

@aws-cdk/aws-events.EventRuleTargetProps

export() → @aws-cdk/aws-stepfunctions.StateMachineImportProps

Implements @aws-cdk/aws-stepfunctions.IStateMachine.export()

Export this state machine

Return type:StateMachineImportProps
metric(metricName[, props]) → @aws-cdk/aws-cloudwatch.Metric

Return the given named metric for this State Machine’s executions

Parameters:
Return type:

@aws-cdk/aws-cloudwatch.Metric

metricAborted([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of executions that were aborted

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricFailed([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of executions that failed

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricStarted([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of executions that were started

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricSucceeded([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of executions that succeeded

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricThrottled([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of executions that were throttled

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricTimedOut([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of executions that succeeded

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
role

Execution role of this state machine

Type:@aws-cdk/aws-iam.Role (readonly)
stateMachineArn

Implements @aws-cdk/aws-stepfunctions.IStateMachine.stateMachineArn()

The ARN of the state machine

Type:string (readonly)
stateMachineName

The name of the state machine

Type:string (readonly)
apply(aspect)

Inherited from @aws-cdk/cdk.Construct

Applies the aspect to this Constructs node

Parameters:aspect (@aws-cdk/cdk.IAspect) –
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

StateMachineFragment

class @aws-cdk/aws-stepfunctions.StateMachineFragment(scope, id)

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.StateMachineFragment;
const { StateMachineFragment } = require('@aws-cdk/aws-stepfunctions');
import { StateMachineFragment } from '@aws-cdk/aws-stepfunctions';

Base class for reusable state machine fragments

Extends:

@aws-cdk/cdk.Construct

Implements:

IChainable

Abstract:

Yes

Parameters:
  • scope (@aws-cdk/cdk.Construct) – The scope in which to define this construct
  • id (string) – The scoped construct ID. Must be unique amongst siblings. If the ID includes a path separator (/), then it will be replaced by double dash .
next(next) → @aws-cdk/aws-stepfunctions.Chain

Continue normal execution with the given state

Parameters:next (IChainable) –
Return type:Chain
prefixStates([prefix]) → @aws-cdk/aws-stepfunctions.StateMachineFragment

Prefix the IDs of all states in this state machine fragment

Use this to avoid multiple copies of the state machine all having the

same state IDs.

Parameters:prefix (string (optional)) – The prefix to add. Will use construct ID by default.
Return type:StateMachineFragment
toSingleState([options]) → @aws-cdk/aws-stepfunctions.Parallel

Wrap all states in this state machine fragment up into a single state.

This can be used to add retry or error handling onto this state

machine fragment.

Be aware that this changes the result of the inner state machine

to be an array with the result of the state machine in it. Adjust

your paths accordingly. For example, change ‘outputPath’ to

‘$[0]’.

Parameters:options (SingleStateOptions (optional)) –
Return type:Parallel
endStates

Implements @aws-cdk/aws-stepfunctions.IChainable.endStates()

The states to chain onto if this fragment is used

Type:INextable[] (readonly) (abstract)
id

Implements @aws-cdk/aws-stepfunctions.IChainable.id()

Descriptive identifier for this chainable

Type:string (readonly)
startState

Implements @aws-cdk/aws-stepfunctions.IChainable.startState()

The start state of this state machine fragment

Type:State (readonly) (abstract)
apply(aspect)

Inherited from @aws-cdk/cdk.Construct

Applies the aspect to this Constructs node

Parameters:aspect (@aws-cdk/cdk.IAspect) –
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

StateMachineImportProps (interface)

class @aws-cdk/aws-stepfunctions.StateMachineImportProps

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.StateMachineImportProps;
// StateMachineImportProps is an interface
import { StateMachineImportProps } from '@aws-cdk/aws-stepfunctions';

Properties for an imported state machine

stateMachineArn

The ARN of the state machine

Type:string

StateMachineProps (interface)

class @aws-cdk/aws-stepfunctions.StateMachineProps

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.StateMachineProps;
// StateMachineProps is an interface
import { StateMachineProps } from '@aws-cdk/aws-stepfunctions';

Properties for defining a State Machine

definition

Definition for this state machine

Type:IChainable
role

The execution role for the state machine service

Type:@aws-cdk/aws-iam.Role (optional)
Default:A role is automatically created
stateMachineName

A name for the state machine

Type:string (optional)
Default:A name is automatically generated
timeoutSec

Maximum run time for this state machine

Type:number (optional)
Default:No timeout

StateProps (interface)

class @aws-cdk/aws-stepfunctions.StateProps

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.StateProps;
// StateProps is an interface
import { StateProps } from '@aws-cdk/aws-stepfunctions';

Properties shared by all states

comment

A comment describing this state

Type:string (optional)
Default:No comment
inputPath

JSONPath expression to select part of the state to be the input to this state.

May also be the special value DISCARD, which will cause the effective

input to be the empty object {}.

Type:string (optional)
Default:$
outputPath

JSONPath expression to select part of the state to be the output to this state.

May also be the special value DISCARD, which will cause the effective

output to be the empty object {}.

Type:string (optional)
Default:$
parameters

Parameters pass a collection of key-value pairs, either static values or JSONPath expressions that select from the input.

Type:string => any (optional)
Default:No parameters
resultPath

JSONPath expression to indicate where to inject the state’s output

May also be the special value DISCARD, which will cause the state’s

input to become its output.

Type:string (optional)
Default:$

StateTransitionMetric

class @aws-cdk/aws-stepfunctions.StateTransitionMetric

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.StateTransitionMetric;
const { StateTransitionMetric } = require('@aws-cdk/aws-stepfunctions');
import { StateTransitionMetric } from '@aws-cdk/aws-stepfunctions';

Metrics on the rate limiting performed on state machine execution.

These rate limits are shared across all state machines.

static metric(metricName[, props]) → @aws-cdk/aws-cloudwatch.Metric

Return the given named metric for the service’s state transition metrics

Parameters:
Return type:

@aws-cdk/aws-cloudwatch.Metric

static metricConsumedCapacity([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of available state transitions per second

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
static metricProvisionedBucketSize([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of available state transitions.

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
static metricProvisionedRefillRate([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the provisioned steady-state execution rate

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
static metricThrottledEvents([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of throttled state transitions

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric

StateType (enum)

class @aws-cdk/aws-stepfunctions.StateType

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.StateType;
const { StateType } = require('@aws-cdk/aws-stepfunctions');
import { StateType } from '@aws-cdk/aws-stepfunctions';

State types

Pass
Task
Choice
Wait
Succeed
Fail
Parallel

StepFunctionsTaskResourceProps (interface)

class @aws-cdk/aws-stepfunctions.StepFunctionsTaskResourceProps

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.StepFunctionsTaskResourceProps;
// StepFunctionsTaskResourceProps is an interface
import { StepFunctionsTaskResourceProps } from '@aws-cdk/aws-stepfunctions';

Properties that define how to refer to a TaskResource

resourceArn

The ARN of the resource

Type:string
metricDimensions

The dimensions to attach to metrics

Type:string => any (optional)
Default:No metrics
metricPrefixPlural

Prefix for plural metric names of activity actions

Type:string (optional)
Default:No such metrics
metricPrefixSingular

Prefix for singular metric names of activity actions

Type:string (optional)
Default:No such metrics
policyStatements

Additional policy statements to add to the execution role

Type:@aws-cdk/aws-iam.PolicyStatement[] (optional)
Default:No policy roles

Succeed

class @aws-cdk/aws-stepfunctions.Succeed(scope, id[, props])

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.Succeed;
const { Succeed } = require('@aws-cdk/aws-stepfunctions');
import { Succeed } from '@aws-cdk/aws-stepfunctions';

Define a Succeed state in the state machine

Reaching a Succeed state terminates the state execution in success.

Extends:

State

Parameters:
toStateJson() → json

Implements @aws-cdk/aws-stepfunctions.State.toStateJson()

Return the Amazon States Language object for this state

Return type:json
endStates

Implements @aws-cdk/aws-stepfunctions.State.endStates()

Continuable states of this Chainable

Type:INextable[] (readonly)
addBranch(branch)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a paralle branch to this state

Protected method

Parameters:branch (StateGraph) –
addChoice(condition, next)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a choice branch to this state

Protected method

Parameters:
addPrefix(x)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a prefix to the stateId of this state

Parameters:x (string) –
bindToGraph(graph)

Inherited from @aws-cdk/aws-stepfunctions.State

Register this state as part of the given graph

Don’t call this. It will be called automatically when you work

states normally.

Parameters:graph (StateGraph) –
makeDefault(def)

Inherited from @aws-cdk/aws-stepfunctions.State

Make the indicated state the default choice transition of this state

Protected method

Parameters:def (State) –
makeNext(next)

Inherited from @aws-cdk/aws-stepfunctions.State

Make the indicated state the default transition of this state

Protected method

Parameters:next (State) –
onBindToGraph(graph)

Inherited from @aws-cdk/aws-stepfunctions.State

Called whenever this state is bound to a graph

Can be overridden by subclasses.

Protected method

Parameters:graph (StateGraph) –
renderBranches() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render parallel branches in ASL JSON format

Protected method

Return type:any
renderChoices() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render the choices in ASL JSON format

Protected method

Return type:any
renderInputOutput() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render InputPath/Parameters/OutputPath in ASL JSON format

Protected method

Return type:any
renderNextEnd() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render the default next state in ASL JSON format

Protected method

Return type:any
renderRetryCatch() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render error recovery options in ASL JSON format

Protected method

Return type:any
branches

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:StateGraph[] (readonly)
id

Inherited from @aws-cdk/aws-stepfunctions.State

Descriptive identifier for this chainable

Type:string (readonly)
startState

Inherited from @aws-cdk/aws-stepfunctions.State

First state of this Chainable

Type:State (readonly)
stateId

Inherited from @aws-cdk/aws-stepfunctions.State

Tokenized string that evaluates to the state’s ID

Type:string (readonly)
comment

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
inputPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
outputPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
parameters

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:json (optional) (readonly)
resultPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
defaultChoice

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:State (optional)
apply(aspect)

Inherited from @aws-cdk/cdk.Construct

Applies the aspect to this Constructs node

Parameters:aspect (@aws-cdk/cdk.IAspect) –
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

SucceedProps (interface)

class @aws-cdk/aws-stepfunctions.SucceedProps

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.SucceedProps;
// SucceedProps is an interface
import { SucceedProps } from '@aws-cdk/aws-stepfunctions';

Properties for defining a Succeed state

comment

An optional description for this state

Type:string (optional)
Default:No comment
inputPath

JSONPath expression to select part of the state to be the input to this state.

May also be the special value DISCARD, which will cause the effective

input to be the empty object {}.

Type:string (optional)
Default:$
outputPath

JSONPath expression to select part of the state to be the output to this state.

May also be the special value DISCARD, which will cause the effective

output to be the empty object {}.

Type:string (optional)
Default:$

Task

class @aws-cdk/aws-stepfunctions.Task(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.Task;
const { Task } = require('@aws-cdk/aws-stepfunctions');
import { Task } from '@aws-cdk/aws-stepfunctions';

Define a Task state in the state machine

Reaching a Task state causes some work to be executed, represented

by the Task’s resource property.

Extends:

State

Implements:

INextable

Parameters:
addCatch(handler[, props]) → @aws-cdk/aws-stepfunctions.Task

Add a recovery handler for this state

When a particular error occurs, execution will continue at the error

handler instead of failing the state machine execution.

Parameters:
Return type:

Task

addRetry([props]) → @aws-cdk/aws-stepfunctions.Task

Add retry configuration for this state

This controls if and how the execution will be retried if a particular

error occurs.

Parameters:props (RetryProps (optional)) –
Return type:Task
metric(metricName[, props]) → @aws-cdk/aws-cloudwatch.Metric

Return the given named metric for this Task

Parameters:
Return type:

@aws-cdk/aws-cloudwatch.Metric

metricFailed([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of times this activity fails

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricHeartbeatTimedOut([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of times the heartbeat times out for this activity

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricRunTime([props]) → @aws-cdk/aws-cloudwatch.Metric

The interval, in milliseconds, between the time the Task starts and the time it closes.

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricScheduled([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of times this activity is scheduled

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricScheduleTime([props]) → @aws-cdk/aws-cloudwatch.Metric

The interval, in milliseconds, for which the activity stays in the schedule state.

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricStarted([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of times this activity is started

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricSucceeded([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of times this activity succeeds

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricTime([props]) → @aws-cdk/aws-cloudwatch.Metric

The interval, in milliseconds, between the time the activity is scheduled and the time it closes.

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricTimedOut([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for the number of times this activity times out

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
next(next) → @aws-cdk/aws-stepfunctions.Chain

Implements @aws-cdk/aws-stepfunctions.INextable.next()

Continue normal execution with the given state

Parameters:next (IChainable) –
Return type:Chain
onBindToGraph(graph)

Overrides @aws-cdk/aws-stepfunctions.State.onBindToGraph()

Called whenever this state is bound to a graph

Can be overridden by subclasses.

Protected method

Parameters:graph (StateGraph) –
toStateJson() → json

Implements @aws-cdk/aws-stepfunctions.State.toStateJson()

Return the Amazon States Language object for this state

Return type:json
endStates

Implements @aws-cdk/aws-stepfunctions.State.endStates()

Continuable states of this Chainable

Type:INextable[] (readonly)
addBranch(branch)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a paralle branch to this state

Protected method

Parameters:branch (StateGraph) –
addChoice(condition, next)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a choice branch to this state

Protected method

Parameters:
addPrefix(x)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a prefix to the stateId of this state

Parameters:x (string) –
bindToGraph(graph)

Inherited from @aws-cdk/aws-stepfunctions.State

Register this state as part of the given graph

Don’t call this. It will be called automatically when you work

states normally.

Parameters:graph (StateGraph) –
makeDefault(def)

Inherited from @aws-cdk/aws-stepfunctions.State

Make the indicated state the default choice transition of this state

Protected method

Parameters:def (State) –
makeNext(next)

Inherited from @aws-cdk/aws-stepfunctions.State

Make the indicated state the default transition of this state

Protected method

Parameters:next (State) –
renderBranches() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render parallel branches in ASL JSON format

Protected method

Return type:any
renderChoices() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render the choices in ASL JSON format

Protected method

Return type:any
renderInputOutput() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render InputPath/Parameters/OutputPath in ASL JSON format

Protected method

Return type:any
renderNextEnd() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render the default next state in ASL JSON format

Protected method

Return type:any
renderRetryCatch() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render error recovery options in ASL JSON format

Protected method

Return type:any
branches

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:StateGraph[] (readonly)
id

Inherited from @aws-cdk/aws-stepfunctions.State

Descriptive identifier for this chainable

Type:string (readonly)
startState

Inherited from @aws-cdk/aws-stepfunctions.State

First state of this Chainable

Type:State (readonly)
stateId

Inherited from @aws-cdk/aws-stepfunctions.State

Tokenized string that evaluates to the state’s ID

Type:string (readonly)
comment

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
inputPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
outputPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
parameters

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:json (optional) (readonly)
resultPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
defaultChoice

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:State (optional)
apply(aspect)

Inherited from @aws-cdk/cdk.Construct

Applies the aspect to this Constructs node

Parameters:aspect (@aws-cdk/cdk.IAspect) –
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

TaskProps (interface)

class @aws-cdk/aws-stepfunctions.TaskProps

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.TaskProps;
// TaskProps is an interface
import { TaskProps } from '@aws-cdk/aws-stepfunctions';

Properties for defining a Task state

resource

The resource that represents the work to be executed

Can be either a Lambda Function or an Activity.

Type:IStepFunctionsTaskResource
comment

An optional description for this state

Type:string (optional)
Default:No comment
heartbeatSeconds

Maximum time between heart beats

If the time between heart beats takes longer than this, a ‘Timeout’ error is raised.

This is only relevant when using an Activity type as resource.

Type:number (optional)
Default:No heart beat timeout
inputPath

JSONPath expression to select part of the state to be the input to this state.

May also be the special value DISCARD, which will cause the effective

input to be the empty object {}.

Type:string (optional)
Default:$
outputPath

JSONPath expression to select part of the state to be the output to this state.

May also be the special value DISCARD, which will cause the effective

output to be the empty object {}.

Type:string (optional)
Default:$
parameters

Parameters pass a collection of key-value pairs, either static values or JSONPath expressions that select from the input.

Type:string => any (optional)
Default:No parameters
resultPath

JSONPath expression to indicate where to inject the state’s output

May also be the special value DISCARD, which will cause the state’s

input to become its output.

Type:string (optional)
Default:$
timeoutSeconds

Maximum run time of this state

If the state takes longer than this amount of time to complete, a ‘Timeout’ error is raised.

Type:number (optional)
Default:60

Wait

class @aws-cdk/aws-stepfunctions.Wait(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.Wait;
const { Wait } = require('@aws-cdk/aws-stepfunctions');
import { Wait } from '@aws-cdk/aws-stepfunctions';

Define a Wait state in the state machine

A Wait state can be used to delay execution of the state machine for a while.

Extends:

State

Implements:

INextable

Parameters:
next(next) → @aws-cdk/aws-stepfunctions.Chain

Implements @aws-cdk/aws-stepfunctions.INextable.next()

Continue normal execution with the given state

Parameters:next (IChainable) –
Return type:Chain
toStateJson() → json

Implements @aws-cdk/aws-stepfunctions.State.toStateJson()

Return the Amazon States Language object for this state

Return type:json
endStates

Implements @aws-cdk/aws-stepfunctions.State.endStates()

Continuable states of this Chainable

Type:INextable[] (readonly)
addBranch(branch)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a paralle branch to this state

Protected method

Parameters:branch (StateGraph) –
addChoice(condition, next)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a choice branch to this state

Protected method

Parameters:
addPrefix(x)

Inherited from @aws-cdk/aws-stepfunctions.State

Add a prefix to the stateId of this state

Parameters:x (string) –
bindToGraph(graph)

Inherited from @aws-cdk/aws-stepfunctions.State

Register this state as part of the given graph

Don’t call this. It will be called automatically when you work

states normally.

Parameters:graph (StateGraph) –
makeDefault(def)

Inherited from @aws-cdk/aws-stepfunctions.State

Make the indicated state the default choice transition of this state

Protected method

Parameters:def (State) –
makeNext(next)

Inherited from @aws-cdk/aws-stepfunctions.State

Make the indicated state the default transition of this state

Protected method

Parameters:next (State) –
onBindToGraph(graph)

Inherited from @aws-cdk/aws-stepfunctions.State

Called whenever this state is bound to a graph

Can be overridden by subclasses.

Protected method

Parameters:graph (StateGraph) –
renderBranches() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render parallel branches in ASL JSON format

Protected method

Return type:any
renderChoices() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render the choices in ASL JSON format

Protected method

Return type:any
renderInputOutput() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render InputPath/Parameters/OutputPath in ASL JSON format

Protected method

Return type:any
renderNextEnd() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render the default next state in ASL JSON format

Protected method

Return type:any
renderRetryCatch() → any

Inherited from @aws-cdk/aws-stepfunctions.State

Render error recovery options in ASL JSON format

Protected method

Return type:any
branches

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:StateGraph[] (readonly)
id

Inherited from @aws-cdk/aws-stepfunctions.State

Descriptive identifier for this chainable

Type:string (readonly)
startState

Inherited from @aws-cdk/aws-stepfunctions.State

First state of this Chainable

Type:State (readonly)
stateId

Inherited from @aws-cdk/aws-stepfunctions.State

Tokenized string that evaluates to the state’s ID

Type:string (readonly)
comment

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
inputPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
outputPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
parameters

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:json (optional) (readonly)
resultPath

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:string (optional) (readonly)
defaultChoice

Inherited from @aws-cdk/aws-stepfunctions.State

Protected property

Type:State (optional)
apply(aspect)

Inherited from @aws-cdk/cdk.Construct

Applies the aspect to this Constructs node

Parameters:aspect (@aws-cdk/cdk.IAspect) –
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

WaitProps (interface)

class @aws-cdk/aws-stepfunctions.WaitProps

Language-specific names:

using Amazon.CDK.AWS.StepFunctions;
import software.amazon.awscdk.services.stepfunctions.WaitProps;
// WaitProps is an interface
import { WaitProps } from '@aws-cdk/aws-stepfunctions';

Properties for defining a Wait state

comment

An optional description for this state

Type:string (optional)
Default:No comment
seconds

Wait a fixed number of seconds

Exactly one of seconds, secondsPath, timestamp, timestampPath must be supplied.

Type:number (optional)
secondsPath

Wait for a number of seconds stored in the state object.

Exactly one of seconds, secondsPath, timestamp, timestampPath must be supplied.

Type:string (optional)
timestamp

Wait until the given ISO8601 timestamp

Exactly one of seconds, secondsPath, timestamp, timestampPath must be supplied.

Type:string (optional)
timestampPath

Wait until a timestamp found in the state object.

Exactly one of seconds, secondsPath, timestamp, timestampPath must be supplied.

Type:string (optional)