# Flow Execution

A Contextual agent is the host process for the execution of a Node-RED flow. Node-RED runs on a single-threaded event loop (like Node.js) but can handle multiple concurrent operations through non-blocking asynchronous callbacks.

However, the Agent-type (HTTP or Event) determines whether multiple requests can be handled concurrently. HTTP agents can handle multiple concurrent operations, but Event agents handle one message at a time received from the message service.

While the agent process hosts the Node-RED flow, it also interfaces to other Contextual services such as the logging service. This allows you to use Log-tap nodes in your flows which emit data which is then sent to the logging service by the Agent.

Similarly, it is the agent software outside of Node-RED that receives incoming events and injects them into the flow at the apporpriate input node.

And while you can catch errors within your flow using a Catch Node, the agent itself will catch any uncaught errors and log them to the logging service, allowing you to further diagnose problems with your flows.


---

# 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://docs.contextual.io/documentation-and-resources/components-and-data/agents/how-agents-work/flow-execution.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.
