Skip to content

Commit df20ad3

Browse files
waleedlatif1claude
andcommitted
improvement(attio): validate integration, fix event bug, add missing tool and triggers (#3872)
* improvement(attio): validate integration, fix event bug, add missing tool and triggers * fix(attio): wire new trigger extractors into dispatcher, trim targetUrl Add extractAttioListData and extractAttioWorkspaceMemberData dispatch branches in utils.server.ts so the four new triggers return correct outputs instead of falling through to generic extraction. Also add missing .trim() on targetUrl in update_webhook. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a46eea5 commit df20ad3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+422
-44
lines changed

apps/docs/content/docs/en/tools/attio.mdx

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,35 @@ List tasks in Attio, optionally filtered by record, assignee, or completion stat
359359
|`createdAt` | string | When the task was created |
360360
| `count` | number | Number of tasks returned |
361361

362+
### `attio_get_task`
363+
364+
Get a single task by ID from Attio
365+
366+
#### Input
367+
368+
| Parameter | Type | Required | Description |
369+
| --------- | ---- | -------- | ----------- |
370+
| `taskId` | string | Yes | The ID of the task to retrieve |
371+
372+
#### Output
373+
374+
| Parameter | Type | Description |
375+
| --------- | ---- | ----------- |
376+
| `taskId` | string | The task ID |
377+
| `content` | string | The task content |
378+
| `deadlineAt` | string | The task deadline |
379+
| `isCompleted` | boolean | Whether the task is completed |
380+
| `linkedRecords` | array | Records linked to this task |
381+
|`targetObjectId` | string | The linked object ID |
382+
|`targetRecordId` | string | The linked record ID |
383+
| `assignees` | array | Task assignees |
384+
|`type` | string | The assignee actor type \(e.g. workspace-member\) |
385+
|`id` | string | The assignee actor ID |
386+
| `createdByActor` | object | The actor who created this task |
387+
|`type` | string | The actor type \(e.g. workspace-member, api-token, system\) |
388+
|`id` | string | The actor ID |
389+
| `createdAt` | string | When the task was created |
390+
362391
### `attio_create_task`
363392

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

10181047
#### Output
10191048

apps/sim/app/(landing)/integrations/data/integrations.json

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,10 @@
926926
"name": "List Tasks",
927927
"description": "List tasks in Attio, optionally filtered by record, assignee, or completion status"
928928
},
929+
{
930+
"name": "Get Task",
931+
"description": "Get a single task by ID from Attio"
932+
},
929933
{
930934
"name": "Create Task",
931935
"description": "Create a task in Attio"
@@ -1039,7 +1043,7 @@
10391043
"description": "Delete a webhook from Attio"
10401044
}
10411045
],
1042-
"operationCount": 40,
1046+
"operationCount": 41,
10431047
"triggers": [
10441048
{
10451049
"id": "attio_record_created",
@@ -1126,13 +1130,33 @@
11261130
"name": "Attio List Entry Deleted",
11271131
"description": "Trigger workflow when a list entry is deleted in Attio"
11281132
},
1133+
{
1134+
"id": "attio_list_created",
1135+
"name": "Attio List Created",
1136+
"description": "Trigger workflow when a list is created in Attio"
1137+
},
1138+
{
1139+
"id": "attio_list_updated",
1140+
"name": "Attio List Updated",
1141+
"description": "Trigger workflow when a list is updated in Attio"
1142+
},
1143+
{
1144+
"id": "attio_list_deleted",
1145+
"name": "Attio List Deleted",
1146+
"description": "Trigger workflow when a list is deleted in Attio"
1147+
},
1148+
{
1149+
"id": "attio_workspace_member_created",
1150+
"name": "Attio Workspace Member Created",
1151+
"description": "Trigger workflow when a new member is added to the Attio workspace"
1152+
},
11291153
{
11301154
"id": "attio_webhook",
11311155
"name": "Attio Webhook (All Events)",
11321156
"description": "Trigger workflow on any Attio webhook event"
11331157
}
11341158
],
1135-
"triggerCount": 18,
1159+
"triggerCount": 22,
11361160
"authType": "oauth",
11371161
"category": "tools",
11381162
"integrationType": "crm",

