

# Automations and actions: Define your app's business logic
<a name="automations"></a>

**Automations** are how you define the business logic of your application. The main components of an automation are: triggers that start the automation, a sequence of one or more actions, input parameters used to pass data to the automation, and an output.

**Topics**
+ [Automations concepts](automations-concepts.md)
+ [Creating, editing, and deleting automations](automations-create-edit-delete.md)
+ [Adding, editing, and deleting automation actions](automations-actions-add-edit-delete.md)
+ [Automation actions reference](automations-actions-reference.md)

# Automations concepts
<a name="automations-concepts"></a>

Here are some concepts and terms to know when defining and configuring your app's business logic using automations in App Studio.

## Automations
<a name="automations-concepts-automations"></a>

**Automations** are how you define the business logic of your application. The main components of an automation are: triggers that start the automation, a sequence of one or more actions, input parameters used to pass data to the automation, and an output.

## Actions
<a name="automations-concepts-actions"></a>

An automation action, commonly referred to as an **action**, is an individual step of logic that make up an automation. Each action performs a specific task, whether it's sending an email, creating a data record, invoking a Lambda function, or calling APIs. Actions are added to automations from the action library, and can be grouped into conditional statements or loops.

## Automation input parameters
<a name="automations-concepts-parameters"></a>

**Automation input parameters** are dynamic input values that you can pass in from components to automations to make them flexible and reusable. Think of parameters as variables for your automation, instead of hard-coding values into an automation, you can define parameters and provide different values when needed. Parameters allow you to use the same automation with different inputs each time it is run. 

## Mocked output
<a name="automations-concepts-mocked-output"></a>

Some actions interact with external resources or services using connectors. When using the preview environment, applications do not interact with external services. To test actions that use connectors in the preview environment, you can use **mocked output** to simulate the connector's behavior and output. The mocked output is configured using JavaScript, and the result is stored in an action's results, just as the connector's response is stored in a published app.

By using mocking, you can use the preview environment to test various scenarios and their impact on other actions with the automation such as simulating different result values, error scenarios, edge cases, or unhappy paths without calling the external service through connectors.

## Automation output
<a name="automations-concepts-automation-output"></a>

An **automation output** is used to pass values from one automation to other resources of an app, such as components or other automations. Automation outputs are configured as expressions, and the expression can return a static value or a dynamic value computed from automation parameters and actions. By default, automations do not return any data, including the results of actions within the automation.

A couple of examples of how automation outputs can be used:
+ You can configure an automation output to return an array, and pass that array to populate a data component.
+ You can use an automation to calculate a value, and pass that value into multiple other automations as a way to centralize and reuse business logic.

## Triggers
<a name="automations-concepts-triggers"></a>

