Skip to content

feat: Event Groups support (experimental)#2209

Draft
mjameswh wants to merge 2 commits into
mainfrom
event-groups-feature
Draft

feat: Event Groups support (experimental)#2209
mjameswh wants to merge 2 commits into
mainfrom
event-groups-feature

Conversation

@mjameswh

Copy link
Copy Markdown
Contributor

Warning

Experimental / WIP — opened as a draft for self-review. Not ready for external review yet.

Summary

Initial TypeScript SDK implementation of Event Groups (see the design doc for context).

  • Explicit markers: createEventGroup(label) returns a marker attachable to commands via a groups: [...] option or an execution scope (marker.run(...), propagated through coroutines via AsyncLocalStorage). Nested scopes compose; markers dedupe by id.
  • Implicit markers: automatically wrap the workflow main function, signal handlers, and update handlers.
  • Markers are serialized onto outgoing commands as eventGroupMarkers. Explicit label marker ids are derived deterministically as SHA1(originalExecutionRunId + label) (sandbox-safe SHA-1 in sha1.ts).
  • Exposes WorkflowInfo.originalExecutionRunId (plumbed core → lang) and bumps the sdk-core submodule to the matching build.

Testing

Proof-of-concept boundary test packages/test/src/test-event-groups.ts asserts the markers attached to commands via a concludeActivation interceptor. Run against an Event Groups–capable dev server:

```
TESTS_CLI_VERSION=v1.7.4-standalone-nexus-operations ava ./lib/test-event-groups.js
```

Currently 3/3 passing.

Follow-ups / open questions

  • Test currently asserts at the lang↔core boundary; revisit once server-side history assertions are wanted.
  • Remaining `FIXME`s in `event-groups.ts` (e.g. `Long` V8 serialization; whether marker `id` should be public API).

mjameswh added 2 commits July 14, 2026 04:49
Introduce the Event Groups primitive in the Workflow APIs:

- `createEventGroup(label)` creates explicit Event Group Markers, attachable to
  commands via a `groups: [...]` option or an execution scope (`marker.run(...)`,
  propagated through coroutines via AsyncLocalStorage). Nested scopes compose and
  markers dedupe by id.
- Implicit markers automatically wrap the workflow main function, signal handlers,
  and update handlers.
- Markers are serialized onto outgoing commands as `eventGroupMarkers`; explicit
  label marker ids are derived deterministically as `SHA1(originalExecutionRunId + label)`.

Also exposes `WorkflowInfo.originalExecutionRunId` (plumbed core -> lang) and bumps
the sdk-core submodule to the matching build.

Includes a proof-of-concept boundary test (test-event-groups.ts) that asserts the
markers attached to commands via a `concludeActivation` interceptor.
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