text stringlengths 0 59.1k |
|---|
```ts |
import { createTool } from "@voltagent/core"; |
import { VoltOpsClient } from "@voltagent/core"; |
import { z } from "zod"; |
const voltops = new VoltOpsClient({ |
publicKey: process.env.VOLTAGENT_PUBLIC_KEY!, |
secretKey: process.env.VOLTAGENT_SECRET_KEY!, |
}); |
export const createAirtableRecordTool = createTool({ |
name: "createAirtableRecord", |
description: "Create a CRM row inside Airtable", |
parameters: z.object({ |
fields: z.record(z.unknown()), |
baseId: z.string().optional(), |
tableId: z.string().optional(), |
}), |
execute: async ({ fields, baseId, tableId }) => { |
const result = await voltops.actions.airtable.createRecord({ |
credential: { credentialId: process.env.AIRTABLE_CREDENTIAL_ID! }, |
baseId: baseId ?? process.env.AIRTABLE_BASE_ID!, |
tableId: tableId ?? process.env.AIRTABLE_TABLE_ID!, |
fields, |
typecast: true, |
}); |
return { |
actionId: result.actionId, |
metadata: result.metadata, |
record: result.responsePayload, |
}; |
}, |
}); |
``` |
Add the tool to an agent: |
```ts |
const airtableAgent = new Agent({ |
name: "Airtable Assistant", |
model: openai("gpt-4o-mini"), |
instructions: "Use the Airtable tools to manage the operations database.", |
tools: [createAirtableRecordTool, listAirtableRecordsTool, updateAirtableRecordTool], |
}); |
``` |
Now the agent can plan/tool-call requests like: |
``` |
User: "Add Ada Lovelace to the workspace table and show me the latest 5 entries." |
``` |
The planner will call `createAirtableRecord` followed by `listAirtableRecords`, and VoltOps will log |
both action runs. |
## Testing payloads in the console |
While building, open **Volt Console → Actions → Add Action** and select Airtable. The drawer mirrors |
the trigger UX with a credential step, configuration step (base/table dropdowns), and a **Payload & |
Test** editor. Enter any JSON payload and click **Run Test**; successful responses include a |
copy-pasteable SDK snippet, while errors display the raw provider message (e.g., |
`INVALID_VALUE_FOR_COLUMN`). |
This makes it easy to iterate on Airtable data types before committing changes to an agent. |
## Troubleshooting |
- **Proxy/credential mismatch** – make sure the Volt credential uses the same service (case |
sensitive). E.g., a credential named “airtable” must be attached to an Airtable action. |
- **Column IDs vs names** – use `returnFieldsByFieldId: true` if you prefer Airtable field IDs; the |
default returns user-friendly names. |
- **Pagination** – `listRecords` accepts `pageSize`, `offset`, `view`, `filterByFormula`, and `sort` |
parameters identical to Airtable’s REST API. VoltOps just forwards them. |
- **Observability** – check **Volt → Actions → Runs** to inspect payloads, metadata, retries, and |
provider errors (`INVALID_PERMISSIONS_OR_MODEL_NOT_FOUND`, etc.). |
With VoltOps Actions you can keep agent logic focused on reasoning while Volt handles the last-mile |
integration to Airtable. |
<|endoftext|> |
# source: VoltAgent__voltagent/website/actions-triggers-docs/actions/overview.md type: docs |
--- |
title: Actions Overview |
--- |
# Actions Overview |
VoltOps Actions provide managed integrations (Airtable, Gmail, Slack, …) that you can trigger from |
agents, workflows, or the VoltOps API. Instead of wiring every SaaS API yourself you define the |
destination once in the Volt console, connect credentials, and then call the action from the SDK or |
VoltAgent tools with full observability. |
## When to use actions |
- **Deliver data to external systems** – sync agent output to Airtable, send emails, notify chat apps, |
or call internal HTTP endpoints. |
- **Re-use credentials** – end users authenticate once inside Volt; your code invokes the action |
without ever handling another API token. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.