# Automation Builder

Couchdrop automations are built using a visual builder that requires no code. The builder supports multiple steps through primary actions and sub-actions.&#x20;

## How the builder works

Automations have two main pathways. Moving **down** the tree are primary actions. Moving to the **right** are sub-actions.&#x20;

See the sample image below of an automation created with the visual builder.&#x20;

<figure><img src="https://391958821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpokYqd27yrOUxIBhyvbF%2Fuploads%2FkRv163YAUnjireANuysj%2FCouchdrop%20Automation%20Builder.jpg?alt=media&#x26;token=b177c1df-db74-4714-acfb-3158594dba99" alt=""><figcaption></figcaption></figure>

It's important to understand Primary Actions and Sub-actions and the processing order to avoid errors.&#x20;

## Primary Actions

Primary actions act on the **original** file. This means that when there is a Copy action, any sub-actions apply to the copy and do *not* apply to the original file. Because of this, some actions like "Rename File" are unavailable in Primary actions to avoid errors.&#x20;

## Sub-actions

Sub-actions are branches to the right. These actions act on the **modified** file if a second file has been created due to a copy or similar action. If there is only one file, Sub-actions act on the **original** file and function essentially the same as primary actions.&#x20;

## Processing Order

Automations are processed t**op-to-bottom, left-to-right**.  This means that sub-actions occur before the next primary action.

{% hint style="warning" %}
If a sub-action fails, then Couchdrop will NOT continue to process any child actions
{% endhint %}

The builder shows the order that actions will be processed by showing them at different levels, with higher levels processed first. Processing order is also indicated by the letter groupings and numbered subactions.&#x20;

See the image below for an example of processing order in a multi-step workflow.

<figure><img src="https://391958821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpokYqd27yrOUxIBhyvbF%2Fuploads%2Fp7i9yq2JwoOkYwj05TDa%2FCouchdrop%20Automation%20Order.jpg?alt=media&#x26;token=0698a1fa-098f-4bbd-b847-9e4e047378d5" alt=""><figcaption></figcaption></figure>

All A group actions will occur first in numerical order, followed by the B group, and so on.

### Modifying an automation&#x20;

Once an action is chosen, the action type cannot be changed directly. Instead, the action must first be deleted and then replaced with a new action.&#x20;

When deleting an automation action, if the action has sub-actions, those sub-actions will be deleted as well. When this applies, you will receive a warning explaining the number of actions that will be deleted and will need to confirm deletion.