apps/sim/blocks/blocks/attio.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const AttioBlock: BlockConfig<AttioResponse> = {
3636
{ label: 'Create Note', id: 'create_note' },
3737
{ label: 'Delete Note', id: 'delete_note' },
3838
{ label: 'List Tasks', id: 'list_tasks' },
39+
{ label: 'Get Task', id: 'get_task' },
3940
{ label: 'Create Task', id: 'create_task' },
4041
{ label: 'Update Task', id: 'update_task' },
4142
{ label: 'Delete Task', id: 'delete_task' },
@@ -490,8 +491,8 @@ Return ONLY the JSON array. No explanations, no markdown, no extra text.
490491
title: 'Task ID',
491492
type: 'short-input',
492493
placeholder: 'Enter the task ID',
493-
condition: { field: 'operation', value: ['update_task', 'delete_task'] },
494-
required: { field: 'operation', value: ['update_task', 'delete_task'] },
494+
condition: { field: 'operation', value: ['get_task', 'update_task', 'delete_task'] },
495+
required: { field: 'operation', value: ['get_task', 'update_task', 'delete_task'] },
495496
},
496497
{
497498
id: 'taskFilterObject',
@@ -944,15 +945,15 @@ YYYY-MM-DDTHH:mm:ss.SSSZ
944945
type: 'short-input',
945946
placeholder: 'https://example.com/webhook',
946947
condition: { field: 'operation', value: ['create_webhook', 'update_webhook'] },
947-
required: { field: 'operation', value: ['create_webhook', 'update_webhook'] },
948+
required: { field: 'operation', value: 'create_webhook' },
948949
},
949950
{
950951
id: 'webhookSubscriptions',
951952
title: 'Subscriptions',
952953
type: 'code',
953954
placeholder: '[{"event_type":"record.created","filter":{"object_id":"..."}}]',
954955
condition: { field: 'operation', value: ['create_webhook', 'update_webhook'] },
955-
required: { field: 'operation', value: ['create_webhook', 'update_webhook'] },
956+
required: { field: 'operation', value: 'create_webhook' },
956957
wandConfig: {
957958
enabled: true,
958959
maintainHistory: true,
@@ -1040,6 +1041,10 @@ workspace-member.created
10401041
...getTrigger('attio_list_entry_created').subBlocks,
10411042
...getTrigger('attio_list_entry_updated').subBlocks,
10421043
...getTrigger('attio_list_entry_deleted').subBlocks,
1044+
...getTrigger('attio_list_created').subBlocks,
1045+
...getTrigger('attio_list_updated').subBlocks,
1046+
...getTrigger('attio_list_deleted').subBlocks,
1047+
...getTrigger('attio_workspace_member_created').subBlocks,
10431048
...getTrigger('attio_webhook').subBlocks,
10441049
],
10451050

@@ -1063,6 +1068,10 @@ workspace-member.created
10631068
'attio_list_entry_created',
10641069
'attio_list_entry_updated',
10651070
'attio_list_entry_deleted',
1071+
'attio_list_created',
1072+
'attio_list_updated',
1073+
'attio_list_deleted',
1074+
'attio_workspace_member_created',
10661075
'attio_webhook',
10671076
],
10681077
},
@@ -1081,6 +1090,7 @@ workspace-member.created
10811090
'attio_create_note',
10821091
'attio_delete_note',
10831092
'attio_list_tasks',
1093+
'attio_get_task',
10841094
'attio_create_task',
10851095
'attio_update_task',
10861096
'attio_delete_task',

apps/sim/lib/webhooks/utils.server.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,6 +1311,8 @@ export async function formatWebhookInput(
13111311
extractAttioCommentData,
13121312
extractAttioListEntryData,
13131313
extractAttioListEntryUpdatedData,
1314+
extractAttioListData,
1315+
extractAttioWorkspaceMemberData,
13141316
extractAttioGenericData,
13151317
} = await import('@/triggers/attio/utils')
13161318

