> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fastgen.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Email-based

**Run workflows on incoming email.**

<img src="https://mintcdn.com/organa/IAAgt4Qjpzo5KMmv/images/workflow-email.webp?fit=max&auto=format&n=IAAgt4Qjpzo5KMmv&q=85&s=517bbd0257f545beacb90be7f8887233" alt="event-workflows-getting-started-header" width="1476" height="596" data-path="images/workflow-email.webp" />

## Overview

Email-based workflows are triggered by incoming emails.
You can designate a unique email address for each workflow, such as [prefix.my-app@fastgenapp.com](mailto:prefix.my-app@fastgenapp.com).
Whenever an email is sent to this address, the corresponding workflow will be initiated.

You can access details of the incoming email using the `$param` variable.

```json Example $param content theme={null}
{
  "attachments": [
    {
      "FileName": "fastgen-docs.pdf",
      "MimeType": "application/pdf",
      "Disposition": "attachment",
      "Related": true,
      "ContentId": "<f_lu9z06831>",
      "FileUrl": "https://attachments.fastgen-storage.com/seqWGaGNfADffidG7ViEulvyhFsgkVawOdlgbdXTR8ac8DDbZLLisn6KbhmBTXIkxFx1vOIhqIPd1m5YDQTs5MKosDUcutdcBJ2KwjabpyCf3RkMORnD1FI4g1LZxxOe.pdf"
    }
  ],
  "bcc": null,
  "cc": [
    {
        "Name": "",
        "Address": "cc@example.com"
    }
  ],
  "date": "2024-03-27T15:31:18.000Z",
  "from": {
    "Name": "John Doe",
    "Address": "john@fastgen.com"
  },
  "html": "<div dir=\"ltr\">This is a test email.<div><br></div><div>Good luck!<br clear=\"all\">\n\n",
  "inReplyTo": "",
  "messageId": "<CAFuLo8jgOdO7hS+EExc96Cyq3jrWr4zvNT9GmxnncqB9SBKR9g@mail.gmail.com>",
  "references": "",
  "replyTo": {
    "Name": "",
    "Address": ""
  },
  "subject": "Hi World",
  "text": "This is a test email.\n\nGood luck!\n-",
  "to": [
    {
      "Name": "",
      "Address": "prefix.cycle-magic@fastgenapp.com"
    }
  ]
}
```

You than can access e.g. the email text content with `$param.text`

### Attachments

You can access the attached files via the URL provided at `FileUrl`. Please note, the link will remain valid for 7 days.
