Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions apps/docs/content/docs/en/tools/attio.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,35 @@ List tasks in Attio, optionally filtered by record, assignee, or completion stat
| ↳ `createdAt` | string | When the task was created |
| `count` | number | Number of tasks returned |

### `attio_get_task`

Get a single task by ID from Attio

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `taskId` | string | Yes | The ID of the task to retrieve |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `taskId` | string | The task ID |
| `content` | string | The task content |
| `deadlineAt` | string | The task deadline |
| `isCompleted` | boolean | Whether the task is completed |
| `linkedRecords` | array | Records linked to this task |
| ↳ `targetObjectId` | string | The linked object ID |
| ↳ `targetRecordId` | string | The linked record ID |
| `assignees` | array | Task assignees |
| ↳ `type` | string | The assignee actor type \(e.g. workspace-member\) |
| ↳ `id` | string | The assignee actor ID |
| `createdByActor` | object | The actor who created this task |
| ↳ `type` | string | The actor type \(e.g. workspace-member, api-token, system\) |
| ↳ `id` | string | The actor ID |
| `createdAt` | string | When the task was created |

### `attio_create_task`

Create a task in Attio
Expand Down Expand Up @@ -1012,8 +1041,8 @@ Update a webhook in Attio (target URL and/or subscriptions)
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `webhookId` | string | Yes | The webhook ID to update |
| `targetUrl` | string | Yes | HTTPS target URL for webhook delivery |
| `subscriptions` | string | Yes | JSON array of subscriptions, e.g. \[\{"event_type":"note.created"\}\] |
| `targetUrl` | string | No | HTTPS target URL for webhook delivery |
| `subscriptions` | string | No | JSON array of subscriptions, e.g. \[\{"event_type":"note.created"\}\] |

#### Output

Expand Down
28 changes: 26 additions & 2 deletions apps/sim/app/(landing)/integrations/data/integrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,10 @@
"name": "List Tasks",
"description": "List tasks in Attio, optionally filtered by record, assignee, or completion status"
},
{
"name": "Get Task",
"description": "Get a single task by ID from Attio"
},
{
"name": "Create Task",
"description": "Create a task in Attio"
Expand Down Expand Up @@ -1039,7 +1043,7 @@
"description": "Delete a webhook from Attio"
}
],
"operationCount": 40,
"operationCount": 41,
"triggers": [
{
"id": "attio_record_created",
Expand Down Expand Up @@ -1126,13 +1130,33 @@
"name": "Attio List Entry Deleted",
"description": "Trigger workflow when a list entry is deleted in Attio"
},
{
"id": "attio_list_created",
"name": "Attio List Created",
"description": "Trigger workflow when a list is created in Attio"
},
{
"id": "attio_list_updated",
"name": "Attio List Updated",
"description": "Trigger workflow when a list is updated in Attio"
},
{
"id": "attio_list_deleted",
"name": "Attio List Deleted",
"description": "Trigger workflow when a list is deleted in Attio"
},
{
"id": "attio_workspace_member_created",
"name": "Attio Workspace Member Created",
"description": "Trigger workflow when a new member is added to the Attio workspace"
},
{
"id": "attio_webhook",
"name": "Attio Webhook (All Events)",
"description": "Trigger workflow on any Attio webhook event"
}
],
"triggerCount": 18,
"triggerCount": 22,
"authType": "oauth",
"category": "tools",
"integrationType": "crm",
Expand Down
18 changes: 14 additions & 4 deletions apps/sim/blocks/blocks/attio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const AttioBlock: BlockConfig<AttioResponse> = {
{ label: 'Create Note', id: 'create_note' },
{ label: 'Delete Note', id: 'delete_note' },
{ label: 'List Tasks', id: 'list_tasks' },
{ label: 'Get Task', id: 'get_task' },
{ label: 'Create Task', id: 'create_task' },
{ label: 'Update Task', id: 'update_task' },
{ label: 'Delete Task', id: 'delete_task' },
Expand Down Expand Up @@ -490,8 +491,8 @@ Return ONLY the JSON array. No explanations, no markdown, no extra text.
title: 'Task ID',
type: 'short-input',
placeholder: 'Enter the task ID',
condition: { field: 'operation', value: ['update_task', 'delete_task'] },
required: { field: 'operation', value: ['update_task', 'delete_task'] },
condition: { field: 'operation', value: ['get_task', 'update_task', 'delete_task'] },
required: { field: 'operation', value: ['get_task', 'update_task', 'delete_task'] },
},
{
id: 'taskFilterObject',
Expand Down Expand Up @@ -944,15 +945,15 @@ YYYY-MM-DDTHH:mm:ss.SSSZ
type: 'short-input',
placeholder: 'https://example.com/webhook',
condition: { field: 'operation', value: ['create_webhook', 'update_webhook'] },
required: { field: 'operation', value: ['create_webhook', 'update_webhook'] },
required: { field: 'operation', value: 'create_webhook' },
},
{
id: 'webhookSubscriptions',
title: 'Subscriptions',
type: 'code',
placeholder: '[{"event_type":"record.created","filter":{"object_id":"..."}}]',
condition: { field: 'operation', value: ['create_webhook', 'update_webhook'] },
required: { field: 'operation', value: ['create_webhook', 'update_webhook'] },
required: { field: 'operation', value: 'create_webhook' },
wandConfig: {
enabled: true,
maintainHistory: true,
Expand Down Expand Up @@ -1040,6 +1041,10 @@ workspace-member.created
...getTrigger('attio_list_entry_created').subBlocks,
...getTrigger('attio_list_entry_updated').subBlocks,
...getTrigger('attio_list_entry_deleted').subBlocks,
...getTrigger('attio_list_created').subBlocks,
...getTrigger('attio_list_updated').subBlocks,
...getTrigger('attio_list_deleted').subBlocks,
...getTrigger('attio_workspace_member_created').subBlocks,
...getTrigger('attio_webhook').subBlocks,
],

Expand All @@ -1063,6 +1068,10 @@ workspace-member.created
'attio_list_entry_created',
'attio_list_entry_updated',
'attio_list_entry_deleted',
'attio_list_created',
'attio_list_updated',
'attio_list_deleted',
'attio_workspace_member_created',
'attio_webhook',
],
},
Expand All @@ -1081,6 +1090,7 @@ workspace-member.created
'attio_create_note',
'attio_delete_note',
'attio_list_tasks',
'attio_get_task',
'attio_create_task',
'attio_update_task',
'attio_delete_task',
Expand Down
12 changes: 12 additions & 0 deletions apps/sim/lib/webhooks/utils.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1311,6 +1311,8 @@ export async function formatWebhookInput(
extractAttioCommentData,
extractAttioListEntryData,
extractAttioListEntryUpdatedData,
extractAttioListData,
extractAttioWorkspaceMemberData,
extractAttioGenericData,
} = await import('@/triggers/attio/utils')

