Skip to content

Runnable Executor

Runnable Executor is a tool that lets you run a pre‑built AI agent or chain inside your Nappai dashboard. You give it a piece of text, tell it which key to use for the input, and optionally which key to look for in the result. It then runs the agent and returns the answer so you can feed it to the next step in your workflow.

How it Works

The component takes an Agent Executor (a ready‑made AI routine) and a text Input. It builds a small dictionary that matches the executor’s expected input key. If you don’t know the exact key, the component will try to guess it from the executor’s own list of input keys. When you click “Run”, the executor is called asynchronously. The component looks for a common output key such as “answer”, “response”, or “output”. If it finds one, it shows that value; otherwise it shows whatever the executor returned. You can also enable Stream to receive the answer piece‑by‑piece as the model generates it.

Inputs

  • Agent Executor: The AI routine you want to run. It can be a Chain, Agent, AgentExecutor, or any Runnable object that knows how to process input and produce output. This field is required.
  • Input Key: The name of the key that the executor expects for the input value. If you’re unsure, leave the default “input”. This field is optional but helps the component match the input correctly.
  • Input: The text or data you want the executor to process. This field is required.
  • Output Key: The name of the key that contains the answer in the executor’s result. Common values are “output” or “answer”. This field is optional; the component will try to guess if you leave it blank.
  • Stream: Check this box if you want the answer to be streamed back in real time instead of waiting for the whole result. This is useful for long responses.

Outputs

  • Text: The component returns a Message object that contains the extracted answer (or the raw result if no key was found). You can connect this output to other components, display it in a dashboard widget, or log it for later use.

Usage Example

  1. Drag the Runnable Executor onto the canvas.
  2. Connect the output of a component that builds an AgentExecutor (for example, a “Create Agent” component) to the Agent Executor input.
  3. Type “Hello, world!” into the Input field.
  4. Leave Input Key and Output Key as their defaults.
  5. Click Run.
  6. The Text output will show the agent’s reply, which you can then feed into a “Display Text” component or store in a database.

If you enable Stream, the answer will appear gradually in the dashboard as the model generates it.

  • Create Agent – Build a new AgentExecutor that can be fed into Runnable Executor.
  • Display Text – Show the output of Runnable Executor on the dashboard.
  • Store Data – Save the returned text to a database or file.

Tips and Best Practices

  • Use the default Input Key (“input”) unless you know the executor expects a different name.
  • If the output looks empty, try changing Output Key to “answer”, “response”, or “output”.
  • Enable Stream for long responses to keep the UI responsive.
  • Keep the Input concise; very large inputs may cause timeouts.

Security Considerations

The component runs whatever code the AgentExecutor contains. Make sure the executor comes from a trusted source and does not expose sensitive data or perform unauthorized actions. If you’re using external APIs, verify that the API keys are stored securely in Nappai’s credential manager.