@@ -1341,6 +1343,16 @@ export async function formatWebhookInput(
13411343
if (triggerId === 'attio_list_entry_created' || triggerId === 'attio_list_entry_deleted') {
13421344
return extractAttioListEntryData(body)
13431345
}
1346+
if (
1347+
triggerId === 'attio_list_created' ||
1348+
triggerId === 'attio_list_updated' ||
1349+
triggerId === 'attio_list_deleted'
1350+
) {
1351+
return extractAttioListData(body)
1352+
}
1353+
if (triggerId === 'attio_workspace_member_created') {
1354+
return extractAttioWorkspaceMemberData(body)
1355+
}
13441356
return extractAttioGenericData(body)
13451357
}
13461358

apps/sim/tools/attio/assert_record.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const attioAssertRecordTool: ToolConfig<AttioAssertRecordParams, AttioAss
4949

5050
request: {
5151
url: (params) =>
52-
`https://api.attio.com/v2/objects/${params.objectType}/records?matching_attribute=${params.matchingAttribute}`,
52+
`https://api.attio.com/v2/objects/${params.objectType.trim()}/records?matching_attribute=${params.matchingAttribute.trim()}`,
5353
method: 'PUT',
5454
headers: (params) => ({
5555
Authorization: `Bearer ${params.accessToken}`,

apps/sim/tools/attio/create_list_entry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const attioCreateListEntryTool: ToolConfig<
5353
},
5454

5555
request: {
56-
url: (params) => `https://api.attio.com/v2/lists/${params.list}/entries`,
56+
url: (params) => `https://api.attio.com/v2/lists/${params.list.trim()}/entries`,
5757
method: 'POST',
5858
headers: (params) => ({
5959
Authorization: `Bearer ${params.accessToken}`,

apps/sim/tools/attio/create_record.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const attioCreateRecordTool: ToolConfig<AttioCreateRecordParams, AttioCre
3939
},
4040

4141
request: {
42-
url: (params) => `https://api.attio.com/v2/objects/${params.objectType}/records`,
42+
url: (params) => `https://api.attio.com/v2/objects/${params.objectType.trim()}/records`,
4343
method: 'POST',
4444
headers: (params) => ({
4545
Authorization: `Bearer ${params.accessToken}`,

apps/sim/tools/attio/delete_comment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const attioDeleteCommentTool: ToolConfig<
3434
},
3535

3636
request: {
37-
url: (params) => `https://api.attio.com/v2/comments/${params.commentId}`,
37+
url: (params) => `https://api.attio.com/v2/comments/${params.commentId.trim()}`,
3838
method: 'DELETE',
3939
headers: (params) => ({
4040
Authorization: `Bearer ${params.accessToken}`,

apps/sim/tools/attio/delete_list_entry.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ export const attioDeleteListEntryTool: ToolConfig<
4040
},
4141

4242
request: {
43-
url: (params) => `https://api.attio.com/v2/lists/${params.list}/entries/${params.entryId}`,
43+
url: (params) =>
44+
`https://api.attio.com/v2/lists/${params.list.trim()}/entries/${params.entryId.trim()}`,
4445
method: 'DELETE',
4546
headers: (params) => ({
4647
Authorization: `Bearer ${params.accessToken}`,

apps/sim/tools/attio/delete_note.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const attioDeleteNoteTool: ToolConfig<AttioDeleteNoteParams, AttioDeleteN
3131
},
3232

3333
request: {
34-
url: (params) => `https://api.attio.com/v2/notes/${params.noteId}`,
34+
url: (params) => `https://api.attio.com/v2/notes/${params.noteId.trim()}`,
3535
method: 'DELETE',
3636
headers: (params) => ({
3737
Authorization: `Bearer ${params.accessToken}`,

0 commit comments

Comments
 (0)