# Invoke and Reject Modes

## Summary

Invoke and Reject modes define what a chain returns when a node cannot continue normally. They are the small return rules behind busy nodes, failed Guards, disabled pass gates, and control inputs.

Use this page when a graph looks correct but a chain stops, queues, bypasses a node, or disappears as Invalid.

## Use When

* A Guard rejects and you need to know whether the chain should stop loudly or end as Invalid.
* A node is already running and a second chain reaches it.
* A control input such as Abort or Invalid appears to cancel a running chain.
* A BT leaf, Flow node, or subgraph behaves differently than expected after rejection.

## FlowInvokeMode (Node Busy)

FlowInvokeMode controls what happens when a node that can be busy receives another incoming chain.

| Value   | Meaning                         | Runtime outcome                                                            |
| ------- | ------------------------------- | -------------------------------------------------------------------------- |
| Abort   | Stop immediately.               | The incoming chain ends at that node.                                      |
| Queue   | Wait and resume in order.       | The incoming chain is delayed until the node is free.                      |
| Bypass  | Use the node's bypass behavior. | The node is skipped or an alternate output is used, depending on the node. |
| Invalid | Mark the branch invalid.        | The branch ends as Invalid without running the busy node.                  |

## FlowNodeRejectResult (Guard Reject)

FlowNodeRejectResult controls the return value when a Guard or node-level rejection fails.

| Value   | Meaning                          | Runtime outcome                                                    |
| ------- | -------------------------------- | ------------------------------------------------------------------ |
| Abort   | Reject ends execution.           | The chain ends at that Guard or rejecting node.                    |
| Invalid | Reject marks the branch invalid. | The branch ends as Invalid and can be interpreted by parent logic. |

## Where These Are Configured

| Place                                         | Setting                                        | What it affects                                                   |
| --------------------------------------------- | ---------------------------------------------- | ----------------------------------------------------------------- |
| Guard group                                   | Reject Result                                  | What the node returns when the Guard fails.                       |
| Nodes with busy behavior                      | FlowInvokeMode or node-specific invoke setting | What happens when another chain enters while the node is running. |
| Once, Gate, Gather Timeout, and similar nodes | Reject Result                                  | What the node returns when its own rule rejects.                  |
| Flow control inputs                           | Enable, Disable, Abort, Invalid                | Per-node pass state or cancellation of matching active chains.    |

## Examples

| Scenario                                                                   | Recommended mode | Why                                                                                    |
| -------------------------------------------------------------------------- | ---------------- | -------------------------------------------------------------------------------------- |
| A button can be pressed repeatedly, but the animation should finish first. | Queue or Bypass  | Queue preserves every press; Bypass ignores extra work.                                |
| A cutscene step must not overlap itself.                                   | Abort or Bypass  | Abort makes overlap visible as a stopped chain; Bypass keeps the graph calm.           |
| A Guard checks whether an optional target exists.                          | Invalid          | Invalid lets the branch end quietly when the optional target is absent.                |
| A Guard protects a required runtime object.                                | Abort            | Abort makes the missing requirement easier to notice while debugging.                  |
| A selector-style flow needs failed options to fall through.                | Invalid          | Invalid communicates "this branch did not match" rather than "the whole chain failed." |

## Control Inputs

Flow nodes with control inputs expose **Enable**, **Disable**, **Abort**, and **Invalid** in a dedicated control-port section. **BTRoot** exposes them as Flow control inputs. BT non-root nodes do not expose control inputs.

* **Enable** and **Disable** toggle the per-node **Pass Enabled** gate. They do not change the node's Enabled flag.
* When Pass Enabled is off, incoming chains end as **Invalid** and the node does not execute.
* On Flow nodes, **Abort** and **Invalid** control inputs cancel all matching active chains, then return their own result.
* A chain matches when the node is the chain Root, or when the node is the current executing node, including Wait.
* Matching also applies inside SubFlowGraph execution. Control inputs in subgraphs can cancel chains started within that subgraph runtime.
* If no active chain matches, the control input still returns Abort or Invalid, but no other chain is affected.
* Control inputs are non-flow signals. They apply side effects and return Invalid unless a node explicitly cancels the chain.

## Debugging Reads

| What you see                                              | Read it as                                                      | Check                                                           |
| --------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| The node is highlighted but the next node never runs.     | The chain may have returned Abort or Invalid.                   | Guard result, Reject Result, busy behavior, and control inputs. |
| A repeated event stops responding while a node is active. | The busy behavior may be Abort, Bypass, or Invalid.             | FlowInvokeMode and whether the node is still running.           |
| A branch ends without an error-looking signal.            | Invalid may be doing exactly what it is designed to do.         | Whether the branch is optional or expected to fall through.     |
| A control input cancels more than expected.               | Multiple active chains may match the same root or current node. | Chain root, current executing node, and Start New Chain usage.  |

## Constraints

* Bypass is node-specific. Some nodes skip work; others route to an alternate output.
* Invalid ends the current branch. It is intentionally quieter than Abort.
* BT leaf guards map Invalid to Success and Abort to Abort.
* Start New Chain works inside SubFlowGraph and creates an independent chain within the subgraph runtime.
* Node pages define the exact return mapping for each node.

## Related

* [Flow Node Kinds](/flow-core-docs/documentation/reference/flow-node-kinds.md)
* [Node Reference](/flow-core-docs/documentation/reference/nodes.md)
* [Lifecycle and Dataflow](/flow-core-docs/documentation/runtime-guide/lifecycle-and-dataflow.md)
* [Graph Debugging](/flow-core-docs/documentation/troubleshooting/graph-debugging.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://flow-core.gitbook.io/flow-core-docs/documentation/reference/invoke-and-reject-modes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
