Skip to content

feat(monday): add full Monday.com integration#4210

Merged
waleedlatif1 merged 7 commits intostagingfrom
waleedlatif1/add-monday-integration
Apr 17, 2026
Merged

feat(monday): add full Monday.com integration#4210
waleedlatif1 merged 7 commits intostagingfrom
waleedlatif1/add-monday-integration

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

@waleedlatif1 waleedlatif1 commented Apr 17, 2026

Summary

  • 13 tools: list/get boards, CRUD items, search by column values, subitems, updates (comments), groups, move item to group, archive item
  • Block: operation dropdown with 13 operations, board/group selectors with OAuth credential, advanced mode for pagination/colors, wandConfig for JSON fields
  • 9 webhook triggers: item created/archived/deleted/moved, column changed, status changed, item name changed, subitem created, update posted — all with auto-subscription lifecycle via Monday's GraphQL API
  • OAuth: 7 scopes (boards:read/write, updates:read/write, webhooks:read/write, me:read), token endpoint, getUserInfo via GraphQL
  • Provider handler: challenge verification, createSubscription/deleteSubscription via GraphQL mutations, formatInput with full output alignment, idempotency via triggerUuid
  • Docs, icon, selectors, and all registry wiring

Test plan

  • Connect Monday.com OAuth account
  • Test each of the 13 tool operations (list boards, get board, CRUD items, search, subitems, updates, groups)
  • Test board and group selectors populate correctly from OAuth credential
  • Deploy a workflow with a Monday trigger and verify webhook creation on the board
  • Verify challenge verification works during webhook setup
  • Send test events from Monday.com board and verify trigger fires
  • Undeploy workflow and verify webhook is cleaned up
  • Verify all 9 trigger types produce correct output fields

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 17, 2026

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Apr 17, 2026 3:12am

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 17, 2026

PR Summary

High Risk
High risk because it introduces a new OAuth provider plus webhook subscription/challenge handling and many new API/tool execution paths that interact with external Monday.com GraphQL APIs; failures could impact auth flows and workflow trigger reliability.

Overview
Adds full Monday.com integration support across the product, including a new monday block with 13 operations and wiring into the blocks/tools registries so workflows can manage boards, items, groups, subitems, and updates.

Introduces a new OAuth provider (monday) with env config (MONDAY_CLIENT_ID/SECRET), scope descriptions, token refresh support, and user-info lookup via Monday GraphQL.

Adds Monday webhook trigger support (9 trigger types) with a provider handler that supports challenge verification, automatic subscription create/delete via GraphQL, idempotency via triggerUuid, and selector-backed UI pickers (monday.boards/monday.groups) backed by new Next.js API routes. Docs and icon mappings are updated to surface the new tool/trigger pages and branding.

Reviewed by Cursor Bugbot for commit 0bf1850. Configure here.

Comment thread apps/sim/app/workspace/[workspaceId]/home/home.tsx Outdated
Comment thread apps/sim/lib/webhooks/processor.ts
Comment thread apps/sim/app/api/tools/monday/groups/route.ts Outdated
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 17, 2026

Greptile Summary

This PR adds a full Monday.com integration: 13 tools (CRUD on boards/items/groups/subitems/updates), a 13-operation block with OAuth credential and board/group selectors, 9 webhook triggers with auto-subscription lifecycle, and supporting OAuth/auth/security infrastructure. Previously flagged issues (groups-route GraphQL injection, get_items unescaped groupId, search_items unguarded JSON.parse) are all confirmed fixed. Two minor issues remain below.

Confidence Score: 5/5

Safe to merge — all previously flagged P1 security issues are resolved; only two P2 findings remain.

All three previously flagged issues (groups-route GraphQL injection, get_items unescaped groupId, search_items unguarded JSON.parse) are confirmed fixed. The remaining findings are P2: a scope-description display regression for Pipedrive (cosmetic, no functional impact) and an orphaned TSDoc comment. Neither blocks correctness or security.

