aws-cdk-lib.aws_stepfunctions.TaskInput

class TaskInput

LanguageType name
.NETAmazon.CDK.AWS.StepFunctions.TaskInput
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctions#TaskInput
Javasoftware.amazon.awscdk.services.stepfunctions.TaskInput
Pythonaws_cdk.aws_stepfunctions.TaskInput
TypeScript (source)aws-cdk-lib » aws_stepfunctions » TaskInput

Type union for task classes that accept multiple types of payload.

Example

declare const fn: lambda.Function;
new tasks.LambdaInvoke(this, 'Invoke with callback', {
  lambdaFunction: fn,
  integrationPattern: sfn.IntegrationPattern.WAIT_FOR_TASK_TOKEN,
  payload: sfn.TaskInput.fromObject({
    token: sfn.JsonPath.taskToken,
    input: sfn.JsonPath.stringAt('$.someField'),
  }),
});

Properties

NameTypeDescription
typeInputTypetype of task input.
valueanypayload for the corresponding input type.

type

Type: InputType

type of task input.


value

Type: any

payload for the corresponding input type.

It can be a JSON-encoded object, context, data, etc.

Methods

NameDescription
static fromJsonPathAt(path)Use a part of the execution data or task context as task input.
static fromObject(obj)Use an object as task input.
static fromText(text)Use a literal string as task input.

static fromJsonPathAt(path)

public static fromJsonPathAt(path: string): TaskInput

Parameters

  • path string

Returns

  • TaskInput

Use a part of the execution data or task context as task input.

Use this when you want to use a subobject or string from the current state machine execution or the current task context as complete payload to a task.


static fromObject(obj)

public static fromObject(obj: { [string]: any }): TaskInput

Parameters

  • obj { [string]: any }

Returns

  • TaskInput

Use an object as task input.

This object may contain JSON path fields as object values, if desired.


static fromText(text)

public static fromText(text: string): TaskInput

Parameters

  • text string

Returns

  • TaskInput

Use a literal string as task input.

This might be a JSON-encoded object, or just a text.