> For the complete documentation index, see [llms.txt](https://docs.contextual.io/documentation-and-resources/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.contextual.io/documentation-and-resources/components-and-data/agents/types-of-agents/event-to-flow.md).

# Event to Flow

**Event to Flow** agents receive asynchronous events and use the configured flow to process the event. For this type of agent, the flow must contain at least one "Event Start" node and one or more "Event End" and/or "Event Error" nodes.

**Event Start Nodes** — The event start node in a flow is considered an "entry point" in the flow where the execution of the event begins. A single flow can actually have multiple event start nodes, and the agent itself it configured to tell the runtime which event start node should be used for that specific agent.

**Event End Nodes** — Because Contextual flows can process events asynchronously within the flow itself, they have the ability to handle multiple data streams through the same logic concurrently, or to branch off and process the same data in various ways at the same time.

Given this capability, it is crucial that these flows include a clearly defined "Event End" node. This "Event End" node indicates to the runtime environment that the flow execution has been completed. This ensures that all processing paths within the flow are properly terminated and that resources are efficiently managed.

**Event Error Nodes —** Similarly, an "Event Error" node signals that an error has occured in the processing of the flow. Like the Event End node, the Event Error node also terminates the execution of the flow. However when a flow terminates on an Event Error node, the logs for the execution of the flow are categories as an "error" so that they can be easily found and analyzed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.contextual.io/documentation-and-resources/components-and-data/agents/types-of-agents/event-to-flow.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
