class TaskInput
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.StepFunctions.TaskInput |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctions#TaskInput |
Java | software.amazon.awscdk.services.stepfunctions.TaskInput |
Python | aws_cdk.aws_stepfunctions.TaskInput |
TypeScript (source) | aws-cdk-lib » aws_stepfunctions » TaskInput |
Type union for task classes that accept multiple types of payload.
Example
import * as apigateway from 'aws-cdk-lib/aws-apigateway';
declare const api: apigateway.RestApi;
tasks.CallApiGatewayRestApiEndpoint.jsonata(this, 'Endpoint', {
api,
stageName: 'Stage',
method: tasks.HttpMethod.PUT,
integrationPattern: sfn.IntegrationPattern.WAIT_FOR_TASK_TOKEN,
headers: sfn.TaskInput.fromObject({
TaskToken: '{% States.Array($states.context.taskToken) %}',
}),
});
Properties
| Name | Type | Description |
|---|---|---|
| type | Input | type of task input. |
| value | any | payload for the corresponding input type. |
type
Type:
Input
type of task input.
value
Type:
any
payload for the corresponding input type.
It can be a JSON-encoded object, context, data, etc.
Methods
| Name | Description |
|---|---|
| static from | Use a part of the execution data or task context as task input. |
| static from | Use an object as task input. |
| static from | Use a literal string as task input. |
static fromJsonPathAt(path)
public static fromJsonPathAt(path: string): TaskInput
Parameters
- path
string
Returns
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
Use an object as task input.
This object may contain JSON path fields as object values, if desired.
Use sfn.JsonPath.DISCARD in place of null for languages that do not support null (i.e. Python).
static fromText(text)
public static fromText(text: string): TaskInput
Parameters
- text
string
Returns
Use a literal string as task input.
This might be a JSON-encoded object, or just a text.

.NET
Go
Java
Python
TypeScript (