

Amazon CodeCatalyst is no longer open to new customers. Existing customers can continue to use the service as normal. For more information, see [How to migrate from CodeCatalyst](migration.md).

# Defining an input artifact
<a name="workflows-working-artifacts-refer"></a>

If you want to use an artifact generated by another Amazon CodeCatalyst action, you must specify it as an input to the current action. You may be able to specify multiple artifacts as input—it depends on the action. For more information, see the [Workflow YAML definition](workflow-reference.md) for your action.

**Note**  
You cannot reference artifacts from other workflows.

Use the following instructions to specify an artifact from another action as input to the current action.

**Prerequisite**  
Before you begin, make sure you have output the artifact from the other action. For more information, see [Defining an output artifact](workflows-working-artifacts-output.md). Outputting the artifact makes it available for other actions to use.

------
#### [ Visual ]

**To specify an artifact as input to an action (visual editor)**

1. Open the CodeCatalyst console at [https://codecatalyst.aws/](https://codecatalyst.aws/).

1. Choose your project.

1. In the navigation pane, choose **CI/CD**, and then choose **Workflows**.

1. Choose the name of your workflow. You can filter by the source repository or branch name where the workflow is defined, or filter by workflow name or status.

1. Choose **Edit**.

1. Choose **Visual**.

1. In the workflow diagram, choose the action where you want to specify an artifact as input.

1. Choose **Inputs**.

1. In **Artifacts - optional**, do the following:

   Specify artifacts from previous actions that you want to provide as input to this action. These artifacts must already be defined as output artifacts in previous actions.

   If you do not specify any input artifacts, then you must specify at least one source repository under `action-name/Inputs/Sources`.

   For more information about artifacts, including examples, see [Sharing artifacts and files between actions](workflows-working-artifacts.md).
**Note**  
If the **Artifacts - optional** drop-down list is unavailable (visual editor), or if you get errors in when you validate your YAML (YAML editor), it might be because the action only supports one input. In this case, try removing the source input.

1. (Optional) Choose **Validate** to validate the workflow's YAML code before committing.

1. Choose **Commit**, enter a commit message, and choose **Commit** again.

------
#### [ YAML ]

**To specify an artifact as input to an action (YAML editor)**

1. Open the CodeCatalyst console at [https://codecatalyst.aws/](https://codecatalyst.aws/).

1. Choose your project.

1. In the navigation pane, choose **CI/CD**, and then choose **Workflows**.

1. Choose the name of your workflow. You can filter by the source repository or branch name where the workflow is defined, or filter by workflow name or status.

1. Choose **Edit**.

1. Choose **YAML**.

1. In the action where you want to specify the artifact as input, add code similar to the following:

   ```
   action-name:
     Inputs:
       Artifacts:
         - artifact-name
   ```

   For more examples, see [Examples of artifacts](workflows-working-artifacts-ex.md).

1. (Optional) Choose **Validate** to validate the workflow's YAML code before committing.

1. Choose **Commit**, enter a commit message, and choose **Commit** again.

------