# Stacksync Email Trigger

Email Trigger enables inbound email ingestion for workflows by exposing a dedicated, Stacksync-managed address. Each received email deterministically creates a workflow execution and provides the normalized email payload to downstream modules for processing.

### 1. Add the Email Trigger Module

1.1 Create a workflow and click on **Create Trigger**.

1.2 Add **Receive Email** from the Stacksync modules.

1.3 Connect the trigger to Input module to enable processing.

1.4 Save the workflow to activate the trigger.<br>

<figure><img src="https://3389950191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO4RFXIz4V8iqghJ3JVSs%2Fuploads%2FDyToHIjWIiUk8uTmJsvb%2Fimage.png?alt=media&#x26;token=c3588720-d59a-41fc-b647-b633b6faa3c5" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3389950191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO4RFXIz4V8iqghJ3JVSs%2Fuploads%2F5lVAyE89T6F5WFQz8Cbx%2Fimage.png?alt=media&#x26;token=f5e43a18-4ba3-426e-8001-eaa25a36cd90" alt=""><figcaption></figcaption></figure>

**Operational Behavior**

* Each Email Trigger instance provisions a unique email address bound to this workflow.
* Multiple Email Trigger modules can be added to the same workflow, each receives a distinct email address.
* Activation requires a edge connection to input node.
* Disconnecting edge pauses ingestion.
* Deleting the module disables ingestion.

### 2. Get the Workflow Email Address

2.1 Open the module configuration panel.

2.2 Copy the **Workflow Email Address** displayed.

**Example**

```
w_6.wf_3279abcf0fac48e18ca437478844035c.example@stacksync.email
```

**Constraints**

* Domain: `@stacksync.email`.
* Activation: immediate after connect and saved.

### 3. Configure a Custom Alias (Optional)

3.1 Enter a human-friendly alias in the alias field.

3.2 Confirm availability.

3.3 Save to apply changes.

**Alias Format**

```
{alias}@stacksync.email
```

**Examples**

* `order-intake@stacksync.email`
* `team.alerts@stacksync.email`
* `onboarding_requests@stacksync.email`

**Alias Requirements**

* Length greater then 3 characters.
* Characters: lowercase letters, numbers, `.`, `-`, `_`.

**Alias Behavior**

* Alias activation is immediate upon save.
* The previously configured alias is disabled immediately upon change.
* The system-generated workflow email address remains permanently active.
* When an alias is configured, both the workflow email address and the alias independently trigger the same workflow.<br>

  <figure><img src="https://3389950191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO4RFXIz4V8iqghJ3JVSs%2Fuploads%2FYcQ5pQG8NbbSlZmuB9rZ%2Fimage.png?alt=media&#x26;token=2e1cc2c2-c2c2-442c-94f6-66fe0d6bacb7" alt=""><figcaption></figcaption></figure>

### 4. Email Payload Available to the Workflow

4.1 **Email Fields**

| Field       | Description                                   | Example                              |
| ----------- | --------------------------------------------- | ------------------------------------ |
| from        | Sender address                                | `customer@example.com`               |
| to          | Recipient address(es)                         | `order-intake@stacksync.email`       |
| subject     | Subject line                                  | `New order — #4021`                  |
| text        | Plain-text body                               | `Please process the order...`        |
| html        | HTML body (if present)                        | `<p>Please process the order...</p>` |
| headers     | Standard headers (message-id, reply-to, etc.) | —                                    |
| attachments | Attachment list                               | See 4.2                              |

4.2 **Attachments** (auto-ingested and stored securely)

| Property      | Description                     | Example           |
| ------------- | ------------------------------- | ----------------- |
| filename      | Original file name              | `invoice.pdf`     |
| content\_type | MIME type                       | `application/pdf` |
| file\_id      | Reference for downstream access | `file_a1b2c3d4`   |

<figure><img src="https://3389950191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO4RFXIz4V8iqghJ3JVSs%2Fuploads%2FDFYlfX8KUcrRLMQQWGr4%2Fimage.png?alt=media&#x26;token=06e2dd15-e1a0-4f9d-af05-9a24eccc41ac" alt=""><figcaption></figcaption></figure>

### 5. Email Routing & Operations

5.1 **Address Uniqueness & Isolation**

* Each Email Trigger is assigned a unique, Stacksync-managed email address.
* Emails sent to that address are routed exclusively to the workflow where the trigger is configured.

5.2 Pause ingestion: disconnect the Email Trigger module.

5.3 Resume ingestion: reconnect and save.

5.4 Address rotation: update alias and notify senders.