apps/sim/lib/oauth/utils.ts (scope key collision) and apps/sim/lib/core/security/input-validation.ts (orphaned JSDoc)

Important Files Changed

Filename Overview
apps/sim/lib/webhooks/providers/monday.ts New webhook provider handler: challenge verification, createSubscription/deleteSubscription via GraphQL, formatInput with full field mapping, idempotency via triggerUuid. Numeric IDs validated before interpolation. Clean implementation following established patterns.
apps/sim/blocks/blocks/monday.ts Block config with 13 operations, OAuth credential, board/group selectors (basic/advanced), wand-enabled JSON fields, and all 9 trigger subBlocks spread in. Operation routing and param mapping looks correct.
apps/sim/lib/oauth/utils.ts Adds Monday.com scope descriptions but reuses the webhooks:read key that previously described Pipedrive's webhook scope — Pipedrive's entry is deleted in the same hunk, silently replacing its description with Monday's.
apps/sim/lib/core/security/input-validation.ts Adds validateMondayNumericId, validateMondayGroupId, validateMondayColumnId. All three validators inserted between isMicrosoftContentUrl's JSDoc and its function definition, detaching the doc from its function.
apps/sim/tools/monday/search_items.ts Search tool with cursor-based pagination. JSON.parse wrapped in try/catch with user-friendly error, boardId sanitized, cursor safely JSON.stringify'd. Previously flagged issues resolved.
apps/sim/tools/monday/get_items.ts Board items list tool. groupId now correctly uses JSON.stringify per the fix; boardId validated via sanitizeNumericId. Previously flagged injection issue resolved.
apps/sim/app/api/tools/monday/groups/route.ts Groups selector API route. boardId validated with validateMondayNumericId before GraphQL interpolation. Previously flagged injection issue resolved.
apps/sim/lib/auth/auth.ts Monday.com OAuth provider added following the established pattern for getUserInfo with generateId() suffix (intentional design per prior review thread).
apps/sim/triggers/monday/utils.ts Trigger utility: event-type map, subBlock builder, and output field builders for all 9 event types. Well structured and complete.
apps/sim/lib/core/security/input-validation.test.ts Comprehensive tests for all three new Monday validators covering valid IDs, injection attempts, control characters, length limits, and type coercions.

Sequence Diagram

sequenceDiagram
    participant User
    participant SimUI
    participant SimAPI as Sim API
    participant MondayAPI as Monday.com API

    Note over User,MondayAPI: Workflow Deployment (Trigger Subscription)
    User->>SimUI: Deploy workflow with Monday trigger
    SimUI->>SimAPI: createSubscription(boardId, triggerId, credentialId)
    SimAPI->>SimAPI: validateMondayNumericId(boardId)
    SimAPI->>SimAPI: resolveAccessToken(credentialId)
    SimAPI->>MondayAPI: create_webhook(board_id, url, event)
    MondayAPI-->>SimAPI: POST challenge {challenge: abc}
    SimAPI->>SimAPI: handleChallenge echo back
    SimAPI-->>MondayAPI: {challenge: abc} 200 OK
    MondayAPI-->>SimAPI: {id: ext-webhook-id}
    SimAPI-->>SimUI: externalId stored in providerConfig

    Note over User,MondayAPI: Webhook Event
    MondayAPI->>SimAPI: POST event {event: {..., triggerUuid}}
    SimAPI->>SimAPI: extractIdempotencyId(triggerUuid)
    SimAPI->>SimAPI: formatInput flatten event fields
    SimAPI->>SimUI: trigger workflow execution

    Note over User,MondayAPI: Workflow Undeployment
    User->>SimUI: Undeploy workflow
    SimUI->>SimAPI: deleteSubscription(externalId, credentialId)
    SimAPI->>SimAPI: validateMondayNumericId(externalId)
    SimAPI->>MondayAPI: delete_webhook(id: externalId)
    MondayAPI-->>SimAPI: deleted confirmation
