text
stringlengths
0
59.1k
<source src="https://cdn.voltagent.dev/console/trigger/step-1-connection.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
<br/>
<br/>
In [VoltOps Triggers page](https://console.voltagent.dev/triggers), click **Add Trigger**, select Airtable provider, choose **`Record created`** event, and click **New credential** to configure authentication.
- **Connection Name**: Name for this credential ("Airtable credential")
- **Authentication**: Select **Personal access token** (OAuth 2.0 is also supported)
- **Access Token**: Go to [Airtable Token Creation](https://airtable.com/create/tokens) and create a new token with the following scopes:
```
data.records:read
data.records:write
schema.bases:read
```
After pasting the token, click **Save credentials** to proceed to trigger options.
## Step 2: Trigger Configuration
After configuring credentials, you need to specify which Airtable base, table, and field to monitor for new records. These settings determine when and how the trigger fires.
<video controls loop muted playsInline style={{width: '100%', height: 'auto'}}>
<source src="https://cdn.voltagent.dev/console/trigger/step-2-configuration.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
<br/>
<br/>
Set the following trigger options based on your Airtable base structure:
- **Base**: Select your Airtable base
→ `AI Model Experiment Tracker`
- **Table**: Select the table to monitor for new records
→ `Experiments`
- **View**: (Optional) Select a specific view to monitor
- **Trigger Field**: Select the field that indicates when a record was created
→ `createdTime`
- **Poll Interval**: Set how often to check for new records (in seconds)
→ `60` (lower values increase API usage)
Click **Next** to review your settings, then create the binding with **Draft** status. Next, we'll need to add targets next to activate it.
## Step 3: Add Target to Activate Binding
After creating your binding, you need to add targets that will execute when the trigger fires. Click **Add Your First Target** to open the target configuration wizard.
<video controls loop muted playsInline style={{width: '100%', height: 'auto'}}>
<source src="https://cdn.voltagent.dev/console/trigger/setup-target.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
<br/>
<br/>
The target configuration is a **2-step process**:
### Step 3.1: Add Trigger Handler to Your Project
First, you need to add a trigger handler to your VoltAgent project. This is the code that will process incoming trigger events.
The wizard displays a **code snippet** that you need to copy and add to your VoltAgent project:
```typescript
import { VoltAgent, createTriggers } from "@voltagent/core";
new VoltAgent({
//
triggers: createTriggers((on) => {
on.airtable.recordCreated(({ payload }) => {
console.log(payload);
});
}),
});
```
**What this code does:**
- Creates a new VoltAgent instance with trigger handlers
- Uses `createTriggers` to define trigger event handlers
- `on.airtable.recordCreated` registers a handler for the Airtable record created event
- Receives the trigger payload (Airtable record data) when the event fires
**Default endpoint path:** Based on your trigger configuration, the system generates an endpoint path like:
```
POST /triggers/airtable/recordCreated
```