Uh oh!
There was an error while loading. Please reload this page.
fix(attio): automatic webhook lifecycle management and tool fixes - #3327
Conversation
…r_access in create list
…ame if not provided
The latest updates on your projects. Learn more about Vercel for GitHub. |
waleedlatif1
commented
Feb 25, 2026
waleedlatif1
commented
Feb 25, 2026
@cursor review |
Greptile SummaryThis PR replaces the manual Attio webhook setup flow (copy-paste URL + signing secret) with automatic webhook lifecycle management via the Attio API. Webhooks are created on deploy and deleted on undeploy using OAuth credentials, with HMAC-SHA256 signature verification for incoming requests.
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Sim as Sim Platform
participant Attio as Attio API
Note over User, Attio: Deploy Workflow (Webhook Creation)
User->>Sim: Deploy workflow with Attio trigger
Sim->>Sim: Resolve OAuth credentials (credentialId)
Sim->>Sim: Refresh access token if needed
Sim->>Sim: Map triggerId → event types via TRIGGER_EVENT_MAP
Sim->>Attio: POST /v2/webhooks (target_url, subscriptions)
Attio-->>Sim: {webhook_id, secret}
Sim->>Sim: Store externalId + webhookSecret in providerConfig
Note over User, Attio: Incoming Webhook Event
Attio->>Sim: POST /api/webhooks/trigger/{path} + Attio-Signature header
Sim->>Sim: Retrieve webhookSecret from providerConfig
Sim->>Sim: HMAC-SHA256 verify (secret, signature, body)
alt Valid signature
Sim->>Sim: Process webhook event → trigger workflow
else Invalid signature
Sim-->>Attio: 401 Unauthorized
end
Note over User, Attio: Undeploy Workflow (Webhook Deletion)
User->>Sim: Undeploy workflow
Sim->>Sim: Resolve OAuth credentials
Sim->>Attio: DELETE /v2/webhooks/{externalId}
Attio-->>Sim: 200 OK
Last reviewed commit: 1df1933 |
| { attioWebhookId: webhookId } | ||
| ) | ||
| return { externalId: webhookId, webhookSecret: secret || '' } |
There was a problem hiding this comment.
Silent signature bypass on empty secret
When Attio doesn't return a secret, this stores '' (empty string). Downstream in processor.ts:604, if (secret) evaluates to false for empty string, which silently skips all signature verification for that webhook. While this is consistent with how other providers handle it and there's a warning log during creation, it's worth noting this means an Attio webhook could operate without any request authentication if the API doesn't return a secret.
Consider logging a warning in the verification path as well (in processor.ts) when webhookSecret is present but empty, to make debugging easier if unauthenticated requests come through.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| 'list_webhooks', | ||
| ], | ||
| }, | ||
| }, |
There was a problem hiding this comment.
Offset field missing search_records operation condition
Medium Severity
The new offset sub-block's condition.value array omits search_records, while the limit sub-block includes it. The Attio search records API supports offset-based pagination, so users won't be able to paginate search results using offset, creating an inconsistency between the two pagination controls.
Additional Locations (1)
Uh oh!
There was an error while loading. Please reload this page.
| `[${requestId}] Exception during Attio webhook creation for webhook ${webhookData.id}.`, | ||
| { message } | ||
| ) | ||
| throw error |
There was a problem hiding this comment.
Webhook creation throws instead of returning undefined on failure
High Severity
createAttioWebhookSubscription declares a return type of Promise<... | undefined> and the caller in handleExternalWebhookSubscriptions checks if (result) expecting undefined on failure. However, every error path in the function throws, and the catch block re-throws with throw error. Since handleExternalWebhookSubscriptions has no try/catch around the Attio call, the exception propagates unhandled — potentially crashing the deploy endpoint instead of gracefully skipping webhook creation like other providers do.
Additional Locations (1)
Uh oh!
There was an error while loading. Please reload this page.
) * fix(attio): use code subblock type for JSON input fields * fix(attio): correct people name attribute format in wand prompt example * fix(attio): improve wand prompt with correct attribute formats for all field types * fix(attio): use array format with full_name for personal-name attribute in wand prompt * fix(attio): use loose null checks to prevent sending null params to API * fix(attio): add offset param and make pagination fields advanced mode * fix(attio): remove redundant (optional) from placeholders * fix(attio): always send required workspace_access and workspace_member_access in create list * fix(attio): always send api_slug in create list, auto-generate from name if not provided * fix(attio): update api slug placeholder text * fix(tools): manage lifecycle for attio tools * updated docs * fix(attio): remove incorrect save button reference from setup instructions * fix(attio): log debug message when signature verification is skipped
…mstudioai#3327) * fix(attio): use code subblock type for JSON input fields * fix(attio): correct people name attribute format in wand prompt example * fix(attio): improve wand prompt with correct attribute formats for all field types * fix(attio): use array format with full_name for personal-name attribute in wand prompt * fix(attio): use loose null checks to prevent sending null params to API * fix(attio): add offset param and make pagination fields advanced mode * fix(attio): remove redundant (optional) from placeholders * fix(attio): always send required workspace_access and workspace_member_access in create list * fix(attio): always send api_slug in create list, auto-generate from name if not provided * fix(attio): update api slug placeholder text * fix(tools): manage lifecycle for attio tools * updated docs * fix(attio): remove incorrect save button reference from setup instructions * fix(attio): log debug message when signature verification is skipped


Summary
Type of Change
Testing
Tested manually
Checklist