# TaskInput

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

- Source: [`aws-stepfunctions/lib/input.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-stepfunctions/lib/input.ts#L6)

## Example

```ts
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

- `type`: [InputType](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.InputType.html) (required) — type of task input.

- `value`: any (required) — payload for the corresponding input type.

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

## Methods

- `fromJsonPathAt(path: string): TaskInput // chainable` (static) — 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.

- `fromObject(obj: { [key: string]: any }): TaskInput // chainable` (static) — 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).

- `fromText(text: string): TaskInput // chainable` (static) — Use a literal string as task input.

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