Reconcile the membership mirror from WorkOS events - #2024
Merged
Merged
Conversation
RhysSullivan
added this pull request to stack #2027
September 16, 2026 16:27
Contributor
Cloudflare previewTorn down — the PR is closed. |
@executor-js/cli
@executor-js/config
@executor-js/execution
@executor-js/sdk
@executor-js/codemode-core
@executor-js/runtime-quickjs
@executor-js/plugin-file-secrets
@executor-js/plugin-graphql
@executor-js/plugin-keychain
@executor-js/plugin-mcp
@executor-js/plugin-onepassword
@executor-js/plugin-openapi
executor
commit: |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | f4d9475 | Commit Preview URL Branch Preview URL |
Sep 16 2026, 06:04 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | f4d9475 | Sep 16 2026, 06:05 PM |
RhysSullivan
force-pushed
the
member-directory/reconciler
branch
from
September 16, 2026 17:40
6ca0929 to
1f64541
Compare
RhysSullivan
force-pushed
the
member-directory/reconciler
branch
from
September 16, 2026 18:02
1f64541 to
c0f1478
Compare
RhysSullivan
force-pushed
the
member-directory/reconciler
branch
from
September 16, 2026 18:02
c0f1478 to
f4d9475
Compare
RhysSullivan
marked this pull request as ready for review
September 16, 2026 18:15
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.
Layer 3 of 5. Cloud only. Sits directly on the feeders so the mirror is reconciled before anything reads it. Replaces #2006, which GitHub auto-closed when the stack was reordered; nothing from it reached main.
syncWorkOsEventsreplays user, organization_membership, and organization events from the WorkOS Events API after a persisted cursor, starting from the backfill's replay boundary. Each page is planned first, then applied in one transaction where the cursor compare-and-set runs before the writes, so overlapping runs cannot double-apply or resurrect a deleted row. A run stops after 20 pages and the next tick continues. Each run recordsdrained_at.organization.updatedis a pure rename.organization.deletedmarks the org deleted, minting a tombstone row if the mirror never saw it.triggers.cronsplus ascheduledexport on the worker). Migration 0020 addsdrained_at.POST /api/webhooks/workosverifies the signature and pokes the same reconciler. It never applies the webhook payload. Answers 503 until the secret is set.scripts/drain-workos-events.tsruns it out of band under bun.Ops steps (cloud):
wrangler secret put WORKOS_WEBHOOK_SECRET, then registerhttps://executor.sh/api/webhooks/workosin the WorkOS dashboard foruser.*,organization_membership.*,organization.updated, andorganization.deleted.