Skip to content

Add a workflow executor-I/O observation example handling ExecutorInvokedEvent and ExecutorCompletedEvent - #736

Open
PratikDhanave wants to merge 1 commit into
microsoft:mainfrom
PratikDhanaveFork:workflow-executor-io-example
Open

Add a workflow executor-I/O observation example handling ExecutorInvokedEvent and ExecutorCompletedEvent#736
PratikDhanave wants to merge 1 commit into
microsoft:mainfrom
PratikDhanaveFork:workflow-executor-io-example

Conversation

@PratikDhanave

Copy link
Copy Markdown
Contributor

What

Adds examples/03-workflows/observability/executor_io/main.go, a small event-stream observability example that builds a two-executor workflow (uppercase -> reverse, mirroring 01_streaming), runs it via inproc.Default.RunStreaming, and in the run.WatchStream loop handles both ExecutorInvokedEvent (the input Message each node received) and ExecutorCompletedEvent (the Result each node produced), plus OutputEvent, ExecutorFailedEvent, and ErrorEvent.

It is registered as a deterministic example in cmd/verifyexamples/examples.go, asserting the per-executor invoked and completed lines appear in stdout.

Why

workflow.ExecutorInvokedEvent is exported and emitted on the workflow event stream, but no example referenced it. The one existing event-stream sample (01_streaming) switches only on ExecutorCompletedEvent/OutputEvent/ErrorEvent/ExecutorFailedEvent, so it surfaces per-executor output but never the per-executor input. This example fills that gap and documents the full input->output trace of each node.

This matches the .NET/Python observability samples, which show both the executor-invoke and executor-complete events to give a complete per-executor I/O view, keeping the Go port aligned on which lifecycle events are demonstrated.

Testing

  • go build ./..., go vet ./... pass.
  • go run ./examples/03-workflows/observability/executor_io/ prints an invoked line carrying the input Message and a completed line carrying the Result for each executor ID, confirming ExecutorInvokedEvent is emitted and matched.
  • go test ./cmd/verifyexamples/ and go test ./workflow/ pass; the new deterministic entry checks the invoked/completed output.

No provider or credentials needed since plain function executors suffice.

Copilot AI review requested due to automatic review settings July 24, 2026 03:47
@PratikDhanave
PratikDhanave requested a review from a team as a code owner July 24, 2026 03:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Go workflow observability example demonstrating how to trace per-executor inputs and outputs by consuming workflow.ExecutorInvokedEvent alongside workflow.ExecutorCompletedEvent on the streaming event bus, and registers it for deterministic verification.

Changes:

  • Added examples/03-workflows/observability/executor_io/main.go, a two-node (uppercase → reverse) workflow that prints invoked/completed events per executor plus output/error events.
  • Registered the new example in cmd/verifyexamples/examples.go with deterministic MustContain assertions covering invoked/completed lines for both executors.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
examples/03-workflows/observability/executor_io/main.go New observability example printing per-executor invoked/completed I/O from the workflow event stream.
cmd/verifyexamples/examples.go Registers the new example with deterministic substring checks for invoked/completed output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

This comment has been minimized.

@github-actions github-actions Bot added the parity-approved Go API consistency review found no parity issues label Jul 24, 2026
Add examples/03-workflows/observability/executor_io demonstrating how to
observe per-executor input and output by handling ExecutorInvokedEvent and
ExecutorCompletedEvent from the workflow event stream. The existing
01_streaming sample only surfaces ExecutorCompletedEvent output, so there was
no example showing the input each node receives via ExecutorInvokedEvent.

Register the deterministic example in cmd/verifyexamples so its invoked and
completed output lines are checked.
@PratikDhanave
PratikDhanave force-pushed the workflow-executor-io-example branch from f1978bd to b6ae98d Compare July 24, 2026 09:30
@github-actions

Copy link
Copy Markdown
Contributor

Parity Review ✅

This PR adds examples/03-workflows/observability/executor_io/main.go, which demonstrates ExecutorInvokedEvent + ExecutorCompletedEvent for a full per-executor I/O trace.

No new exported Go APIs introduced. The example uses only existing exported types.

Cross-repo parity confirmed:

  • The .NET implementation ships an equivalent ExecutorInvokedEvent in dotnet/src/Microsoft.Agents.AI.Workflows/ExecutorInvokedEvent.cs with the same semantic contract (executor ID + invocation message on entry, result on completion).
  • The Go example aligns with how WorkflowRunner.cs demonstrates consuming the event.

No parity issues found. The parity-approved label is correct. The public-api-change label is not applicable since no exported Go API surface changed.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by Go API Consistency Review Agent · 24 AIC · ⌖ 4.87 AIC · ⊞ 5.9K ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parity-approved Go API consistency review found no parity issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants