NeoGraph 0.10.0
A C++17 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
neograph::graph::Send Struct Reference

Dynamic fan-out request (map-reduce pattern). More...

#include <types.h>

Public Attributes

json input
 Channel writes for that invocation.
 
std::string target_node
 Node to dispatch.
 

Detailed Description

Dynamic fan-out request (map-reduce pattern).

A node can return Send objects to dispatch the same (or different) node multiple times with different inputs. All Send targets execute in parallel via Taskflow.

Isolation semantics

Each multi-Send worker runs on an isolated GraphState copy: channel writes made inside a Send target are scoped to that worker and only merged back (via each channel's reducer) after all siblings finish. Concurrent workers therefore cannot corrupt each other's channel view.

This isolation does NOT extend to out-of-state side effects. If two Send workers call the same LLM provider instance, hit the same HTTP client, or write to the same file descriptor, they do so concurrently — whatever thread safety those external objects offer is what governs the outcome. Make sure any resource a Send target touches is either thread-safe or scoped per-invocation. (NeoGraph's own SchemaProvider and OpenAIProvider are both safe for concurrent use.)

NodeResult result;
for (auto& item : work_items) {
result.sends.push_back(Send{"worker_node", {{"item", item}}});
}
Extended result returned by node execution.
Definition types.h:297
std::vector< Send > sends
If non-empty, triggers dynamic fan-out.
Definition types.h:300
Dynamic fan-out request (map-reduce pattern).
Definition types.h:144

Definition at line 144 of file types.h.


The documentation for this struct was generated from the following file: