Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1234,24 +1234,60 @@ These references are used.

Every node has `.output` (the value it produced) and `.input` (the output of whichever node transitioned into it).

* If a node doesn't produce a value (for example, a router), its `.output` is `None`.
* If the preceding node is a trigger, `.input` is `None`.

*Example*

----
@orchestrator.hrSystemOnboard.output.employeeId # returns the `employeeId` property of the object returned by the `hrSystemOnboard` node
@generator.writeEmailContent.output # returns the string generated by the `writeEmailContent` node
----

* Use `.output` when you know exactly which upstream node you're referencing.
* Use `.input` when multiple nodes transition into the current one and you want to decouple it from the specific path taken.
==== When to Use `.output` vs `.input`

In this example, `@generator.generate_email.input` returns whichever of `node_a`, `node_b`, or `node_c` actually transitioned into it.
Use `.output` when you know exactly which upstream node you need data from. In a straight-line graph, `.output` is the simplest approach:

----
node_a ──┐
node_b ──┼──► generate_email ──► send_email
process ──► generate_email ──► send_email
----

* `generate_email` reads `@subagent.process.output` as the source content.
* `send_email` reads `@generator.generate_email.output` as its content.

An expression can target any preceding node in the graph, not only the node immediately before the current node.

To decouple a node from the path that reached it, use `.input`. In this example, `@generator.generate_email.input` returns the output from whichever of `node_a`, `node_b`, or `node_c` transitioned into `generate_email`:

----
node_a ──┐
node_b ──┼──► generate_email ──► send_email
node_c ──┘
----

=== Accessing Trigger Data
Comment thread
IsaacEldridge marked this conversation as resolved.

The `@request` namespace provides access to the trigger's incoming request data. Use `@request` expressions to read the payload, headers, and other properties of the request that started the workflow.

* `@request.payload`: Returns the request payload. For the `on_message` handler of the A2A trigger, this expression returns a `SendMessageRequest` object.
* `@request.interface`: Returns the name of the interface that produced the message (for example, `a2a`).

For A2A triggers, these additional references are also available:

* `@request.headers`: A case-insensitive dictionary of the HTTP request headers. For example, `@request.headers["Authorization"]` and `@request.headers["authorization"]` return the same value.
* `@request.taskId`: The current A2A task ID, either provided in the request or automatically generated by the trigger.
* `@request.contextId`: The current A2A context ID, either provided in the request or automatically generated by the trigger.

*Example*

[source,yaml]
----
reasoning:
instructions: -> @request.payload.message.parts[0].text
actions:
concur: @actions.concur-agent with http_headers = {"Authorization": @request.headers["Authorization"]}
----

=== Setting Action Headers

Any actions that connect to an external system often need to set custom headers. Use cases range from propagating authorization headers (for example, in OBO authentication) to adding custom correlation information.
Expand Down