Skip to content
v2.278.0

CatchProps Struct ​

Error handler details.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_stepfunctions as stepfunctions } from 'aws-cdk-lib';

declare const assign: any;
declare const outputs: any;
const catchProps: stepfunctions.CatchProps = {
  assign: {
    assignKey: assign,
  },
  errors: ['errors'],
  outputs: outputs,
  resultPath: 'resultPath',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_stepfunctions as stepfunctions

# assign: Any
# outputs: Any

catch_props = stepfunctions.CatchProps(
    assign={
        "assign_key": assign
    },
    errors=["errors"],
    outputs=outputs,
    result_path="resultPath"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.stepfunctions.*;

Object assign;
Object outputs;

CatchProps catchProps = CatchProps.builder()
        .assign(Map.of(
                "assignKey", assign))
        .errors(List.of("errors"))
        .outputs(outputs)
        .resultPath("resultPath")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.StepFunctions;

var assign;
var outputs;

var catchProps = new CatchProps {
    Assign = new Dictionary<string, object> {
        { "assignKey", assign }
    },
    Errors = new [] { "errors" },
    Outputs = outputs,
    ResultPath = "resultPath"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var assign interface{}
var outputs interface{}

catchProps := &CatchProps{
	Assign: map[string]interface{}{
		"assignKey": assign,
	},
	Errors: []*string{
		jsii.String("errors"),
	},
	Outputs: outputs,
	ResultPath: jsii.String("resultPath"),
}

Properties ​

assignoptional{ [key: string]: any }assignoptionaltyping.Mapping[str, Any]assignoptionalMap<String, Object>AssignoptionalIDictionary<string, object>Assignoptional*map[string]interface{} #
Workflow variables to store in this step.

Default: Not assign variables

Using workflow variables, you can store data in a step and retrieve that data in future steps.

errorsoptionalstring[]errorsoptionaltyping.List[str]errorsoptionalList<String>Errorsoptionalstring[]Errorsoptional*[]*string #
Errors to recover from by going to the given state.

Default: All errors

A list of error strings to retry, which can be either predefined errors (for example Errors.NoChoiceMatched) or a self-defined error.

outputsoptionalanyoutputsoptionalAnyoutputsoptionalObjectOutputsoptionalobjectOutputsoptionalinterface{} #
This option for JSONata only.

Default: $states.result or $states.errorOutput

notes

When you use JSONPath, then the state ignores this property. Used to specify and transform output from the state. When specified, the value overrides the state output default. The output field accepts any JSON value (object, array, string, number, boolean, null). Any string value, including those inside objects or arrays, will be evaluated as JSONata if surrounded by {% %} characters. Output also accepts a JSONata expression directly.

resultPathoptionalstringresult_pathoptionalstrresultPathoptionalStringResultPathoptionalstringResultPathoptional*string = $ #
JSONPath expression to indicate where to inject the error data.

May also be the special value JsonPath.DISCARD, which will cause the error data to be discarded.