# Kairos Workflow Automation

Kairos Workflows allow you to automate tasks by connecting Triggers, Actions, and Logic nodes in a visual editor.

## Core concepts

* **Triggers:** Events that start a workflow (e.g., "Email Received", "Task Completed").
* **Actions:** Tasks performed by the system (e.g., "Send Email", "Add Row to Sheet").
* **Variables:** Data passed between nodes. You can access this data using **Templates**.

## Templating system

You can inject dynamic data into Text fields (like Email Body or SQL Queries) using double curly braces: `{{ variable.path }}`.

### Common variables

| Variable | Description |
| --- | --- |
| `{{ time.now }}` | Current date and time (YYYY-MM-DD HH:MM:SS) |
| `{{ time.date }}` | Current date (YYYY-MM-DD) |
| `{{ trigger.subject }}` | Subject of the email that triggered the workflow |
| `{{ trigger.sender }}` | Sender address of the triggering email |
| `{{ trigger.body }}` | Body content of the triggering email |
| `{{ trigger.title }}` | Title of the task (for Task triggers) |
| `{{ value.MyVar }}` | Custom variables defined in previous nodes |

### Date & time modifiers

When working with date/time variables (like `time.now` or a Task's `start_time`), you can chain modifiers to format them.

**Syntax:** `{{ variable.timezone.format }}`

* **Timezones:** `.EST`, `.CST`, `.PST`, `.MST` (and their DST counterparts like EDT/PDT)
* **Formatting:**
  + `.standard`: 12-hour format (e.g., "02:30 PM")
  + `.date`: Date only (YYYY-MM-DD)
  + `.time`: Time only (HH:MM:SS)
  + `.day_name`, `.month_name`: Full names (e.g., "Monday", "January")

**Example:**  
`{{ trigger.value.Soonest_Match.time.pst.standard }}`  
*Result:* 02:30 PM (converted to Pacific Time)

## Integrations

### Google Sheets

To use Google Sheets nodes, ensure you have connected your Google account in the Integrations settings.

* **Add Row:** Appends data to the bottom of a sheet. Accepts a JSON array of values.
* **Read Sheet:** Reads a range of cells. Returns data available as a variable.
* **Run Macro:** Executes a Google Apps Script function.

### Email

Triggers can listen for emails from specific senders or with specific subjects. Actions can send emails via Gmail (if connected) or standard system mail.
