Primary Components

There are 3 types of components used to implement a graph:

  • A graph object

  • Nodes

  • Edges

The graph object is the owner of the tasks created on behalf of the flow graph. Users can wait on the graph if they need to wait for the completion of all of the tasks related to the flow graph execution. One can also register external interactions with the graph and run tasks under the ownership of the flow graph.

Nodes invoke user-provided function objects or manage messages as the flow to/from other nodes. There are pre-defined nodes that buffer, filter, broadcast or order items as they flow through the graph.

Edges are the connections between the nodes, created by calls to the make_edge function.


The tasks related to the flow graph are executed in the task_group_context of that flow graph. If no context is specified when a flow graph is created, a new context is created and bound to the enclosing context.

The context a body of a flow graph node is executed in is that node's graph. If a cancellation or exception occurs in that node, the context of its graph is cancelled, and if necessary the exception thrown is passed to the enclosing context for further processing.

For more complete information about compiler optimizations, see our Optimization Notice.