Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • added grain and circleback

Type of Change

  • 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

vercel bot commented Dec 23, 2025

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

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Dec 23, 2025 10:25pm

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 23, 2025

Greptile Summary

This PR adds comprehensive integrations for Grain (meeting recording platform) and Circleback (AI meeting notes) to the Sim platform. The implementation includes 8 Grain tools for managing recordings, transcripts, and webhooks, plus 9 webhook triggers (6 for Grain events, 3 for Circleback events).

Key Changes:

  • Grain integration: Full CRUD operations for recordings, transcripts, teams, meeting types, and webhooks via Grain's v2 API
  • Circleback integration: Webhook-based trigger system for receiving meeting notes, action items, and transcripts
  • Webhook security: Added HMAC-SHA256 signature validation for Circleback webhooks following the existing pattern used for GitHub, Linear, and other providers
  • API key handling: Properly uses user-only visibility for API keys (follows credential policy from rule 2851870a)
  • Documentation: Comprehensive MDX docs for both integrations with setup instructions and API reference
  • Icons: Custom SVG icons for both services added to icon libraries

Implementation Quality:

  • Follows established patterns from existing integrations (GitHub, HubSpot, Jira)
  • Proper error handling and validation throughout
  • Consistent code structure across all 8 Grain tools
  • Clean separation between tools (actions) and triggers (webhooks)
  • All registries properly updated (blocks, tools, triggers)

The implementation is production-ready with no security issues, proper credential handling, and comprehensive coverage of both platforms' capabilities.

Confidence Score: 5/5

  • This PR is safe to merge with no concerns
  • The implementation follows all established patterns, uses proper credential visibility (user-only for API keys per rule 2851870a), includes comprehensive webhook signature validation for security, has complete documentation, and was manually tested by the author. All 36 files are new additions with no modifications to existing functionality, eliminating risk of breaking changes.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/grain.ts Comprehensive Grain block configuration with 8 tools and 6 triggers, proper conditional fields and validation
apps/sim/blocks/blocks/circleback.ts Clean Circleback trigger-only block with 3 webhook triggers and comprehensive output schema
apps/sim/tools/grain/list_recordings.ts Well-structured tool with proper API key visibility, comprehensive filtering options, and pagination support
apps/sim/triggers/grain/recording_created.ts Standard webhook trigger implementation with optional secret validation and clear setup instructions
apps/sim/lib/webhooks/processor.ts Added Circleback signature verification logic following existing pattern for other providers
apps/sim/lib/webhooks/utils.server.ts Added validateCirclebackSignature function using HMAC-SHA256, consistent with existing signature validation patterns
apps/sim/tools/registry.ts Added 8 Grain tools to registry with correct exports and mappings
apps/sim/blocks/registry.ts Added Grain and Circleback blocks to registry with proper imports and exports

Sequence Diagram

sequenceDiagram
    participant User
    participant GrainBlock
    participant GrainTool
    participant GrainAPI
    participant GrainWebhook
    participant WebhookProcessor
    participant CirclebackWebhook
    participant CirclebackProcessor

    Note over User,GrainAPI: Grain Tool Actions
    User->>GrainBlock: Configure operation (list_recordings)
    GrainBlock->>GrainTool: Execute with apiKey & filters
    GrainTool->>GrainAPI: POST /v2/recordings
    GrainAPI-->>GrainTool: Return recordings array
    GrainTool-->>User: Output recordings data

    Note over User,GrainAPI: Grain Webhook Setup
    User->>GrainTool: Create webhook (create_hook)
    GrainTool->>GrainAPI: POST /v2/hooks/create
    GrainAPI-->>GrainTool: Return webhook config
    GrainTool-->>User: Webhook created

    Note over GrainWebhook,WebhookProcessor: Grain Webhook Flow
    GrainWebhook->>WebhookProcessor: POST webhook event
    WebhookProcessor->>WebhookProcessor: Verify webhook secret (optional)
    WebhookProcessor->>WebhookProcessor: Parse recording_created event
    WebhookProcessor-->>GrainWebhook: 200 OK
    WebhookProcessor->>User: Trigger workflow execution

    Note over CirclebackWebhook,CirclebackProcessor: Circleback Webhook Flow
    CirclebackWebhook->>WebhookProcessor: POST meeting data
    WebhookProcessor->>WebhookProcessor: Verify HMAC-SHA256 signature
    WebhookProcessor->>WebhookProcessor: Parse meeting payload
    WebhookProcessor-->>CirclebackWebhook: 200 OK
    WebhookProcessor->>User: Trigger workflow with meeting data
Loading

@waleedlatif1 waleedlatif1 merged commit 6c8f1a8 into staging Dec 23, 2025
11 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/grain branch December 23, 2025 22:34
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.

2 participants