Expand Down Expand Up @@ -1341,6 +1343,16 @@ export async function formatWebhookInput(
if (triggerId === 'attio_list_entry_created' || triggerId === 'attio_list_entry_deleted') {
return extractAttioListEntryData(body)
}
if (
triggerId === 'attio_list_created' ||
triggerId === 'attio_list_updated' ||
triggerId === 'attio_list_deleted'
) {
return extractAttioListData(body)
}
if (triggerId === 'attio_workspace_member_created') {
return extractAttioWorkspaceMemberData(body)
}
return extractAttioGenericData(body)
}

Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/attio/assert_record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const attioAssertRecordTool: ToolConfig<AttioAssertRecordParams, AttioAss

request: {
url: (params) =>
`https://api.attio.com/v2/objects/${params.objectType}/records?matching_attribute=${params.matchingAttribute}`,
`https://api.attio.com/v2/objects/${params.objectType.trim()}/records?matching_attribute=${params.matchingAttribute.trim()}`,
method: 'PUT',
headers: (params) => ({
Authorization: `Bearer ${params.accessToken}`,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/attio/create_list_entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const attioCreateListEntryTool: ToolConfig<
},

request: {
url: (params) => `https://api.attio.com/v2/lists/${params.list}/entries`,
url: (params) => `https://api.attio.com/v2/lists/${params.list.trim()}/entries`,
method: 'POST',
headers: (params) => ({
Authorization: `Bearer ${params.accessToken}`,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/attio/create_record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const attioCreateRecordTool: ToolConfig<AttioCreateRecordParams, AttioCre
},

request: {
url: (params) => `https://api.attio.com/v2/objects/${params.objectType}/records`,
url: (params) => `https://api.attio.com/v2/objects/${params.objectType.trim()}/records`,
method: 'POST',
headers: (params) => ({
Authorization: `Bearer ${params.accessToken}`,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/attio/delete_comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const attioDeleteCommentTool: ToolConfig<
},

request: {
url: (params) => `https://api.attio.com/v2/comments/${params.commentId}`,
url: (params) => `https://api.attio.com/v2/comments/${params.commentId.trim()}`,
method: 'DELETE',
headers: (params) => ({
Authorization: `Bearer ${params.accessToken}`,
Expand Down
3 changes: 2 additions & 1 deletion apps/sim/tools/attio/delete_list_entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export const attioDeleteListEntryTool: ToolConfig<
},

request: {
url: (params) => `https://api.attio.com/v2/lists/${params.list}/entries/${params.entryId}`,
url: (params) =>
`https://api.attio.com/v2/lists/${params.list.trim()}/entries/${params.entryId.trim()}`,
method: 'DELETE',
headers: (params) => ({
Authorization: `Bearer ${params.accessToken}`,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/attio/delete_note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const attioDeleteNoteTool: ToolConfig<AttioDeleteNoteParams, AttioDeleteN
},

request: {
url: (params) => `https://api.attio.com/v2/notes/${params.noteId}`,
url: (params) => `https://api.attio.com/v2/notes/${params.noteId.trim()}`,
method: 'DELETE',
headers: (params) => ({
Authorization: `Bearer ${params.accessToken}`,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/attio/delete_record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const attioDeleteRecordTool: ToolConfig<AttioDeleteRecordParams, AttioDel

request: {
url: (params) =>
`https://api.attio.com/v2/objects/${params.objectType}/records/${params.recordId}`,
`https://api.attio.com/v2/objects/${params.objectType.trim()}/records/${params.recordId.trim()}`,
method: 'DELETE',
headers: (params) => ({
Authorization: `Bearer ${params.accessToken}`,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/attio/delete_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const attioDeleteTaskTool: ToolConfig<AttioDeleteTaskParams, AttioDeleteT
},

request: {
url: (params) => `https://api.attio.com/v2/tasks/${params.taskId}`,
url: (params) => `https://api.attio.com/v2/tasks/${params.taskId.trim()}`,
method: 'DELETE',
headers: (params) => ({
Authorization: `Bearer ${params.accessToken}`,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/attio/delete_webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const attioDeleteWebhookTool: ToolConfig<
},

request: {
url: (params) => `https://api.attio.com/v2/webhooks/${params.webhookId}`,
url: (params) => `https://api.attio.com/v2/webhooks/${params.webhookId.trim()}`,
method: 'DELETE',
headers: (params) => ({
Authorization: `Bearer ${params.accessToken}`,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/attio/get_comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const attioGetCommentTool: ToolConfig<AttioGetCommentParams, AttioGetComm
},

request: {
url: (params) => `https://api.attio.com/v2/comments/${params.commentId}`,
url: (params) => `https://api.attio.com/v2/comments/${params.commentId.trim()}`,
method: 'GET',
headers: (params) => ({
Authorization: `Bearer ${params.accessToken}`,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/attio/get_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const attioGetListTool: ToolConfig<AttioGetListParams, AttioGetListRespon
},

request: {
url: (params) => `https://api.attio.com/v2/lists/${params.list}`,
url: (params) => `https://api.attio.com/v2/lists/${params.list.trim()}`,
method: 'GET',
headers: (params) => ({
Authorization: `Bearer ${params.accessToken}`,
Expand Down
3 changes: 2 additions & 1 deletion apps/sim/tools/attio/get_list_entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export const attioGetListEntryTool: ToolConfig<AttioGetListEntryParams, AttioGet
},

request: {
url: (params) => `https://api.attio.com/v2/lists/${params.list}/entries/${params.entryId}`,
url: (params) =>
`https://api.attio.com/v2/lists/${params.list.trim()}/entries/${params.entryId.trim()}`,
method: 'GET',
headers: (params) => ({
Authorization: `Bearer ${params.accessToken}`,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/attio/get_member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const attioGetMemberTool: ToolConfig<AttioGetMemberParams, AttioGetMember
},

request: {
url: (params) => `https://api.attio.com/v2/workspace_members/${params.memberId}`,
url: (params) => `https://api.attio.com/v2/workspace_members/${params.memberId.trim()}`,
method: 'GET',
headers: (params) => ({
Authorization: `Bearer ${params.accessToken}`,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/attio/get_note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const attioGetNoteTool: ToolConfig<AttioGetNoteParams, AttioGetNoteRespon
},

request: {
url: (params) => `https://api.attio.com/v2/notes/${params.noteId}`,
url: (params) => `https://api.attio.com/v2/notes/${params.noteId.trim()}`,
method: 'GET',
headers: (params) => ({
Authorization: `Bearer ${params.accessToken}`,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/attio/get_object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const attioGetObjectTool: ToolConfig<AttioGetObjectParams, AttioGetObject
},

request: {
url: (params) => `https://api.attio.com/v2/objects/${params.object}`,
url: (params) => `https://api.attio.com/v2/objects/${params.object.trim()}`,
method: 'GET',
headers: (params) => ({
Authorization: `Bearer ${params.accessToken}`,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/attio/get_record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const attioGetRecordTool: ToolConfig<AttioGetRecordParams, AttioGetRecord

request: {
url: (params) =>
`https://api.attio.com/v2/objects/${params.objectType}/records/${params.recordId}`,
`https://api.attio.com/v2/objects/${params.objectType.trim()}/records/${params.recordId.trim()}`,
method: 'GET',
headers: (params) => ({
Authorization: `Bearer ${params.accessToken}`,
Expand Down
Loading
Loading