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
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
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. |
JsonPathAt(path)
static frompublic 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.
Object(obj)
static frompublic 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).
Text(text)
static frompublic 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.