A **trigger** determines when, and on what conditions, an automation will run. Some examples of triggers are `On click` for buttons and `On select` for text inputs. The type of component determines the list of available triggers for that component. Triggers are added to [components](concepts.md#concepts-component) and configured in the application studio. 

# Creating, editing, and deleting automations
<a name="automations-create-edit-delete"></a>

**Contents**
+ [Creating an automation](#automations-create)
+ [Viewing or editing automation properties](#automations-edit)
+ [Deleting an automation](#automations-delete)

## Creating an automation
<a name="automations-create"></a>

Use the following procedure to create an automation in an App Studio application. Once created, an automation must be configured by editing its properties and adding actions to it.

**To create an automation**

1. If necessary, navigate to the application studio of your application.

1. Choose the **Automations** tab.

1. If you have no automations, choose **\$1 Add automation** in the canvas. Otherwise, in the left-side **Automations** menu, choose **\$1 Add**.

1. A new automation will be created, and you can start editing its properties or adding and configuring actions to define your application's business logic.

## Viewing or editing automation properties
<a name="automations-edit"></a>

Use the following procedure to view or edit automation properties.

**To view or edit automation properties**

1. If necessary, navigate to the application studio of your application.

1. Choose the **Automations** tab.

1. In the left-hand **Automations** menu, choose the automation for which you want to view or edit properties to open the right-side **Properties** menu.

1. In the **Properties** menu, you can view the following properties:
   + **Automation identifier**: The unique name of the automation. To edit it, enter a new identifier in the text field.
   + **Automation parameters**: Automation parameters are used to pass dynamic values from your app's UI to automation and data actions. To add a parameter, choose **\$1 Add**. Choose the pencil icon to change the parameter's name, description, or type. To remove a parameter, choose the trash icon.
**Tip**  
You can also add automation parameters directly from the canvas.
   + **Automation output**: The automation output is used to configure which data from the automation can be referenced in other automations or components. By default, automations do not create an output. To add an automation output choose **\$1 Add**. To remove the output, choose the trash icon.

1. You define what an automation does by adding and configuring actions. For more information about actions, see [Adding, editing, and deleting automation actions](automations-actions-add-edit-delete.md) and [Automation actions reference](automations-actions-reference.md).

## Deleting an automation
<a name="automations-delete"></a>

Use the following procedure to delete an automation in an App Studio application.

**To delete an automation**

1. If necessary, navigate to the application studio of your application.

1. Choose the **Automations** tab.

1. In the left-side **Automations** menu, choose the ellipses menu of the automation you want to delete, and choose **Delete**. Alternatively, you can choose the trash icon from the right-side **Properties** menu of the automation.

1. In the confirmation dialog box, choose **Delete**.

# Adding, editing, and deleting automation actions
<a name="automations-actions-add-edit-delete"></a>

An automation action, commonly referred to as an **action**, is an individual step of logic that make up an automation. Each action performs a specific task, whether it's sending an email, creating a data record, invoking a Lambda function, or calling APIs. Actions are added to automations from the action library, and can be grouped into conditional statements or loops.

**Contents**
+ [Adding an automation action](#automations-actions-add)
+ [Viewing and editing automation action properties](#automations-actions-edit)
+ [Deleting an automation action](#automations-actions-delete)

## Adding an automation action
<a name="automations-actions-add"></a>

Use the following procedure to add an action to an automation in an App Studio application.

**To add an automation action**

1. If necessary, navigate to the application studio of your application.

1. Choose the **Automations** tab.

1. In the left-side **Automations** menu, choose the automation you want to add an action to.

1. In the right-hand **Action** menu, choose the action you want to add, or drag and drop the action into the canvas. After the action is created, you can choose the action to configure the action properties to define the action's functionality. For more information about action properties and configuring them, see [Automation actions reference](automations-actions-reference.md).

## Viewing and editing automation action properties
<a name="automations-actions-edit"></a>

Use the following procedure to view or edit an automation action's properties in an App Studio application.

**To view or edit automation action properties**

1. If necessary, navigate to the application studio of your application.

1. Choose the **Automations** tab.

1. In the left-side **Automations** menu, choose the action of which you want to view or edit properties. Alternatively, you can choose the action in the canvas when viewing the automation that contains it.

1. You can view or edit the action properties in the right-side **Properties** menu. The properties for an action are different for each action type. For more information about action properties and configuring them, see [Automation actions reference](automations-actions-reference.md).

## Deleting an automation action
<a name="automations-actions-delete"></a>

Use the following procedure to delete an action from an automation in an App Studio application.

**To delete an automation action**

1. If necessary, navigate to the application studio of your application.

1. Choose the **Automations** tab.

1. In the left-side **Automations** menu, choose the automation that contains the action you want to delete.

1. In the canvas, choose the trash icon in the action you want to delete and choose **Delete**.

# Automation actions reference
<a name="automations-actions-reference"></a>

The following is the reference documentation for automation actions used in App Studio.

An automation action, commonly referred to as an **action**, is an individual step of logic that make up an automation. Each action performs a specific task, whether it's sending an email, creating a data record, invoking a Lambda function, or calling APIs. Actions are added to automations from the action library, and can be grouped into conditional statements or loops.

For information about creating and configuring automations and their actions, see the topics in [Automations and actions: Define your app's business logic](automations.md).

## Invoke API
<a name="automations-actions-reference-invoke-API"></a>

Invokes an HTTP REST API request. Builders can use this action to send requests from App Studio to other systems or services with APIs. For example, you could use it to connect to third-party systems or homegrown applications to access business critical data, or invoke API endpoints that cannot be called by dedicated App Studio actions.

For more information about REST APIs, see [What is a RESTful API?](https://aws.amazon.com/what-is/restful-api/).

### Properties
<a name="automations-actions-reference-invoke-API-properties"></a>

#### Connector
<a name="automations-actions-reference-invoke-API-properties-connector"></a>

The **Connector** to use for the API requests made by this action. The connector dropdown only contains connectors of the following types: `API Connector` and `OpenAPI Connector`. Depending on how the connector is configured, it can contain important information such as credentials and default headers or query parameters.

For more information about API connectors, including a comparison between using `API Connector` and `OpenAPI Connector`, see [Connect to third-party services](add-connector-third-party.md).

#### API request configuration properties
<a name="automations-actions-reference-invoke-API-properties-request-config"></a>

Choose **Configure API request** from the properties panel to open the request configuration dialog box. If an **API connector** is selected, the dialog box will include connector information.

**Method:** The method for the API call. Possible values are as follows:
+ `DELETE`: Deletes a specified resource.
+ `GET`: Retrieves information or data.
+ `HEAD`: Retrieves only the headers of a response without the body.
+ `POST`: Submits data to be processed.
+ `PUSH`: Submits data to be processed.
+ `PATCH`: Partially updates a specified resource.

**Path:** The relative path to the resource.

**Headers:** Any headers in the form of key-value pairs to be sent with the API request. If a connector is selected, its configured headers will be automatically added and cannot be removed. The configured headers cannot be edited, but you can override them by adding another header with the same name.

**Query parameters:** Any query parameters in the form of key-value pairs to be sent with the API request. If a connector is selected, its configured query parameters will be automatically added and cannot be edited or removed.

**Body:** Information to be sent with the API request in JSON format. There is no body for `GET` requests.

#### Mocked output
<a name="automations-actions-reference-invoke-API-properties-mocked-output"></a>

Actions do not interact with external services or resources in the preview environment. The **Mocked output** field is used to provide a JSON expression that simulates the behavior of a connector in the preview environment for testing purposes. This snippet is stored in the action's `results` map, just like the connector response would be for a published app in the live environment.

With this field, you can test various scenarios and their impact on other actions within the automation such as simulating different result values, error scenarios, edge cases, or unhappy paths without communicating with external services through connectors.

## Invoke AWS
<a name="automations-actions-reference-invoke-aws"></a>

Invokes an operation from an AWS service. This is a general action for calling AWS services or operations, and should be used if there is not a dedicated action for the desired AWS service or operation.

### Properties
<a name="automations-actions-reference-invoke-aws-properties"></a>

#### Service
<a name="automations-actions-reference-invoke-aws-properties-service"></a>

The AWS service which contains the operation to be run.

#### Operation
<a name="automations-actions-reference-invoke-aws-properties-operation"></a>

The operation to be run.

#### Connector
<a name="automations-actions-reference-invoke-aws-properties-connector"></a>

The connector to be used for the operations run by this action. The configured connector should be set up with the proper credentials to run the operation, and other configuration information, such as the AWS region that contains any resources referenced in the operation.

#### Configuration
<a name="automations-actions-reference-invoke-aws-properties-configuration"></a>

The JSON input to be when running the specified operation. For more information about configuring inputs for AWS operations, see the [AWS SDK for JavaScript](https://docs.aws.amazon.com/sdk-for-javascript).

## Invoke Lambda
<a name="automations-actions-reference-invoke-lambda"></a>

Invokes an existing Lambda function.

### Properties
<a name="automations-actions-reference-invoke-lambda-properties"></a>

#### Connector
<a name="automations-actions-reference-invoke-lambda-properties-connector"></a>

The connector to be used for the Lambda functions run by this action. The configured connector should be set up with the proper credentials to access the Lambda function, and other configuration information, such as the AWS region that contains the Lambda function. For more information about configuring a connector for Lambda, see [Step 3: Create Lambda connector](connectors-lambda.md#connectors-lambda-create-connector).

#### Function name
<a name="automations-actions-reference-invoke-lambda-properties-function-name"></a>

The name of the Lambda function to be run. Note that this is the function name, and not the function ARN (Amazon Resource Name).

#### Function event
<a name="automations-actions-reference-invoke-lambda-properties-function-event"></a>

Key-value pairs to be passed along to your Lambda function as the event payload.

#### Mocked output
<a name="automations-actions-reference-invoke-lambda-properties-mocked-output"></a>

Actions do not interact with external services or resources in the preview environment. The **Mocked output** field is used to provide a JSON expression that simulates the behavior of a connector in the preview environment for testing purposes. This snippet is stored in the action's `results` map, just like the connector response would be for a published app in the live environment.

With this field, you can test various scenarios and their impact on other actions within the automation such as simulating different result values, error scenarios, edge cases, or unhappy paths without communicating with external services through connectors.

## Loop
<a name="automations-actions-reference-loop"></a>

Runs nested actions repeatedly to iterate through a list of items, one item at a time. For example, add the [Create record](#automations-actions-reference-create-record) action to a loop action to create multiple records.

The loop action can be nested within other loops or condition actions. The loop actions are run sequentially, and not in parallel. The results of each action within the loop can only be accessed to subsequent actions within the same loop iteration. They cannot be accessed outside of the loop or in different iterations of the loop.

### Properties
<a name="automations-actions-reference-loop-properties"></a>

#### Source
<a name="automations-actions-reference-loop-properties-source"></a>

The list of items to iterate through, one item at a time. The source can be the result of a previous action or a static list of strings, numbers, or objects that you can provide using a JavaScript expression.

##### Examples
<a name="automations-actions-reference-loop-properties-source-examples"></a>

The following list contains examples of source inputs.
+ Results from a previous action: `{{results.actionName.data}}`
+ A list of numbers: `{{[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}`
+ A list of strings: `{{["apple", "banana", "orange", "grape", "kiwi"]}}`
+ A computed value: `{{params.actionName.split("\n")}}`

#### Current item name
<a name="automations-actions-reference-loop-properties-function-name"></a>

The name of the variable that can be used to reference the current item being iterated. The current item name is configurable so that you can nest two or more loops and access variables from each loop. For example, if you are looping through countries and cities with two loops, you could configure and reference `currentCountry` and `currentCity`.

## Condition
<a name="automations-actions-reference-condition"></a>

Runs actions based on the result of one or more specified logical conditions that are evaluated when the automation is run. The condition action is made up of the following components:
+ A *condition* field, which is used to provide a JavaScript expression that evaluates to `true` or `false`.
+ A *true branch*, which contains actions that are run if the condition evalutes to `true`.
+ A *false branch*, which contains actions that are run if the condition evalutes to `false`.

Add actions to the true and false branches by dragging them into the condition action.

### Properties
<a name="automations-actions-reference-condition-properties"></a>

#### Condition
<a name="automations-actions-reference-condition-properties-condition"></a>

The JavaScript expression to be evaluated when the action is run.

## Create record
<a name="automations-actions-reference-create-record"></a>

Creates one record in an existing App Studio entity.

### Properties
<a name="automations-actions-reference-create-record-properties"></a>

#### Entity
<a name="automations-actions-reference-create-record-properties-entity"></a>

The entity in which a record is to be created. Once an entity is selected, values must be added to the entity's fields for the record to be created. The types of the fields, and if the fields are required or optional are defined in the entity.

## Update record
<a name="automations-actions-reference-update-record"></a>

Updates an existing record in an App Studio entity.

### Properties
<a name="automations-actions-reference-update-record-properties"></a>

#### Entity
<a name="automations-actions-reference-update-record-properties-entity"></a>

The entity that contains the records to be updated.

#### Conditions
<a name="automations-actions-reference-update-record-properties-conditions"></a>

The criteria that defines which records are updated by the action. You can group conditions to create one logical statement. You can combine groups or conditions with `AND` or `OR` statements.

#### Fields
<a name="automations-actions-reference-update-record-properties-fields"></a>

The fields to be updated in the records specified by the conditions.

#### Values
<a name="automations-actions-reference-update-record-properties-values"></a>

The values to be updated in the specified fields.

## Delete record
<a name="automations-actions-reference-delete-record"></a>

Deletes a record from an App Studio entity.

### Properties
<a name="automations-actions-reference-delete-record-properties"></a>

#### Entity
<a name="automations-actions-reference-delete-record-properties-entity"></a>

The entity that contains the records to be deleted.

#### Conditions
<a name="automations-actions-reference-delete-record-properties-conditions"></a>

The criteria that defines which records are deleted by the action. You can group conditions to create one logic statement. You can combine groups or conditions with `AND` or `OR` statements.

## Invoke data action
<a name="automations-actions-reference-invoke-data-action"></a>

Runs a data action with optional parameters.

### Properties
<a name="automations-actions-reference-invoke-data-action-properties"></a>

#### Data action
<a name="automations-actions-reference-invoke-data-action-properties-data-action"></a>

The data action to be run by the action.

#### Parameters
<a name="automations-actions-reference-invoke-data-action-properties-parameters"></a>

Data action parameters to be used by the data action. Data action parameters are used to send values that are used as inputs for data actions. Data action parameters can be added when configuring the automation action, but must be edited in the **Data** tab.

#### Advanced settings
<a name="automations-actions-reference-invoke-data-action-properties-advanced-settings"></a>

The `Invoke data action` action contains the following advanced settings:
+ **Page size:** The maximum number of records to fetch in each query. The default value is 500, and the maximum value is 3000.
+ **Pagination token:** The token used to fetch additional records from a query. For example, if the `Page size` is set to 500, but there are more than 500 records, passing the pagination token to a subsequent query will fetch the next 500. The token will be undefined if no more records or pages exist.

## Amazon S3: Put object
<a name="automations-actions-reference-s3-put-object"></a>

Uses the `Amazon S3 PutObject` operation to add an object identified by a key (file path) to a specified Amazon S3 bucket.

### Properties
<a name="automations-actions-reference-s3-put-object-properties"></a>

#### Connector
<a name="automations-actions-reference-s3-put-object-properties-connector"></a>

The connector to be used for the operations run by this action. The configured connector should be set up with the appropriate credentials to run the operation, and other configuration information, such as the AWS region that contains any resources referenced in the operation.

#### Configuration
<a name="automations-actions-reference-s3-put-object-properties-configuration"></a>

The required options to be used in the `PutObject` command. The options are as follows:

**Note**  
For more information about the `Amazon S3 PutObject` operation, see [PutObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) in the *Amazon Simple Storage Service API Reference*.
+ **Bucket:** The name of the Amazon S3 bucket in which to put an object.
+ **Key:** The unique name of the object to be put into the Amazon S3 bucket.
+ **Body:** The content of the object to be put into the Amazon S3 bucket.

#### Mocked output
<a name="automations-actions-reference-s3-put-object-properties-mocked-output"></a>

Actions do not interact with external services or resources in the preview environment. The **Mocked output** field is used to provide a JSON expression that simulates the behavior of a connector in the preview environment for testing purposes. This snippet is stored in the action's `results` map, just like the connector response would be for a published app in the live environment.

With this field, you can test various scenarios and their impact on other actions within the automation such as simulating different result values, error scenarios, edge cases, or unhappy paths without communicating with external services through connectors.

## Amazon S3: Delete object
<a name="automations-actions-reference-s3-delete-object"></a>

Uses the `Amazon S3 DeleteObject` operation to delete an object identified by a key (file path) from a specified Amazon S3 bucket.

### Properties
<a name="automations-actions-reference-s3-delete-object-properties"></a>

#### Connector
<a name="automations-actions-reference-s3-delete-object-properties-connector"></a>

The connector to be used for the operations run by this action. The configured connector should be set up with the proper credentials to run the operation, and other configuration information, such as the AWS region that contains any resources referenced in the operation.

#### Configuration
<a name="automations-actions-reference-s3-delete-object-properties-configuration"></a>

The required options to be used in the `DeleteObject` command. The options are as follows:

**Note**  
For more information about the `Amazon S3 DeleteObject` operation, see [DeleteObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) in the *Amazon Simple Storage Service API Reference*.
+ **Bucket:** The name of the Amazon S3 bucket from which to delete an object.
+ **Key:** The unique name of the object to be deleted from the Amazon S3 bucket.

#### Mocked output
<a name="automations-actions-reference-s3-delete-object-properties-mocked-output"></a>

Actions do not interact with external services or resources in the preview environment. The **Mocked output** field is used to provide a JSON expression that simulates the behavior of a connector in the preview environment for testing purposes. This snippet is stored in the action's `results` map, just like the connector response would be for a published app in the live environment.

With this field, you can test various scenarios and their impact on other actions within the automation such as simulating different result values, error scenarios, edge cases, or unhappy paths without communicating with external services through connectors.

## Amazon S3: Get object
<a name="automations-actions-reference-s3-get-object"></a>

Uses the `Amazon S3 GetObject` operation to retrieve an object identified by a key (file path) from a specified Amazon S3 bucket.

### Properties
<a name="automations-actions-reference-s3-get-object-properties"></a>

#### Connector
<a name="automations-actions-reference-s3-get-object-properties-connector"></a>

The connector to be used for the operations run by this action. The configured connector should be set up with the proper credentials to run the operation, and other configuration information, such as the AWS region that contains any resources referenced in the operation.

#### Configuration
<a name="automations-actions-reference-s3-get-object-properties-configuration"></a>

The required options to be used in the `GetObject` command. The options are as follows:

**Note**  
For more information about the `Amazon S3 GetObject` operation, see [GetObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) in the *Amazon Simple Storage Service API Reference*.
+ **Bucket:** The name of the Amazon S3 bucket from which to retrieve an object.
+ **Key:** The unique name of the object to be retrieved from the Amazon S3 bucket.

#### Mocked output
<a name="automations-actions-reference-s3-get-object-properties-mocked-output"></a>

Actions do not interact with external services or resources in the preview environment. The **Mocked output** field is used to provide a JSON expression that simulates the behavior of a connector in the preview environment for testing purposes. This snippet is stored in the action's `results` map, just like the connector response would be for a published app in the live environment.

With this field, you can test various scenarios and their impact on other actions within the automation such as simulating different result values, error scenarios, edge cases, or unhappy paths without communicating with external services through connectors.

## Amazon S3: List objects
<a name="automations-actions-reference-s3-list-objects"></a>

Uses the `Amazon S3 ListObjects` operation to list objects in a specified Amazon S3 bucket.

### Properties
<a name="automations-actions-reference-s3-list-objects-properties"></a>

#### Connector
<a name="automations-actions-reference-s3-list-objects-properties-connector"></a>

The connector to be used for the operations run by this action. The configured connector should be set up with the proper credentials to run the operation, and other configuration information, such as the AWS region that contains any resources referenced in the operation.

#### Configuration
<a name="automations-actions-reference-s3-list-objects-properties-configuration"></a>

The required options to be used in the `ListObjects` command. The options are as follows:

**Note**  
For more information about the `Amazon S3 ListObjects` operation, see [ListObjects](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html) in the *Amazon Simple Storage Service API Reference*.
+ **Bucket:** The name of the Amazon S3 bucket from which to list objects.

#### Mocked output
<a name="automations-actions-reference-s3-list-objects-properties-mocked-output"></a>

Actions do not interact with external services or resources in the preview environment. The **Mocked output** field is used to provide a JSON expression that simulates the behavior of a connector in the preview environment for testing purposes. This snippet is stored in the action's `results` map, just like the connector response would be for a published app in the live environment.

With this field, you can test various scenarios and their impact on other actions within the automation such as simulating different result values, error scenarios, edge cases, or unhappy paths without communicating with external services through connectors.

## Amazon Textract: Analyze document
<a name="automations-actions-reference-textract-analyze-document"></a>

Uses the `Amazon Textract AnalyzeDocument` operation to analyze an input document for relationships between detected items.

### Properties
<a name="automations-actions-reference-textract-analyze-document-properties"></a>

#### Connector
<a name="automations-actions-reference-textract-analyze-document-properties-connector"></a>

The connector to be used for the operations run by this action. The configured connector should be set up with the proper credentials to run the operation, and other configuration information, such as the AWS region that contains any resources referenced in the operation.

#### Configuration
<a name="automations-actions-reference-textract-analyze-document-properties-configuration"></a>

The content of the request to be used in the `AnalyzeDocument` command. The options are as follows:

**Note**  
For more information about the `Amazon Textract AnalyzeDocument` operation, see [AnalyzeDocument](https://docs.aws.amazon.com/textract/latest/dg/API_AnalyzeDocument.html) in the *Amazon Textract Developer Guide*.
+ **Document / S3Object / Bucket:** The name of the Amazon S3 bucket. This parameter can be left empty if a file is passed to the action with the **S3 upload** component.
+ **Document / S3Object / Name:** The file name of the input document. This parameter can be left empty if a file is passed to the action with the **S3 upload** component.
+ **Document / S3Object / Version:** If the Amazon S3 bucket has versioning enabled, you can specify the version of the object. This parameter can be left empty if a file is passed to the action with the **S3 upload** component.
+ **FeatureTypes:** A list of the types of analysis to perform. Valid values are: `TABLES`, `FORMS`, `QUERIES`, `SIGNATURES`, and `LAYOUT`.

#### Mocked output
<a name="automations-actions-reference-textract-analyze-document-properties-mocked-output"></a>

Actions do not interact with external services or resources in the preview environment. The **Mocked output** field is used to provide a JSON expression that simulates the behavior of a connector in the preview environment for testing purposes. This snippet is stored in the action's `results` map, just like the connector response would be for a published app in the live environment.

With this field, you can test various scenarios and their impact on other actions within the automation such as simulating different result values, error scenarios, edge cases, or unhappy paths without communicating with external services through connectors.

## Amazon Textract: Analyze expense
<a name="automations-actions-reference-textract-analyze-expense"></a>

Uses the `Amazon Textract AnalyzeExpense` operation to analyze an input document for financially-related relationships between text.

### Properties
<a name="automations-actions-reference-textract-analyze-expense-properties"></a>

#### Connector
<a name="automations-actions-reference-textract-analyze-expense-properties-connector"></a>

The connector to be used for the operations run by this action. The configured connector should be set up with the proper credentials to run the operation, and other configuration information, such as the AWS region that contains any resources referenced in the operation.

#### Configuration
<a name="automations-actions-reference-textract-analyze-expense-properties-configuration"></a>

The content of the request to be used in the `AnalyzeExpense` command. The options are as follows:

**Note**  
For more information about the `Amazon Textract AnalyzeExpense` operation, see [AnalyzeExpense](https://docs.aws.amazon.com/textract/latest/dg/API_AnalyzeExpense.html) in the *Amazon Textract Developer Guide*.
+ **Document / S3Object / Bucket:** The name of the Amazon S3 bucket. This parameter can be left empty if a file is passed to the action with the **S3 upload** component.
+ **Document / S3Object / Name:** The file name of the input document. This parameter can be left empty if a file is passed to the action with the **S3 upload** component.
+ **Document / S3Object / Version:** If the Amazon S3 bucket has versioning enabled, you can specify the version of the object. This parameter can be left empty if a file is passed to the action with the **S3 upload** component.

#### Mocked output
<a name="automations-actions-reference-textract-analyze-expense-properties-mocked-output"></a>

Actions do not interact with external services or resources in the preview environment. The **Mocked output** field is used to provide a JSON expression that simulates the behavior of a connector in the preview environment for testing purposes. This snippet is stored in the action's `results` map, just like the connector response would be for a published app in the live environment.

With this field, you can test various scenarios and their impact on other actions within the automation such as simulating different result values, error scenarios, edge cases, or unhappy paths without communicating with external services through connectors.

## Amazon Textract: Analyze ID
<a name="automations-actions-reference-textract-analyze-id"></a>

Uses the `Amazon Textract AnalyzeID` operation to analyze an identity document for relevant information.

### Properties
<a name="automations-actions-reference-textract-analyze-id-properties"></a>

#### Connector
<a name="automations-actions-reference-textract-analyze-id-properties-connector"></a>

The connector to be used for the operations run by this action. The configured connector should be set up with the proper credentials to run the operation, and other configuration information, such as the AWS region that contains any resources referenced in the operation.

#### Configuration
<a name="automations-actions-reference-textract-analyze-id-properties-configuration"></a>

The content of the request to be used in the `AnalyzeID` command. The options are as follows:

**Note**  
For more information about the `Amazon Textract AnalyzeID` operation, see [AnalyzeID](https://docs.aws.amazon.com/textract/latest/dg/API_AnalyzeID.html) in the *Amazon Textract Developer Guide*.
+ **Document / S3Object / Bucket:** The name of the Amazon S3 bucket. This parameter can be left empty if a file is passed to the action with the **S3 upload** component.
+ **Document / S3Object / Name:** The file name of the input document. This parameter can be left empty if a file is passed to the action with the **S3 upload** component.
+ **Document / S3Object / Version:** If the Amazon S3 bucket has versioning enabled, you can specify the version of the object. This parameter can be left empty if a file is passed to the action with the **S3 upload** component.

#### Mocked output
<a name="automations-actions-reference-textract-analyze-id-properties-mocked-output"></a>

Actions do not interact with external services or resources in the preview environment. The **Mocked output** field is used to provide a JSON expression that simulates the behavior of a connector in the preview environment for testing purposes. This snippet is stored in the action's `results` map, just like the connector response would be for a published app in the live environment.

With this field, you can test various scenarios and their impact on other actions within the automation such as simulating different result values, error scenarios, edge cases, or unhappy paths without communicating with external services through connectors.

## Amazon Textract: Detect doc text
<a name="automations-actions-reference-textract-detect-document-text"></a>

Uses the `Amazon Textract DetectDocumentText` operation to detect lines of text and the words that make up a line of text in an input document.

### Properties
<a name="automations-actions-reference-textract-detect-document-text-properties"></a>

#### Connector
<a name="automations-actions-reference-textract-detect-document-text-properties-connector"></a>

The connector to be used for the operations run by this action. The configured connector should be set up with the proper credentials to run the operation, and other configuration information, such as the AWS region that contains any resources referenced in the operation.

#### Configuration
<a name="automations-actions-reference-textract-detect-document-text-properties-configuration"></a>

The content of the request to be used in the `DetectDocumentText` command. The options are as follows:

**Note**  
For more information about the `Amazon Textract DetectDocumentText` operation, see [DetectDocumentText](https://docs.aws.amazon.com/textract/latest/dg/API_DetectDocumentText.html) in the *Amazon Textract Developer Guide*.
+ **Document / S3Object / Bucket:** The name of the Amazon S3 bucket. This parameter can be left empty if a file is passed to the action with the **S3 upload** component.
+ **Document / S3Object / Name:** The file name of the input document. This parameter can be left empty if a file is passed to the action with the **S3 upload** component.
+ **Document / S3Object / Version:** If the Amazon S3 bucket has versioning enabled, you can specify the version of the object. This parameter can be left empty if a file is passed to the action with the **S3 upload** component.

#### Mocked output
<a name="automations-actions-reference-textract-detect-document-text-properties-mocked-output"></a>

Actions do not interact with external services or resources in the preview environment. The **Mocked output** field is used to provide a JSON expression that simulates the behavior of a connector in the preview environment for testing purposes. This snippet is stored in the action's `results` map, just like the connector response would be for a published app in the live environment.

With this field, you can test various scenarios and their impact on other actions within the automation such as simulating different result values, error scenarios, edge cases, or unhappy paths without communicating with external services through connectors.

## Amazon Bedrock: GenAI Prompt
<a name="automations-actions-reference-bedrock-prompt"></a>

Uses the [Amazon Bedrock InvokeModel](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModel.html) operation to run inference using the prompt and inference parameters provided in the action properties. The action can generate text, images, and embeddings.

### Properties
<a name="automations-actions-reference-bedrock-prompt-properties"></a>

#### Connector
<a name="automations-actions-reference-bedrock-prompt-properties-connector"></a>

The connector to be used for the operations run by this action. To use this action successfully, the connector must be configured with **Amazon Bedrock Runtime** as the service. The configured connector should be set up with the proper credentials to run the operation, and other configuration information, such as the AWS region that contains any resources referenced in the operation.

#### Model
<a name="automations-actions-reference-bedrock-prompt-properties-model"></a>

The foundation model to be used by Amazon Bedrock to process the request. For more information about models in Amazon Bedrock, see [Amazon Bedrock foundation model information](https://docs.aws.amazon.com/bedrock/latest/userguide/foundation-models-reference.html) in the *Amazon Bedrock User Guide*.

#### Input type
<a name="automations-actions-reference-bedrock-prompt-properties-input-type"></a>

The input type of the input send to the Amazon Bedrock model. The possible values are **Text**, **Document**, and **Image**. If an input type is not available for selection, it is likely not supported by the configured model.

#### User prompt
<a name="automations-actions-reference-bedrock-prompt-properties-user-prompt"></a>

The prompt to be sent to the Amazon Bedrock model to be processed to generate a response. You can enter static text, or pass in an input from another part of your application, such as from a component using parameters, a previous action in the automation, or another automation. The following examples show how to pass in a value from a component or previous action:
+ To pass a value from a component using paramters: `{{params.paramName}}`
+ To pass a value from a previous action: `{{results.actionName}}`

#### System prompt (Claude models)
<a name="automations-actions-reference-bedrock-prompt-properties-system-prompt"></a>

The system prompt to be used by the Amazon Bedrock model when processing the request. The system prompt is used to provide context, instructions, or guidelines to Claude models.

#### Request settings
<a name="automations-actions-reference-bedrock-prompt-properties-request-settings"></a>

Configure various request settings and model inference parameters. You can configure the following settings:
+ **Temperature**: The temperature to be used by the Amazon Bedrock model when processing the request. The temperature determines the randomness or creativity of the Bedrock model's output. The higher the temperature, the more creative and less analytical the response will be. Possible values are `[0-10]`.
+ **Max Tokens**: Limit the length of the output of the Amazon Bedrock model.
+ **TopP**: In nucleus sampling, the model computes the cumulative distribution over all the options for each subsequent token in decreasing probability order and cuts it off once it reaches a particular probability specified by the **TopP**. You should alter either **temperature** or **TopP**, but not both
+ **Stop Sequences**: Sequences that cause the model to stop processing the request and generating output.

For more information, see [Inference request parameters and response fields for foundation models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html) in the *Amazon Bedrock User Guide*.

#### Stop Sequences
<a name="automations-actions-reference-bedrock-prompt-properties-guardrail"></a>

Enter an Amazon Bedrock Guardrail **ID** and **Version**. Guardrails are used to implement safeguards based on your use cases and responsible AI policies. For more information, see [Stop harmful content in models using Amazon Bedrock Guardrails](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html) in the *Amazon Bedrock User Guide*.

#### Mocked output
<a name="automations-actions-reference-bedrock-prompt-properties-mocked-output"></a>

Actions do not interact with external services or resources in the preview environment. The **Mocked output** field is used to provide a JSON expression that simulates the behavior of a connector in the preview environment for testing purposes. This snippet is stored in the action's `results` map, just like the connector response would be for a published app in the live environment.

With this field, you can test various scenarios and their impact on other actions within the automation such as simulating different result values, error scenarios, edge cases, or unhappy paths without communicating with external services through connectors.

## Amazon Bedrock: Invoke model
<a name="automations-actions-reference-bedrock-invoke-model"></a>

Uses the [Amazon Bedrock InvokeModel](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModel.html) operation to run inference using the prompt and inference parameters provided in the request body. You use model inference to generate text, images, and embeddings.

### Properties
<a name="automations-actions-reference-bedrock-invoke-model-properties"></a>

#### Connector
<a name="automations-actions-reference-bedrock-invoke-model-properties-connector"></a>

The connector to be used for the operations run by this action. To use this action successfully, the connector must be configured with **Amazon Bedrock Runtime** as the service. The configured connector should be set up with the proper credentials to run the operation, and other configuration information, such as the AWS region that contains any resources referenced in the operation.

#### Configuration
<a name="automations-actions-reference-bedrock-invoke-model-properties-configuration"></a>

The content of the request to be used in the `InvokeModel` command.

**Note**  
For more information about the `Amazon Bedrock InvokeModel` operation, including example commands, see [InvokeModel](https://docs.aws.amazon.com/textract/latest/dg/API_DetectDocumentText.html) in the *Amazon Bedrock API Reference*.

#### Mocked output
<a name="automations-actions-reference-bedrock-invoke-model-properties-mocked-output"></a>

Actions do not interact with external services or resources in the preview environment. The **Mocked output** field is used to provide a JSON expression that simulates the behavior of a connector in the preview environment for testing purposes. This snippet is stored in the action's `results` map, just like the connector response would be for a published app in the live environment.

With this field, you can test various scenarios and their impact on other actions within the automation such as simulating different result values, error scenarios, edge cases, or unhappy paths without communicating with external services through connectors.

## JavaScript
<a name="automations-actions-reference-javascript"></a>

Runs a custom JavaScript function to return a specified value.

**Important**  
App Studio does not support using third-party or custom JavaScript libraries.

### Properties
<a name="automations-actions-reference-javascript-properties"></a>

#### Source code
<a name="automations-actions-reference-javascript-properties-source-code"></a>

The JavaScript code snippet to be run by the action.

**Tip**  
You can use AI to help generate JavaScript for you by performing the following steps:  
Choose the expand icon to open the expanded JavaScript editor.
(Optional): Enable the **Modify code** toggle to modify any existing JavaScript. Otherwise, AI will replace any existing JavaScript.
In **Generate JavaScript**, describe what you want to do with JavaScript, for example: **Add two numbers**.
Choose the send icon to generate your JavaScript.

## Invoke automation
<a name="automations-actions-reference-invoke-automation"></a>

Runs a specified automation.

### Properties
<a name="automations-actions-reference-invoke-automation-properties"></a>

#### Invoke Automation
<a name="automations-actions-reference-invoke-automation-properties-invoke-automation"></a>

The automation to be run by the action.

## Send email
<a name="automations-actions-reference-send-email"></a>

Uses the `Amazon SES SendEmail` operation to send an email.

### Properties
<a name="automations-actions-reference-send-email-properties"></a>

#### Connector
<a name="automations-actions-reference-send-email-properties-connector"></a>

The connector to be used for the operations run by this action. The configured connector should be set up with the proper credentials to run the operation, and other configuration information, such as the AWS region that contains any resources referenced in the operation.

#### Configuration
<a name="automations-actions-reference-send-email-properties-configuration"></a>

The content of the request to be used in the `SendEmail` command. The options are as follows:

**Note**  
For more information about the `Amazon SES SendEmail` operation, see [SendEmail](https://docs.aws.amazon.com/ses/latest/APIReference-V2/API_SendEmail.html) in the *Amazon Simple Email Service API Reference*.

#### Mocked output
<a name="automations-actions-reference-send-email-properties-mocked-output"></a>

Actions do not interact with external services or resources in the preview environment. The **Mocked output** field is used to provide a JSON expression that simulates the behavior of a connector in the preview environment for testing purposes. This snippet is stored in the action's `results` map, just like the connector response would be for a published app in the live environment.

With this field, you can test various scenarios and their impact on other actions within the automation such as simulating different result values, error scenarios, edge cases, or unhappy paths without communicating with external services through connectors.