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

# Triggers

> Configure the Trigger node that starts an agent Flow, then test it before publishing.

Triggers start an agent Flow. Configure them from the **Trigger** node in the Flow builder, not from a separate agent-configuration page.

<Frame>
  <img src="https://mintcdn.com/beamai/JHnoCEC4zo9vcEgb/03-running-operations/task-management/triggers-webhooks/triggers-flow-sidebar-active-verified.jpg?fit=max&auto=format&n=JHnoCEC4zo9vcEgb&q=85&s=55e86b637e4359253fc709a4207d2ed9" alt="Current Flow canvas with the active Gmail trigger selected in the sidebar" width="1280" height="720" data-path="03-running-operations/task-management/triggers-webhooks/triggers-flow-sidebar-active-verified.jpg" />
</Frame>

<h2 id="open-the-trigger-node">
  Open the Trigger node
</h2>

1. Open the agent's **Flow**.
2. Select the **Trigger** node at the start of the Flow.
3. In the sidebar, select the trigger provider and then the configured trigger card.

The Trigger sidebar groups triggers by provider. Use **Add trigger** to set the Flow's trigger; a Flow has one Trigger node rather than separate parallel triggers.

<h2 id="configure-a-gmail-trigger">
  Configure a Gmail trigger
</h2>

Selecting a Gmail **New Email Received** trigger opens its configuration in the Flow sidebar.

<Frame>
  <img src="https://mintcdn.com/beamai/JHnoCEC4zo9vcEgb/03-running-operations/task-management/triggers-webhooks/triggers-gmail-config-active.jpg?fit=max&auto=format&n=JHnoCEC4zo9vcEgb&q=85&s=83a608d0f119b72415c60637de755f7d" alt="Current Gmail New Email Received trigger configuration in the Flow sidebar showing trigger name, Gmail connection, trigger context, filters, and Configure and test" width="1280" height="720" data-path="03-running-operations/task-management/triggers-webhooks/triggers-gmail-config-active.jpg" />
</Frame>

Configure these fields for the trigger:

| Field               | Use it to                                                                                    |
| ------------------- | -------------------------------------------------------------------------------------------- |
| **Trigger name**    | Give the trigger a recognizable name.                                                        |
| **Connection**      | Choose the Gmail connection the trigger uses.                                                |
| **Trigger context** | Add instructions that are sent with the trigger payload.                                     |
| **Filters**         | Narrow which messages start the Flow, including attachment, reply, and body-content filters. |

Use **Add condition** and **New Group** to refine the filters. Select **Configure & test** when the setup is ready to test.

<h2 id="configure-a-webhook-trigger">
  Configure a webhook trigger
</h2>

Use a **Webhook** trigger when another system needs to start a Flow with an HTTP request.

1. Open the Flow's **Trigger** node and add or select the **Webhook** trigger.
2. Copy the webhook URL shown in the trigger configuration. Do not construct the URL by hand.
3. Send a JSON `POST` request to that URL.

The webhook endpoint uses this form:

```text theme={null}
https://api.beamstudio.ai/agent-tasks/{agentId}/webhook/{triggerId}
```

The request body follows the current task-session payload. Include the target `agentId` and a `taskQuery` object with its required `query` string. You can also provide URLs or Base64-encoded context files when the Flow needs them.

```json theme={null}
{
  "agentId": "agent_123456",
  "taskQuery": {
    "query": "Process this customer inquiry"
  },
  "parsingUrls": ["https://example.com/customer-data"],
  "encodedContextFiles": [
    {
      "data": "BASE64_ENCODED_CONTENT",
      "mimeType": "application/pdf",
      "fileName": "inquiry.pdf",
      "fileSize": "2 MB"
    }
  ]
}
```

Use the exact URL and trigger-specific requirements shown in the Flow UI. Webhook authentication controls are not documented here because their current configuration surface has not been verified.

<h2 id="test-before-publishing">
  Test before publishing
</h2>

Use **Execute trigger** to fetch trigger records and inspect their data before publishing the Flow. Use **Execute flow** when you want to test the complete Flow with a selected trigger record.

After reviewing the trigger and Flow results, publish from the Flow header.

<h2 id="next-steps">
  Next steps
</h2>

<CardGroup cols={2}>
  <Card title="Creating Flows" icon="diagram-project" href="/02-building-agents/agent-fundamentals/flow-configuration/flow-configuration">
    Add and configure the other nodes in an agent Flow.
  </Card>

  <Card title="Integrations" icon="plug" href="/02-building-agents/agent-configuration/integrations/integrations">
    Connect the services used by Flow nodes and triggers.
  </Card>

  <Card title="Task Executions" icon="list-check" href="/03-running-operations/task-management/task-executions/task-executions">
    Review runs that start from a trigger.
  </Card>

  <Card title="Publishing and deployment" icon="rocket" href="/02-building-agents/advanced-patterns/publishing-deployment/publishing-deployment">
    Review publishing and Flow version history.
  </Card>
</CardGroup>
