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

# Gmail Trigger

> Trigger a workflow whenever you receive an email

To trigger a workflow whenever you receive an email, you can use the Gmail Trigger. This keeps a watch on your Gmail and triggers a workflow everytime a new email is received. You can also watch for certain email labels e.g., `INBOX`, `SPAM`, `IMPORTANT`

<Warning> Triggers are not available for Free Accounts </Warning>

You can find the Gmail Trigger in `Triggers` > `Gmail Trigger`

<Frame>
  <img className="block dark:hidden" src="https://mintcdn.com/keyflow-25/fFpWQxpuiZM1VmdD/images/triggers/gmail-trigger-light.png?fit=max&auto=format&n=fFpWQxpuiZM1VmdD&q=85&s=7e7a846adc830509a04a4b43fb6aa6e5" alt="Gmail Trigger" width="1919" height="415" data-path="images/triggers/gmail-trigger-light.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/keyflow-25/fFpWQxpuiZM1VmdD/images/triggers/gmail-trigger-dark.png?fit=max&auto=format&n=fFpWQxpuiZM1VmdD&q=85&s=5442a7d75e45c66235b5b442e78ec3ce" alt="Gmail Trigger" width="1919" height="415" data-path="images/triggers/gmail-trigger-dark.png" />
</Frame>

### Create Gmail Trigger

To setup a Gmail Trigger, click on the `+ Gmail Trigger`. It will open a modal where you will enter details regarding the trigger like :

* Name of the Gmail Trigger
* Maximum number of runs allowed by the Trigger
* Expiry Date of the Trigger
* Email Labels you want to keep a watch on.
* Checkboxes for when you want to be notified when a new message is received or removed from the `INBOX`

<Frame>
  <img className="block dark:hidden" src="https://mintcdn.com/keyflow-25/fFpWQxpuiZM1VmdD/images/triggers/gmail-trigger-modal-light.png?fit=max&auto=format&n=fFpWQxpuiZM1VmdD&q=85&s=bfc4f3ea733cc2f4e6f9293e9d8c70f0" alt="Add Gmail Trigger" width="511" height="557" data-path="images/triggers/gmail-trigger-modal-light.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/keyflow-25/fFpWQxpuiZM1VmdD/images/triggers/gmail-trigger-modal-dark.png?fit=max&auto=format&n=fFpWQxpuiZM1VmdD&q=85&s=d4e61c873bd59535176dc1f618567e84" alt="Add Gmail Trigger" width="509" height="557" data-path="images/triggers/gmail-trigger-modal-dark.png" />
</Frame>

To access the data of your Gmail trigger, such as the email's subject, body etc. You'll need to drag an input block into the flow builder and specify the required name in the input\_name of the input block.

* `sender_email` - The email address of the sender.
* `sender_name` - The name of the sender.
* `receiver_name` - The name of the receiver.
* `receiver_email` - The email address of the receiver.
* `email_subject` - The subject of the email.
* `email_body` - The body of the email in plain text.
* `email_date` - The date and time the email was sent or received.
* `email_attachments` - A list of download URLs for the attachments included within the email.
* `message_id` - The message id of the email.
