Skip to content

Add experimental Event Groups support - #589

Merged
mjameswh merged 5 commits into
mainfrom
event-groups-feature
Oct 23, 2026
Merged

mjameswh merged 5 commits into
mainfrom
event-groups-feature

Conversation

@mjameswh

Copy link
Copy Markdown
Contributor

Summary

Add experimental support for Event Groups.

Event Groups is a new form of Workflow-level metadata that allows for improved visibility into a Workflow execution's history by grouping logically related Events together based on user-defined or system-inferred criteria.

  • Explicit groups: Workflow.create_event_group(id, label: "...") takes the Event Group's ID as its first and only required argument. The user-provided ID is used verbatim as the grouping key and should not contain sensitive information. The label is optional and, if provided, is a codec-encoded Payload. Attach a group per call (event_groups: [...]) or ambiently with Workflow.with_event_groups(...) { } (propagated through fibers). Nested scopes compose; markers dedupe by id.
  • Implicit groups: automatically wrap signal and update handlers.
  • Markers are serialized onto outgoing commands as event_group_markers. The user-facing type is EventGroup; the protocol type remains EventGroupMarker.
  • Exposes Workflow::Info#original_execution_run_id (plumbed core → lang) and bumps the sdk-core submodule to the matching build.

No child-handle cancel (EG-COMMANDS-07-CHILD): ChildWorkflowHandle has no cancel API.

Testing

Event Groups support requires an Event-Groups-capable server. Local tests pin Temporal CLI:

v1.8.3-server-1.32.0-162.0
bundle exec rake test TEST=test/worker_workflow_event_groups_test.rb

Cloud environments skip history-transcription cases.

@mjameswh mjameswh changed the title Add experimental Event Groups support [WIP] Add experimental Event Groups support Sep 18, 2026
@mjameswh
mjameswh force-pushed the event-groups-feature branch 2 times, most recently from 8f7165f to a0c45ff Compare October 16, 2026 20:15
@mjameswh mjameswh changed the title [WIP] Add experimental Event Groups support Add experimental Event Groups support Oct 16, 2026
@mjameswh
mjameswh marked this pull request as ready for review October 16, 2026 20:17
@mjameswh
mjameswh requested a review from a team as a code owner October 16, 2026 20:17
@mjameswh
mjameswh force-pushed the event-groups-feature branch 5 times, most recently from f65f65d to f20b0ac Compare October 16, 2026 21:13
@mjameswh
mjameswh force-pushed the event-groups-feature branch from f20b0ac to 6e31bee Compare October 17, 2026 05:40

@chris-olszewski chris-olszewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just some smaller edge cases.

Comment thread temporalio/lib/temporalio/workflow.rb Resolved
raise Error::CanceledError, 'Activity canceled before scheduled' if cancellation.canceled?

# Capture at request time. We'll reuse them if a backoff sleep happens later.
event_group_markers = Workflow::EventGroup._markers_for_command(event_groups)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We have to be careful, the Ruby payload visitor encodes in place so after the first try even_group_markers will contain encoded payloads.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch! I had anticipated that issue and did the right thing everywhere else, but I totally missed the gap resulting from this loop.

@mjameswh mjameswh self-assigned this Oct 22, 2026
@mjameswh
mjameswh merged commit 889c933 into main Oct 23, 2026
11 checks passed
@mjameswh
mjameswh deleted the event-groups-feature branch October 23, 2026 15:11
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