Loading

Reviews (7): Last reviewed commit: "fix(monday): align list_boards limit des..." | Re-trigger Greptile

Comment thread apps/sim/lib/auth/auth.ts
Comment thread apps/sim/app/api/tools/monday/groups/route.ts
Comment thread apps/sim/hooks/selectors/registry.ts
@waleedlatif1 waleedlatif1 force-pushed the waleedlatif1/add-monday-integration branch 2 times, most recently from 608c00b to ccf86a6 Compare April 17, 2026 01:57
@waleedlatif1 waleedlatif1 force-pushed the waleedlatif1/add-monday-integration branch from ccf86a6 to cf2e03e Compare April 17, 2026 02:04
…gers, and OAuth

Adds a comprehensive Monday.com integration:
- 13 tools: list/get boards, CRUD items, search, subitems, updates, groups, move, archive
- Block with operation dropdown, board/group selectors, OAuth credential, advanced mode
- 9 webhook triggers with auto-subscription lifecycle (create/delete via GraphQL API)
- OAuth config with 7 scopes (boards, updates, webhooks, me:read)
- Provider handler with challenge verification, formatInput, idempotency
- Docs, icon, selectors, and all registry wiring

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1 waleedlatif1 force-pushed the waleedlatif1/add-monday-integration branch from cf2e03e to 1723d73 Compare April 17, 2026 02:09
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/tools/monday/get_items.ts Outdated
Comment thread apps/sim/lib/webhooks/providers/monday.ts Outdated
Comment thread apps/sim/lib/core/security/input-validation.ts
Comment thread apps/sim/tools/monday/get_items.ts
The DeleteSubscriptionContext type has userId as unknown, causing a
TypeScript error when passing it to getOAuthToken which expects string.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…n with established patterns

- Use JSON.stringify() for groupId in get_items.ts (matches create_item.ts
  and move_item_to_group.ts)
- Use JSON.stringify() for notificationUrl in webhook provider
- Remove non-standard getOAuthToken fallback in deleteSubscription to match
  Airtable/Webflow pattern (credential resolution only, warn and return on failure)

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

Comment thread apps/sim/lib/oauth/utils.ts
Comment thread apps/sim/tools/monday/search_items.ts Outdated
Parse and re-stringify the columns param to ensure well-formed JSON
before interpolating into the GraphQL query, preventing injection
via malformed input.

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

Comment thread apps/sim/tools/monday/delete_item.ts
Comment thread apps/sim/tools/monday/search_items.ts Outdated
… queries

- Add sanitizeNumericId() helper to tools/monday/utils.ts for consistent
  validation across all tool body builders
- Apply to all 13 instances of boardId, itemId, parentItemId interpolation
  across 11 tool files, preventing GraphQL injection via crafted IDs
- Wrap JSON.parse in search_items.ts with try-catch for user-friendly
  error on malformed column filter JSON

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

Comment thread apps/sim/lib/webhooks/providers/monday.ts
Comment thread apps/sim/tools/monday/list_boards.ts
Comment thread apps/sim/tools/monday/utils.ts
…arams

- Refactor sanitizeNumericId to delegate to validateMondayNumericId
  from input-validation.ts, eliminating duplicated regex logic
- Add sanitizeLimit helper for safe integer coercion with bounds
- Apply sanitizeLimit to limit/page params in list_boards, get_items,
  and search_items for consistent validation across all GraphQL params

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

Comment thread apps/sim/tools/monday/list_boards.ts
The param description said "max 100" but sanitizeLimit caps at 500,
which is what Monday.com's API supports for boards. Updated both the
tool description and docs to say "max 500".

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

Reviewed by Cursor Bugbot for commit 0bf1850. Configure here.

@waleedlatif1 waleedlatif1 merged commit 38864fa into staging Apr 17, 2026
14 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/add-monday-integration branch April 17, 2026 03:27
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