wenjin272 commented on code in PR #651:
URL: https://github.com/apache/flink-agents/pull/651#discussion_r3212576571


##########
docs/content/docs/development/workflow_agent.md:
##########
@@ -491,37 +491,111 @@ To use async execution on JDK 21+, user should append 
jvm option `--add-exports=
 {{< /tabs >}}
 
 ## Event
-Events are messages passed between actions. Events may carry payloads. A 
single event may trigger multiple actions if they are all listening to its type.
 
-There are 2 special types of event.
-* `InputEvent`: Generated by the framework, carrying an input data record that 
arrives at the agent in `input` field . Actions listening to the `InputEvent` 
will be the entry points of agent.
-* `OutputEvent`: The framework will listen to `OutputEvent`, and convert its 
payload in `output` field into outputs of the agent. By generating 
`OutputEvent`, actions can emit output data.
+Events are JSON-serializable messages passed between actions. Every event has 
a `type` string used for routing and an `attributes` map that carries the 
payload. A single event may trigger multiple actions if they are all listening 
to its type.
 
-User can define own event by extends `Event`.
+### Special Events
+
+* `InputEvent`: Generated by the framework, carrying an input data record that 
arrives at the agent in its `input` attribute. Actions listening to 
`InputEvent` are the entry points of the agent.
+* `OutputEvent`: The framework listens to `OutputEvent` and converts its 
`output` attribute into outputs of the agent.
+
+### Unified Event
+
+For simple cases, users can pass data between actions directly using `Event` 
with a custom `type` and `attributes`, without needing to define a subclass. 
For more structured events, see [Custom Event 
Subclasses](#custom-event-subclasses) below.
+
+{{< tabs "Unified Event" >}}
+
+{{< tab "Python" >}}
+```python
+# Send a unified event from one action
+ctx.send_event(Event(type="my_event", attributes={"field1": "test", "field2": 
42}))

Review Comment:
   I suggest moving the `send_event` call into an action method as well, to 
make it clear that all events are generated by actions.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to