Skip to content

improvement(attio): validate integration, fix event bug, add missing tool and triggers#3872

Merged
waleedlatif1 merged 2 commits intostagingfrom
waleedlatif1/validate-attio
Mar 31, 2026
Merged

improvement(attio): validate integration, fix event bug, add missing tool and triggers#3872
waleedlatif1 merged 2 commits intostagingfrom
waleedlatif1/validate-attio

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Fix critical bug: note-content.updated event type was incorrect in trigger map (note.content-updatednote-content.updated)
  • Fix update_webhook tool: targetUrl and subscriptions were incorrectly required (API says optional for PATCH)
  • Add missing Get Task tool (attio_get_task) to complete task CRUD
  • Add 4 missing triggers: list.created, list.updated, list.deleted, workspace-member.created
  • Add .trim() to all ID params in URL paths across 25 tool files
  • Auto-generated docs and integrations.json updated

Type of Change

  • Bug fix
  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Mar 31, 2026 11:31pm

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Mar 31, 2026

PR Summary

Medium Risk
Medium risk because it changes webhook trigger routing/event-type mapping and modifies request construction for many Attio API tools, which could affect integrations if behavior diverges from Attio’s expectations.

Overview
Adds the missing attio_get_task tool (plus docs/UI wiring) to complete task CRUD, and updates the Attio block/integration metadata to expose the new operation.

Introduces four new Attio triggers (list created/updated/deleted and workspace member created) with corresponding payload extractors, and updates webhook processing to route those trigger IDs correctly; also fixes the attio_note_updated event-type mapping.

Fixes attio_update_webhook to treat targetUrl/subscriptions as optional for PATCH and only send provided fields, and broadly hardens Attio tool requests by trim()-ing ID/slug params used in URL paths.

Written by Cursor Bugbot for commit c4b9311. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 31, 2026

Greptile Summary

This PR addresses several gaps in the Attio integration: fixes a critical event-type mismatch (note.content-updatednote-content.updated) that was silently preventing note-update webhooks from firing, corrects the update_webhook tool by making targetUrl/subscriptions optional for PATCH semantics, adds the missing Get Task CRUD tool, introduces four new event triggers (list.created, list.updated, list.deleted, workspace-member.created), and defensively adds .trim() to all ID/URL path parameters across 25 tool files.

Key changes:

  • Event-type bug fix (triggers/attio/utils.ts): note-content.updated is now the correctly mapped Attio event string; the previous string would never match an incoming webhook payload.
  • New get_task tool (tools/attio/get_task.ts): follows existing patterns, reuses TASK_OUTPUT_PROPERTIES, properly wired into the block condition/required arrays and tool registry.
  • Four new triggers: each follows the established pattern (subBlocks builder, output builder, explicit handler in utils.server.ts, registry entry), with consistent extractAttioListData / extractAttioWorkspaceMemberData helpers.
  • update_webhook fix: body builder now conditionally populates target_url and subscriptions, and .trim() is applied to targetUrl per the previous review comment resolution.
  • .trim() sweep: applied uniformly to URL path segments across all Attio tool files.

Confidence Score: 5/5

Safe to merge — all changes are additive or correct targeted bug fixes with no regressions identified.

All four stated fixes are correctly implemented: the note-content.updated event string is now accurate, update_webhook PATCH semantics are respected, get_task follows the established tool pattern end-to-end, and the four new triggers are consistently registered across utils, registry, block, and server dispatch. The .trim() sweep is defensive and non-breaking. No prior P0/P1 findings remain open.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/triggers/attio/utils.ts Core fix: event type corrected to note-content.updated; new extractAttioListData and extractAttioWorkspaceMemberData helpers added with matching outputs; TRIGGER_EVENT_MAP extended for 4 new triggers.
apps/sim/lib/webhooks/utils.server.ts New dispatch branches added for list and workspace-member triggers, correctly placed after list-entry checks to avoid any ambiguity.
apps/sim/tools/attio/get_task.ts New Get Task tool; reuses TASK_OUTPUT_PROPERTIES, applies .trim() on taskId, and mirrors the structure of the existing create/update task tools.
apps/sim/tools/attio/update_webhook.ts Optional fields fix: targetUrl and subscriptions are now marked non-required; body builder conditionally populates both fields; .trim() added to webhookId and targetUrl.
apps/sim/blocks/blocks/attio.ts Block wired for get_task operation (condition/required arrays), 4 new trigger subBlocks spreads, and webhook required field narrowed to create_webhook only.
apps/sim/triggers/attio/list_created.ts New list.created trigger; follows established pattern with buildAttioTriggerSubBlocks and buildListOutputs.
apps/sim/triggers/attio/workspace_member_created.ts New workspace-member.created trigger; follows established pattern with dedicated buildWorkspaceMemberOutputs.
apps/sim/tools/attio/types.ts Added AttioGetTaskParams and AttioGetTaskResponse interfaces; AttioGetTaskResponse added to the AttioResponse union.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Attio Webhook POST] --> B{foundWebhook.provider === 'attio'}
    B --> C{Check triggerId}
    C --> D[attio_record_updated → extractAttioRecordUpdatedData]
    C --> E[attio_record_merged → extractAttioRecordMergedData]
    C --> F[attio_record_created/deleted → extractAttioRecordData]
    C --> G[startsWith attio_note_ → extractAttioNoteData]
    C --> H[startsWith attio_task_ → extractAttioTaskData]
    C --> I[startsWith attio_comment_ → extractAttioCommentData]
    C --> J[attio_list_entry_updated → extractAttioListEntryUpdatedData]
    C --> K[attio_list_entry_created/deleted → extractAttioListEntryData]
    C --> L[attio_list_created/updated/deleted → extractAttioListData NEW]
    C --> M[attio_workspace_member_created → extractAttioWorkspaceMemberData NEW]
    C --> N[fallthrough → extractAttioGenericData]

    subgraph TRIGGER_EVENT_MAP
        O[attio_note_updated] --> P["note.updated, note-content.updated FIXED"]
        Q[attio_list_created] --> R["list.created NEW"]
        S[attio_list_updated] --> T["list.updated NEW"]
        U[attio_list_deleted] --> V["list.deleted NEW"]
        W[attio_workspace_member_created] --> X["workspace-member.created NEW"]
    end
Loading

Reviews (2): Last reviewed commit: "fix(attio): wire new trigger extractors ..." | Re-trigger Greptile

waleedlatif1 and others added 2 commits March 31, 2026 16:26
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>
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@waleedlatif1 waleedlatif1 merged commit e45fbe0 into staging Mar 31, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/validate-attio branch March 31, 2026 23:44
@waleedlatif1 waleedlatif1 restored the waleedlatif1/validate-attio branch April 1, 2026 00:48
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/validate-attio branch April 1, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant