Skip to content

Add the UI explanations for the automations docs #2497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,29 +53,29 @@ Port gives you no-code components to create the experience you want for your use

Self-service actions are created and managed in the [Self-service](https://app.getport.io/self-serve) page of your portal.

To begin, click on the `+ New Action` button in the top right corner, then follow the steps below.
To begin, click on the `+ Action` button in the top right corner, then follow the steps below.

:::tip Other supported methods
Besides Port's UI, you can also create and manage self-service actions using [Port's API](/api-reference/create-an-action-automation), or [Terraform](https://registry.terraform.io/providers/port-labs/port-labs/latest/docs/resources/port_action).
:::

### Step 1 - setup the action's frontend
### Set up the action's frontend

Choose the name of the action, its icon, and the inputs you would like the user to fill out when executing it.
Port supports a wide variety of input types, including more advanced conditions to best fit the experience you want for your users.

See [Setup frontend](/actions-and-automations/create-self-service-experiences/setup-ui-for-action/) for instructions and examples.
See [Set up frontend](/actions-and-automations/create-self-service-experiences/setup-ui-for-action/) for instructions and examples.

### Step 2 - setup backend
### Set up backend

Setup the logic responsible to handle the action after it is executed.
Set up the logic responsible to handle the action after it is executed.
In this step you can also define the payload that will be sent to your handler upon execution.

The backend logic is yours, so it can do whatever you need it to do. Port supports many different backends for actions, offering a secure and compliant architecture.

As part of your backend and its logic implementation, you can keep your software catalog up to date by sending API requests or ingesting new data that is tied to the performed action (for example, adding a new service entity in Port once the scaffold process has finished).

See [Setup backend](/actions-and-automations/create-self-service-experiences/setup-the-backend/) for instructions and examples.
See [Set up backend](/actions-and-automations/create-self-service-experiences/setup-the-backend/) for instructions and examples.

<center>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "Setup action RBAC",
"label": "Set up action RBAC",
"position": 3
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "Setup backend",
"label": "Set up backend",
"position": 2
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Setup backend
title: Set up backend
---

import DocCardList from '@theme/DocCardList';
Expand All @@ -9,7 +9,7 @@ import PayloadAdvancedFunctions from '/docs/actions-and-automations/templates/_p
import BackendTypesJson from '/docs/actions-and-automations/templates/_backend-types-json.md'
import ExecuteActionLocations from '/docs/actions-and-automations/create-self-service-experiences/templates/_execute_action_locations.mdx'

# Setup backend
# Set up backend

<center>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "Setup frontend",
"label": "Set up frontend",
"position": 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Automations in Port are triggered by events in your infrastructure, such as a ne

Port uses the same backend types for both automations and [self-service actions](/actions-and-automations/create-self-service-experiences/).

## Common automations
## 💡 Common automations

- Create a new incident in PagerDuty when CPU usage is greater than X%.
- Destroy an ephemeral environment when its TTL expires.
Expand All @@ -28,13 +28,24 @@ Automations are comprised of two parts:
<img src="/img/automations/architecture.jpg" width="80%" border='1px' />
</center><br/>

When an event occurs in your software catalog, Port will automatically trigger the associated backend, given that the automation is enabled.
When an event occurs in your software catalog, Port will automatically trigger the associated backend, given that the automation is enabled.

By default, automations are disabled and can be used as drafts until ready to be activated. You can enable them by setting the `publish` field to `true` in their JSON definition.
## Define an automation

Automations are defined in the [Automations page](https://app.getport.io/settings/automations) of your portal.
Here you can create, edit, and delete automations, as well as enable or disable them.
Click on the `+ Automation` button in the top-right corner, then follow the steps below:

1. Define the basic details for the automation: `title`, `identifier`, `description`, `icon`, and `active` status.

2. Set up the [trigger](/actions-and-automations/define-automations/setup-trigger).

3. Define the [backend](/actions-and-automations/define-automations/setup-action) that will be executed when the trigger event occurs, then click `Save`.

## Automation JSON structure

Automations are defined in JSON format. The JSON structure looks like this:
Automations can also be defined using a JSON format.
The JSON structure looks like this:

```json showLineNumbers
{
Expand Down Expand Up @@ -62,6 +73,8 @@ Automations are defined in JSON format. The JSON structure looks like this:
}
```
<br/>
Make sure to set the `publish` field to `true` if you want to enable the automation.

The table below describes the fields in the JSON structure (fields in **bold** are required):
| Field | Description |
| --- | --- |
Expand All @@ -73,18 +86,6 @@ The table below describes the fields in the JSON structure (fields in **bold** a
| **`invocationMethod`** | An object containing data about the automation's invocation method. See [Setup action](/actions-and-automations/define-automations/setup-action) for more information. |
| `publish` | A boolean value indicating whether the automation is enabled or disabled (`false` by default). |

## Define an automation

Automations are defined in the [Automations page](https://app.getport.io/settings/automations) of your portal. Here you can create, edit, and delete automations, as well as enable or disable them.

1. Click on the `+ New automation` button in the top-right corner. This will open a JSON form where you can define the automation's configuration.

2. Change the JSON configuration to match your desired automation:
* Setup the [trigger](/actions-and-automations/define-automations/setup-trigger).
* Define the [backend](/actions-and-automations/define-automations/setup-action) that will be executed when the trigger event occurs.

3. Make sure to set the `publish` field to `true` if you want to enable the automation. When finished, click `Save`.

## Examples

See some examples of automation definitions [here](/actions-and-automations/define-automations/examples).
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
---
sidebar_position: 2
title: Setup backend
title: Set up backend
---

import BackendTypesJson from '/docs/actions-and-automations/templates/_backend-types-json.md'
import PayloadAdvancedFunctions from '/docs/actions-and-automations/templates/_payload_advanced_functions.mdx'
import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"

# Setup backend
# Set up backend

The automation's backend is the logic that you want to execute when a trigger event occurs. It will run on all entities tied to the blueprint specified in the automation's definition, whenever the trigger event occurs.

The automation's backend is defined under the `Backend` tab of the automation creation form in the UI.
Port uses the same backend types for automations and for [self-service actions](/actions-and-automations/create-self-service-experiences/).

## Backend JSON structure

The backend is defined under the `invocationMethod` key in the automation's JSON structure:
The backend can also be edited under the `invocationMethod` key in the automation's JSON structure:

```json showLineNumbers
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
---
sidebar_position: 1
title: Setup trigger
title: Set up trigger
---

import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"

# Setup trigger
# Set up trigger

After specifying your automation’s basic details including the `title`, `identifier`, `description`, `icon`, and `active` status, the next step is to choose a **trigger** for the automation.

Automation triggers events in your software catalog that you want to act upon.
Port supports two types of triggers:
- **Entity**: Triggered when an an entity of a specified blueprint is modified.
- **Action run**: Triggered when an [action run](/actions-and-automations/reflect-action-progress/) of a specified action is modified.

If you select an entity trigger, you will need to specify the relevant blueprint.
If you select an action run trigger, you will need to specify the corresponding action.

## Available triggers

The following trigger events are available for each type:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Setup backend
title: Set up backend
---

import DocCardList from '@theme/DocCardList';
Expand Down