> **Experimental**
>
> `@aws-cdk/aws-imagebuilder-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# WorkflowData

Helper class for referencing and uploading workflow data.

Extends: WorkflowData
Superclass of: S3WorkflowData

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/workflow.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-imagebuilder-alpha/lib/workflow.ts#L354)

## Example

```ts
const workflow = new imagebuilder.Workflow(this, 'EncryptedWorkflow', {
  workflowType: imagebuilder.WorkflowType.BUILD,
  kmsKey: new kms.Key(this, 'WorkflowKey'),
  data: imagebuilder.WorkflowData.fromJsonObject({
    schemaVersion: imagebuilder.WorkflowSchemaVersion.V1_0,
    steps: [
      {
        name: 'LaunchBuildInstance',
        action: imagebuilder.WorkflowAction.LAUNCH_INSTANCE,
        onFailure: imagebuilder.WorkflowOnFailure.ABORT,
        inputs: {
          waitFor: 'ssmAgent',
        },
      },
      {
        name: 'CreateImage',
        action: imagebuilder.WorkflowAction.CREATE_IMAGE,
        onFailure: imagebuilder.WorkflowOnFailure.ABORT,
        inputs: {
          'instanceId': 'i-123',
        },
      },
      {
        name: 'TerminateInstance',
        action: imagebuilder.WorkflowAction.TERMINATE_INSTANCE,
        onFailure: imagebuilder.WorkflowOnFailure.CONTINUE,
        inputs: {
          'instanceId': 'i-123',
        },
      },
    ],
    outputs: [
      {
        name: 'ImageId',
        value: '$.stepOutputs.CreateImage.imageId',
      },
    ],
  }),
});
```

## Initializer

```ts
new WorkflowData()
```

## Methods

- `fromAsset(scope: Construct, id: string, path: string, options?: AssetOptions): S3WorkflowData` (static) — Uploads workflow data from a local file to S3 to use as the workflow data.

  **Parameters**

  - `scope` — The construct scope.
  - `id` — Identifier of the construct.
  - `path` — The local path to the workflow data file.
  - `options` — S3 asset upload options.

- `fromInline(data: string): WorkflowData // chainable` (static) — Uses an inline JSON or YAML string as the workflow data.

  **Parameters**

  - `data` — An inline JSON or YAML string representing the workflow data.

- `fromJsonObject(data: { [key: string]: any }): WorkflowData // chainable` (static) — Uses an inline JSON object as the workflow data.

  **Parameters**

  - `data` — An inline JSON object representing the workflow data.

- `fromS3(bucket: IBucket, key: string): S3WorkflowData` (static) — References workflow data from a pre-existing S3 object.

  **Parameters**

  - `bucket` — The S3 bucket where the workflow data is stored.
  - `key` — The S3 key of the workflow data file.

- `render(): WorkflowDataConfig` — The rendered workflow data value, for use in CloudFormation.

  - For inline workflows, data is the workflow text
  - For S3-backed workflows, uri is the S3 URL
