# Actions

> Every action a workflow can take, its settings, and the variables that fill messages with each contact's data.

Source: https://docs.komplian.com/flows/actions

Where: Flows → your workflow → Actions
Who: Owners, admins and managers edit workflows.
Plan: Growth+

An action is a step that does something: sends a message, changes a record, or tells your team or another tool. A workflow runs its actions in the order you connect them.

## Add an action

### 1. Drag the action
In the builder, drag a step from **Actions** onto the canvas and connect it to the step before.

### 2. Configure it
Click the action and fill its settings. Messages are sent from templates, so pick the **Template** first.

### 3. Decide what happens on failure
Tick **Continue flow if this action fails** to keep the run going when this action fails. Untick it to stop the run there.

## Write to the customer

Every channel message comes from a [template](https://docs.komplian.com/templates/overview). Under **Optional overrides** you can replace a template variable for this flow only. When the flow runs, a value is taken from the template's defaults, then from what the flow knows, then from your overrides. The last one found wins.

| Action | What it sends | Needs |
| --- | --- | --- |
| **Send WhatsApp** | A WhatsApp template. | [WhatsApp](https://docs.komplian.com/channels/whatsapp) connected. |
| **Send Email** | An email template to the **Recipients** you choose: **Contact email**, **Fixed recipients** (the **Email addresses** you write) or **Workspace owners/admins**. In a flow that starts from a quote request, the email can carry **the request's documents** (what the customer sent and the offer that went out, up to 15 MB): on by default for fixed recipients and the team, off for the contact. | A connected [mailbox](https://docs.komplian.com/channels/email). |
| **Send Instagram DM** | An Instagram template. | Instagram connected. The customer wrote in the last 24 hours. |
| **Reply to Comment by DM** | One private message to whoever wrote the comment that started the flow: an Instagram template and up to 3 link buttons. One per comment, within 7 days. | **Instagram Comment** trigger and the **Reply to Comments** switch. |
| **Reply to Comment Publicly** | An Instagram template posted as a reply under the comment. | **Instagram Comment** trigger and the **Reply to Comments** switch. |
| **Send Messenger message** | A Messenger template. | Messenger connected. The customer wrote in the last 24 hours. |
| **Send Telegram message** | A Telegram template. | Telegram connected. The customer has a chat with your bot. |
| **Start a guided conversation** | Enrols the contact in a [conversational flow](https://docs.komplian.com/flows/conversations). | A published conversational flow. Not available for web chat. |

When a channel is not connected, the action says so and the run skips it. The run then counts as **Skipped a step**.

**Start a guided conversation** adds the contact to that day's automatic send of the conversational flow, one send per day. It starts within a minute.

## Work on the record

| Action | What it does | Settings |
| --- | --- | --- |
| **Update Lead** | Moves the lead to a stage. | **New Status**: New, Contacted, Qualified, Proposal, Negotiation, Won or Lost. |
| **Add Tag** | Adds a tag to the contact. | **Tag Name**. |
| **Update Custom Field** | Writes a value in a field of the contact. | **Field Key** and **Value**. |
| **Internal Note** | Adds a note to the record for your team. | **Note Content**. |
| **Create Task** | Creates a task in [Contacts](https://docs.komplian.com/crm/tasks). | **Title**, an optional description and **Due in (days)**, 1 by default. |
| **Schedule Follow-up** | Creates a follow-up task. | The same as **Create Task**. |
| **Assign Agent** | Assigns the lead and its active conversation to a team member. | **Agent User ID**: the team member's user ID. |

## Tell your team and your tools

| Action | What it does | Settings |
| --- | --- | --- |
| **Send Slack Message** | Posts a Slack template. | **Send to**: **The conversation's thread** (only when the flow started from a Slack thread; otherwise the step is skipped), **A connected channel** (only channels connected in the Slack integration), or **An incoming webhook URL**. |
| **Send Internal Message** | Sends an internal template to your team inside Komplian. | The template. |
| **Integration action** | Sends what the flow knows to another system. | **Destination**: a webhook, Slack, Jira, Jira Service Management or Notion. These are the same destinations as a form's **Send to**. |
| **HTTP Request** | Calls any web address. | See the next section. |

### HTTP Request

| Setting | What it does |
| --- | --- |
| **Method** | The HTTP method, such as GET or POST. |
| **URL** | The address to call. It can contain variables. |
| **Headers** | One per line, as `Name: value`. They can contain variables. |
| **Body** | What is sent. Sent as JSON unless a Content-Type header says otherwise. |
| **Max retries** | How many times to try again after a failure. |
| **Retry delay (ms)** | How long to wait between tries, in milliseconds. |

The answer's status code is available to later steps as `{{http.statusCode}}`. Requests are not signed, so protect the receiving address another way.

## Variables

A variable is a placeholder like `{{contact.name}}` that each run fills with that contact's data. Press **Insert variable** in any text field to pick one. A variable only has a value when the trigger provides it: `order.*` is empty in a flow started by **New Lead**.

| Group | Variables |
| --- | --- |
| Contact | `contact.name`, `contact.email`, `contact.phone`, `contact.company` |
| Lead | `lead.id`, `lead.status`, `lead.source`, `lead.value` |
| Order | `order.id`, `order.total`, `order.currency`, `order.itemCount`, `order.trackingUrl`, `order.trackingNumber` |
| Quote | `quote.number`, `quote.title`, `quote.status`, `quote.total`, `quote.currency`, `quote.customerName`, `quote.dueAt` and more |
| Purchase order | `purchase.number`, `purchase.status`, `purchase.total`, `purchase.currency`, `purchase.supplierName` |
| Item | `item.name`, `item.sku`, `item.unit`, `item.quantity` (stock left), `item.reorderPoint`, `item.shortBy` |
| Batch | `lot.code`, `lot.expiresAt`, `lot.daysLeft`, `lot.quantity`, `lot.warehouseName` |
| Your business | `workspace.name`, `workspace.supportEmail` |
| Flow | `flow.name` |
| Date | `date.now` (date and time), `date.today` |
| Forms | `form.<address>.url`: the link of a published [form](https://docs.komplian.com/crm/forms) |
| HTTP | `http.statusCode` after an **HTTP Request** |

## Related

- [Triggers](https://docs.komplian.com/flows/triggers): What starts the workflow.
- [Conditions and waits](https://docs.komplian.com/flows/conditions): Choose which actions run and when.
- [Message templates](https://docs.komplian.com/templates/overview): The messages that actions send.
