Add Workflows list endpoint#3509
Merged
Merged
Conversation
Adds new model classes to handle the GET /v1/subscribers/{userId}/workflows
endpoint response. The WorkflowSummary model includes:
- id: unique workflow identifier
- display_name: user-facing workflow name
- offering_id: optional nullable offering identifier
- prefetch: boolean flag for prefetch support (defaults to false)
The WorkflowsListResponse wraps a list of WorkflowSummary objects.
Both models use kotlinx.serialization with proper deserialization
handling for missing/null fields.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a089a9e. Configure here.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3509 +/- ##
==========================================
- Coverage 79.89% 79.87% -0.02%
==========================================
Files 369 369
Lines 14875 14929 +54
Branches 2048 2057 +9
==========================================
+ Hits 11884 11925 +41
- Misses 2158 2167 +9
- Partials 833 837 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Adds an optional `type` parameter to `Endpoint.GetWorkflows` and `Backend.getWorkflows()` so callers can filter by workflow type (e.g. `?type=paywall`). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
facumenzella
added a commit
to RevenueCat/purchases-ios
that referenced
this pull request
May 28, 2026
* feat(networking): add getWorkflows list endpoint Port of RevenueCat/purchases-android#3509 Adds WorkflowSummary and WorkflowsListResponse models, GetWorkflowsListOperation, and WorkflowsAPI.getWorkflows() to support listing a subscriber's workflows via GET /v1/subscribers/{userId}/workflows. Includes request deduplication and background-aware delay, matching the existing getWorkflow(by id) pattern. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add WorkflowsListCallback and GetWorkflowsListOperation to Xcode project Register the two new source files in the root RevenueCat.xcodeproj so xcodebuild (used by CI) can find them. SPM discovers them automatically but the tracked root project needs explicit file references and build file entries. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix snapshots: remove ?type=paywall query param from getWorkflows endpoint The getWorkflows endpoint does not send a type filter query parameter. The snapshots were created from an earlier design and needed to be updated to match the actual request URL. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix WorkflowSummary decoding with JSONDecoder.default convertFromSnakeCase JSONDecoder.default uses .convertFromSnakeCase, which converts JSON keys to camelCase before matching against CodingKey raw values. The explicit CodingKeys had snake_case raw values (e.g. "display_name"), causing a mismatch since the decoder would convert display_name to displayName before the lookup. Removing the explicit CodingKeys lets Swift synthesize them with camelCase raw values, which correctly match the converted keys. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(networking): add type filter parameter and deserialization robustness tests - Add optional `type: String?` parameter to `getWorkflows` path, operation, API method, and mock, matching Android PR #3509 which supports `?type=<value>` query filtering on the list endpoint - Include `type` in the operation deduplication cache key so calls with different types are not coalesced - Add `testGetWorkflowsWithTypePassesQueryParameter` with snapshots for all OS variants - Add `WorkflowSummaryDecodingTests` covering explicit-null `offering_id`, absent `prefetch` default, and unknown-field tolerance for both `WorkflowSummary` and `WorkflowsListResponse` - Remove unnecessary `import Foundation` from `WorkflowsListCallback.swift` Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Address review: enable signature verification for getWorkflows, fix cache key separator and indentation - Move .getWorkflows to supportsSignatureVerification=true, matching .getWorkflow and Android PR (#3509) - Add "\n" separator between appUserID and type in individualizedCacheKeyPart to prevent collision - Fix indentation of factory closure closing brace and label to match GetWorkflowOperation pattern Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
matteinn
pushed a commit
to matteinn/purchases-android
that referenced
this pull request
Jun 5, 2026
**This is an automatic release.** ## RevenueCat SDK ### ✨ New Features * Add presented offering context to custom paywall events (RevenueCat#3424) via Rick (@rickvdl) * Add Workflows list endpoint (RevenueCat#3509) via Cesar de la Vega (@vegaro) ## RevenueCatUI SDK ### Paywalls_v2 #### 🐞 Bugfixes * Fix 1px seam between sliding multipage paywall pages (RevenueCat#3526) via Cesar de la Vega (@vegaro) ### 🔄 Other Changes * refactor: extract Offering.presentedOfferingContext() helper and apply across SDK (RevenueCat#3513) via Rick (@rickvdl) * Add JSON Logic string + array operators (RevenueCat#3485) via Antonio Pallares (@ajpallares) * Add ForbiddenPublicSealedClass detekt rule (RevenueCat#3503) via Toni Rico (@tonidero) * Update baseline profiles (RevenueCat#3519) via RevenueCat Git Bot (@RCGitBot) * build(deps): bump fastlane-plugin-revenuecat_internal from `af7bb5c` to `ce6a7ef` (RevenueCat#3515) via dependabot[bot] (@dependabot[bot]) * Add JSON Logic comparison operators (<, <=, >, >=) (RevenueCat#3484) via Antonio Pallares (@ajpallares) * Add JSON Logic arithmetic operators (+, -, *, /, %) (RevenueCat#3483) via Antonio Pallares (@ajpallares) * Add WorkflowEvent model and backend serialization (RevenueCat#3486) via Cesar de la Vega (@vegaro) * RulesEngine: add JSON Logic predicate evaluator (RevenueCat#3482) via Antonio Pallares (@ajpallares) * Add :rules-engine-internal skeleton module (RevenueCat#3478) via Antonio Pallares (@ajpallares) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Version bump and changelog/docs/CI path updates only; no application logic changes in the diff. > > **Overview** > This **automatic release** finalizes **Android SDK 10.8.0** by replacing **`10.8.0-SNAPSHOT`** with **`10.8.0`** across versioning (`gradle.properties`, `.version`, `Config.frameworkVersion`), sample apps, and changelog files. > > Release notes for **10.8.0** are recorded in **`CHANGELOG.md`** / **`CHANGELOG.latest.md`** (workflows list API, paywall offering context on custom events, multipage paywall seam fix, rules-engine/JSON Logic work, etc.). **Docs publishing** now targets **`10.8.0`** on S3, and **`docs/index.html`** redirects to the new doc URL. > > There are **no functional code changes** in this diff beyond version strings and release metadata. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c3048b8. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
WorkflowSummaryandWorkflowsListResponsemodels (id,display_name,offering_id,prefetch) with kotlinx.serialization andignoreUnknownKeysfor forward compatibilityWorkflowJsonParser.parseWorkflowsListResponse()Endpoint.GetWorkflowsandBackend.getWorkflows()with background-aware callback deduplication (same pattern as the existinggetWorkflow()implementation)Part 1 of 2 — Part 2: #3508
Note
Low Risk
Additive networking and parsing alongside existing workflow detail APIs, with broad test coverage and no changes to purchase or auth flows.
Overview
Adds client support for listing subscriber workflows via
GET /v1/subscribers/{userId}/workflows, including an optionaltypequery filter.New kotlinx-serialization models
WorkflowSummaryandWorkflowsListResponse(withparseWorkflowsListResponse) describe list entries (id,display_name,offering_id,prefetch).Endpoint.GetWorkflowsis wired for signature verification like the single-workflow endpoint, andBackend.getWorkflowsperforms the request with the same background-aware callback deduplication pattern asgetWorkflow. Tests cover path encoding, deserialization edge cases, HTTP errors, and concurrent call coalescing.Reviewed by Cursor Bugbot for commit b27d7cd. Bugbot is set up for automated code reviews on this repo. Configure here.