Run Agent
Controlled node
Overview
The Run Agent node runs a streaming AI conversation when it receives an action whose type is userMessage. It reads any existing messages from a named workflow variable, appends the user message, generates a response, writes the updated history back to that variable, and emits streaming updates while generation is in progress.
All model-tier choices currently use KIMI_K2_6. The two non-reasoning tiers disable reasoning; intermediate reasoning uses medium effort and advanced reasoning 2 uses high effort.
The editor exposes Tools and the backend contains partial tool-call states, but the tools input is not currently passed to the model and the tooling state has no implementation. Do not build a production tool loop around this node until that path is completed and tested.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Invokes the node's state machine. | - |
| Variable | Text | Path of the workflow variable used to read and persist conversation messages. If omitted, messages are not persisted. | - |
| System Prompt | Text | Instructions prepended to the conversation sent to the model. | You are a helpful assistant. |
| Action | Data | An action object. userMessage starts generation; the toolApprove and toolDeny paths are incomplete. | - |
| Tools | Data | Reserved for agent tool definitions. The current backend reads this input but does not pass it into generation. | - |
| Model | Enum | Reasoning tier: ultraLight, standard, intermediateReasoning, or advancedReasoning2. | standard |
| Max Tokens | Number | Maximum generated tokens. Non-numeric values fall back to 5000. | 5000 |
| Temperature | Number | Sampling temperature. Non-numeric values fall back to 0.7. | 0.7 |
Outputs
| Output | Type | Description |
|---|---|---|
| Message Stream | Data | Accumulated generated content during streaming. The final streaming update is the accumulated result object. |
| Stream | Event | Fires as streamed content is accumulated and once more after the generation queue is drained. |
| Tool | Event | Intended to fire when a model tool call needs handling. The surrounding tool workflow is incomplete. |
| Tool Call | Data | The first pending tool-call object, when the model returns one. |
| Tool | Data | Backend-only approved tool-call value; the current editor does not draw a separate data socket for it. |
| Messages | Data | Updated conversation history after a generation completes without a pending tool call. |
| Done | Event | Fires after successful generation when there is no pending tool call. It is conditional while the node repeats or suppresses completion. |
Runtime behavior
- In the idle state, a
userMessageaction is appended to the selected message variable. - The node starts a streaming request and repeats across workflow ticks while chunks arrive.
- Message Stream and Stream update during generation.
- When generation finishes, the assistant message is appended to the history and Messages is set.
- If there is no pending tool call, Done fires and the node returns to idle.
Generation errors are recorded internally, but the current error branch does not expose an error output or reset the state. Treat missing completion as a failure condition in workflows that use this node.
Example
For the currently implemented basic-chat path:
- Create a workflow variable such as
chatHistorycontaining an empty array. - Set Variable to
chatHistory. - Send
{ "type": "userMessage", "data": "Hello" }to Action and trigger Run. - Use Message Stream with the Stream event for live display.
- Read Messages after Done to obtain the persisted conversation history.