Skip to content

feat(grain): migrate to v2 API, add get-transcript and list-recordings actions - #21865

Open
howleysv wants to merge 3 commits into
PipedreamHQ:masterfrom
howleysv:grain-v2-migration
Open

feat(grain): migrate to v2 API, add get-transcript and list-recordings actions#21865
howleysv wants to merge 3 commits into
PipedreamHQ:masterfrom
howleysv:grain-v2-migration

Conversation

@howleysv

@howleysv howleysv commented Sep 2, 2026

Copy link
Copy Markdown

Clone of #21855 with "Allow edits by maintainers"

Summary

Migrates the Grain integration from the legacy v1 public API to the v2 public API (https://api.grain.com/_/public-api/v2, required Public-Api-Version: 2025-10-31 header). Grain's v1 API is deprecated and will be sunset. See the documentation.

Auth is unchanged — Grain's OAuth endpoints are unversioned and v2 accepts the same bearer tokens, so existing connected accounts continue to work without any app-config changes.

Changes

  • grain.app.mjs: new v2 base URL and version header; list/get recording moved to v2 POST endpoints with filter/include bodies; webhook creation moved to POST /hooks/create with hook_type (the v1 views resource no longer exists in v2); shared propDefinitions for the recording include options.
  • Get Recording (1.0.0, major — props removed/renamed): v1 transcript_format/intelligence_notes_format/allowed_intelligence_notes props replaced with v2 include options (highlights, participants, AI action items, AI summary, calendar event, HubSpot data, screenshares).
  • New Recording (Instant) (1.0.0, major — viewId prop removed): subscribes via hook_type: recording_added with optional include props; test event updated to the v2 payload. Also guards deactivate() when no hook ID was stored, and emits the recording's native ID for stable deduplication.
  • New actions:
    • Get Transcript (0.0.1): fetches a recording's transcript in json, txt, vtt, or srt format.
    • List Recordings (0.0.1): lists recordings with v2 filters (date range, title search, participant scope) and cursor pagination.
  • Removed sources: the updated/removed recording, highlight, and story sources are deleted — they were built on the v1 views-based webhook model. Existing deployed instances remain pinned to their published versions and are unaffected.
  • components/grain/package.json bumped 0.1.01.0.0 (major, matching the largest component change).

Checklist

Please check the following items before your PR can be reviewed:

Versioning

  • All components updated in this PR had their version updated (0.0.1 for new ones)
  • The app updated in this PR had its package.json's version updated

New app

If this is a new app, please submit an app integration request - the PR will only be reviewed after the app is integrated.

  • The app updated in this PR is already integrated

CodeRabbit review

After the PR is opened, and if new changes are pushed, CodeRabbit will automatically review it. Do not 'mark as resolved' CodeRabbit's comments, but reply to them instead, whether you agree (and update the PR accordingly) or disagree.

  • I have addressed or acknowledged all of CodeRabbit's review comments

Summary by CodeRabbit

  • New Features

    • Added actions to retrieve full transcripts in JSON, text, VTT, or SRT formats.
    • Added an action to list recordings with date, title, participant, and result-limit filters.
    • Recording retrieval now supports optional highlights, participants, summaries, action items, calendar, HubSpot, and screenshare data.
    • New recording events support configurable related data.
  • Changes

    • Updated Grain integration to the latest public API.
    • Removed legacy story, highlight, and recording update/removal event sources.

…s actions

Migrate all components from the legacy v1 public API to v2
(api.grain.com/_/public-api/v2, Public-Api-Version: 2025-10-31):

- Get Recording: replace transcript/intelligence-notes format props with
  v2 include options (highlights, participants, AI action items, AI
  summary, calendar event, HubSpot, screenshares); major bump to 1.0.0
- New Recording (Instant): subscribe via v2 hook_type instead of the
  removed views resource, add include props; major bump to 1.0.0
- Remove the eight other sources (updated/removed recordings, highlights,
  stories) — existing deployments stay pinned to their published versions
- Add Get Transcript action (json/txt/vtt/srt formats)
- Add List Recordings action with v2 recording filters
- Guard webhook deactivate when no hook ID is stored; emit native
  recording ID for stable dedupe
- Default prevContext safely in recordingId options loader
- Add min: 1 constraint to maxResults in list-recordings
- Use recording end_datetime for emitted event timestamp, falling
  back to Date.now() when unavailable
- Expand action descriptions with agent guidance and cross-tool
  references
@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
pipedream-docs-redirect-do-not-edit Ignored Ignored Sep 2, 2026 11:30am UTC

Request Review

@pipedream-component-development

Copy link
Copy Markdown
Collaborator

Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified.

@pipedream-component-development

Copy link
Copy Markdown
Collaborator

Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 41bceb55-c383-41f9-af2f-3883187e6f14

📥 Commits

Reviewing files that changed from the base of the PR and between 051cdf4 and d9028b5.

📒 Files selected for processing (26)
  • components/grain/actions/get-recording/get-recording.mjs
  • components/grain/actions/get-transcript/get-transcript.mjs
  • components/grain/actions/list-recordings/list-recordings.mjs
  • components/grain/common/constants.mjs
  • components/grain/common/utils.mjs
  • components/grain/grain.app.mjs
  • components/grain/package.json
  • components/grain/sources/common/base.mjs
  • components/grain/sources/new-highlight-instant/new-highlight-instant.mjs
  • components/grain/sources/new-highlight-instant/test-event.mjs
  • components/grain/sources/new-recording-instant/new-recording-instant.mjs
  • components/grain/sources/new-recording-instant/test-event.mjs
  • components/grain/sources/new-story-instant/new-story-instant.mjs
  • components/grain/sources/new-story-instant/test-event.mjs
  • components/grain/sources/removed-highlight-instant/removed-highlight-instant.mjs
  • components/grain/sources/removed-highlight-instant/test-event.mjs
  • components/grain/sources/removed-recording-instant/removed-recording-instant.mjs
  • components/grain/sources/removed-recording-instant/test-event.mjs
  • components/grain/sources/removed-story-instant/removed-story-instant.mjs
  • components/grain/sources/removed-story-instant/test-event.mjs
  • components/grain/sources/updated-highlight-instant/test-event.mjs
  • components/grain/sources/updated-highlight-instant/updated-highlight-instant.mjs
  • components/grain/sources/updated-recording-instant/test-event.mjs
  • components/grain/sources/updated-recording-instant/updated-recording-instant.mjs
  • components/grain/sources/updated-story-instant/test-event.mjs
  • components/grain/sources/updated-story-instant/updated-story-instant.mjs
💤 Files with no reviewable changes (17)
  • components/grain/sources/removed-highlight-instant/test-event.mjs
  • components/grain/sources/removed-recording-instant/removed-recording-instant.mjs
  • components/grain/sources/removed-story-instant/removed-story-instant.mjs
  • components/grain/sources/new-story-instant/new-story-instant.mjs
  • components/grain/common/utils.mjs
  • components/grain/sources/removed-recording-instant/test-event.mjs
  • components/grain/sources/new-highlight-instant/new-highlight-instant.mjs
  • components/grain/sources/new-story-instant/test-event.mjs
  • components/grain/sources/updated-highlight-instant/test-event.mjs
  • components/grain/sources/updated-story-instant/updated-story-instant.mjs
  • components/grain/sources/updated-recording-instant/updated-recording-instant.mjs
  • components/grain/sources/updated-recording-instant/test-event.mjs
  • components/grain/sources/new-highlight-instant/test-event.mjs
  • components/grain/sources/updated-highlight-instant/updated-highlight-instant.mjs
  • components/grain/sources/removed-story-instant/test-event.mjs
  • components/grain/sources/updated-story-instant/test-event.mjs
  • components/grain/sources/removed-highlight-instant/removed-highlight-instant.mjs

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The Grain integration now uses Public API v2. It adds recording listing and transcript actions, supports optional recording data, updates recording webhooks, and removes obsolete view-based source components and fixtures.

Changes

Grain API v2 integration

Layer / File(s) Summary
API client contracts
components/grain/grain.app.mjs, components/grain/package.json
The app now uses recordingId, Public API v2, updated request routes, transcript retrieval, and optional recording include props. The package version is 1.0.0.
Recording retrieval actions
components/grain/actions/get-recording/get-recording.mjs, components/grain/actions/get-transcript/get-transcript.mjs, components/grain/actions/list-recordings/list-recordings.mjs, components/grain/common/constants.mjs
The actions support recording includes, transcript formats json, txt, vtt, and srt, and paginated recording searches with filters and result limits.
Recording webhook migration
components/grain/sources/common/base.mjs, components/grain/sources/new-recording-instant/new-recording-instant.mjs, components/grain/sources/new-recording-instant/test-event.mjs
Recording webhooks now use hook_type and include, optional recording data, guarded deactivation, payload-based event IDs, and payload timestamps. The recording-added fixture matches the updated payload.
Obsolete source removal
components/grain/sources/new-highlight-instant/*, components/grain/sources/new-story-instant/*, components/grain/sources/removed-highlight-instant/*, components/grain/sources/removed-recording-instant/*, components/grain/sources/removed-story-instant/*, components/grain/sources/updated-highlight-instant/*, components/grain/sources/updated-recording-instant/*, components/grain/sources/updated-story-instant/*
The obsolete highlight, story, recording-removal, and recording-update instant sources and their fixtures were deleted.
Shared utility cleanup
components/grain/common/utils.mjs
The unused parseObject utility was removed.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to d9028

The PR is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant Action
  participant GrainApp
  participant GrainAPI
  Action->>GrainApp: request recording, transcript, or recording list
  GrainApp->>GrainAPI: send Public API v2 request
  GrainAPI-->>GrainApp: return requested data
  GrainApp-->>Action: return response and summary
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 8…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description explains the v1-to-v2 migration, lists the main changes, documents removed and new components, explains compatibility, and completes all required checklist sections.
Title check ✅ Passed The title clearly summarizes the primary changes: Grain v2 API migration and the addition of the Get Transcript and List Recordings actions.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 8 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

description: "Fetches a specific recording by its ID from Grain, returning its metadata (title, times, URL, tags, teams, meeting type)."
+ " Enable the optional include props to add highlights, participants, AI action items, AI summary, calendar event, HubSpot data, or screenshares to the response."
+ " Use **List Recordings** to find recording IDs, and **Get Transcript** to fetch the full transcript."
+ " [See the documentation](https://developers.grain.com)",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
+ " [See the documentation](https://developers.grain.com)",
+ " [See the documentation](https://developers.grain.com/#get-recording)",

+ " The `json` format returns structured segments with speaker, participant ID, start/end times in milliseconds, and text;"
+ " `txt`, `vtt`, and `srt` return plain text or subtitle formats."
+ " Use **List Recordings** to find recording IDs; use **Get Recording** for the recording's metadata instead of its transcript."
+ " [See the documentation](https://developers.grain.com)",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
+ " [See the documentation](https://developers.grain.com)",
+ " [See the documentation](https://developers.grain.com/#get-recording-transcript-json)",

description: "Lists Grain recordings, optionally filtered by start datetime range (ISO8601), title search, or participant scope."
+ " Automatically paginates and returns up to Max Results recordings."
+ " Use this to find recording IDs for **Get Recording** and **Get Transcript**."
+ " [See the documentation](https://developers.grain.com)",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
+ " [See the documentation](https://developers.grain.com)",
+ " [See the documentation](hhttps://developers.grain.com/#list-recordings)",

export default {
...common,
key: "grain-new-highlight-instant",
name: "New Highlight (Instant)",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It looks like this and the other deleted sources can be implemented in v2.
https://developers.grain.com/#create-hook

name: "New Recording (Instant)",
description: "Emit new event when a recording that matches the filter is added.",
version: "0.0.1",
description: "Emit new event when a recording is added. [See the documentation](https://developers.grain.com)",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
description: "Emit new event when a recording is added. [See the documentation](https://developers.grain.com)",
description: "Emit new event when a recording is added. [See the documentation](https://developers.grain.com/#create-hook)",

@michelle0927 michelle0927 moved this from Ready for PR Review to Changes Required in Component (Source and Action) Backlog Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

User submitted Submitted by a user

Projects

Development

Successfully merging this pull request may close these issues.

6 participants