(ogn_omni_graph_action_overview)=

```{csv-table}
**Extension**: omni.graph.action,**Documentation Generated**: {sub-ref}`today`
```

This extension is a collection of functionality required for OmniGraph Action Graphs.

```{note}
Action Graphs are in an early development state
```

# Action Graph Overview

For a hands-on introduction to OmniGraph Action Graphs see
[Action Graph Quickstart](https://docs.omniverse.nvidia.com/prod_extensions/prod_extensions/ext_omnigraph/quickstart.html)

For more comprehensive and thorough documentation on various OmniGraph features see {ref}`ogn_user_guide`

Action Graphs are comprised of any number of separate chains of nodes, like deformer graphs. However there are important differences which make Action graphs more suited to particular applications.

## Event Sources

Action graphs are *event driven*, which means that each chain of nodes must start with an *Event Source* node. Each event source node can be thought of as an entry point of the graph.

*Event Source* nodes are named with an *On* prefix, never have an *execution* input attribute, and always have at least one output *execution* attribute.

|                                     Event Source Nodes                                     |
| ------------------------------------------------------------------------------------------ |
| {ref}`On Keyboard Input <GENERATED - Documentation _ognomni.graph.action.OnKeyboardInput>` |
| {ref}`On Tick <GENERATED - Documentation _ognomni.graph.action.OnTick>`                    |
| {ref}`On Playback Tick <GENERATED - Documentation _ognomni.graph.action.OnPlaybackTick>`   |
| {ref}`On Impulse Event <GENERATED - Documentation _ognomni.graph.action.OnImpulseEvent>`   |
| {ref}`On Object Change <GENERATED - Documentation _ognomni.graph.action.OnObjectChange>`   |
| {ref}`On Custom Event <GENERATED - Documentation _ognomni.graph.action.OnCustomEvent>`     |

## Execution Attributes

Action graphs make use of *execution*-type attributes.

The *execution* evaluator works by following *execution* connections downstream and computing nodes it encounters until there are no more downstream connections to follow. The entire chain is executed to completion. When there is no downstream node the execution terminates and the next node is popped off the *execution stack*

Note that if there is more than one downstream connection from an *execution* attribute, each path will be followed in an undetermined order. Multiple downstream chains can be executed in a fixed order either by chaining the end of one to the start of the other, or by using the {ref}`Sequence <GENERATED - Documentation _ognomni.graph.action.Sequence>` node.

The value of an *execution* attribute tells the evaluator what the next step should be in the chain. It can be one of:

| Value            | Description
| ---------------- | ------------------------------------------------------------------------------------------- |
| DISABLED         | Do not continue from this attribute.                                                        |
| ENABLED          | Continue downstream from this attribute.                                                    |
| ENABLED_AND_PUSH | Save the current node on the *execution stack* and continue downstream from this attribute. |
| LATENT_PUSH      | Save the current node as it performs some asynchronous operation                            |
| LATENT_FINISH    | Finish the asynchronous operation and continue downstream from this attribute.              |

# Flow Control

Many Action graphs will need to do different things depending on some state. In a python script you would use an *if* or *while* loop to accomplish this. Similarly in Action graph there are nodes which provide this branching functionality. Flow control nodes have more than one *execution* output attribute, which is used to branch the evaluation flow.

|                             Flow Control Nodes                              |
| --------------------------------------------------------------------------- |
| {ref}`Branch <GENERATED - Documentation _ognomni.graph.action.Branch>`      |
| {ref}`ForEach <GENERATED - Documentation _ognomni.graph.action.ForEach>`    |
| {ref}`For Loop <GENERATED - Documentation _ognomni.graph.action.ForLoop>`   |
| {ref}`Flip Flop <GENERATED - Documentation _ognomni.graph.action.FlipFlop>` |
| {ref}`Gate <GENERATED - Documentation _ognomni.graph.action.Gate>`          |
| {ref}`Sequence <GENERATED - Documentation _ognomni.graph.action.Sequence>`  |
| {ref}`Delay <GENERATED - Documentation _ognomni.graph.action.Delay>`        |
