Skip to content

Chat Output

Chat Output is a simple block that lets you create and display a chat message right inside your Nappai workflow. You type the text you want to show, choose who is speaking (the machine or a user), and the component will create a message object that can be sent to other parts of the system or displayed in the Playground.

How it Works

When you run the workflow, the component takes the values you entered in the input fields and builds a Message object.

  • The text of the message comes from the Text field.
  • The sender (either “Machine” or “User”) and the sender name (default “AI”) are stored so that other components know who said what.
  • If you provide a Session ID or Conversation ID, the message is saved in the internal message store so it can be retrieved later.
  • The Data Template field is kept for future use; if you leave it empty, the system will automatically use the text key of any data you pass in.

No external APIs are called – everything happens locally inside the Nappai engine.

Inputs

  • Conversation ID: Conversation ID for the message.
  • Data Template: Template to convert Data to Text. If left empty, it will be dynamically set to the Data’s text key.
  • Text: Message to be passed as output.
  • Sender Type: Type of sender. Choose “Machine” or “User”.
  • Sender Name: Name of the sender. Default is “AI”.
  • Session ID: Session ID for the message.

Outputs

  • Message: A Message object that contains the text, sender information, and optional session/conversation identifiers. This output can be connected to other components that need to read or display the message.

Usage Example

  1. Drag a Chat Output block into your workflow.
  2. In the Text field, type “Hello, how can I help you today?”
  3. Leave Sender Type as “Machine” and Sender Name as “AI”.
  4. (Optional) Enter a Session ID like session_123 if you want the message to be stored.
  5. Connect the Message output to a Display component or any other block that consumes messages.

When the workflow runs, the message will appear in the Playground with the AI icon and the text you entered.

  • Chat Input – Capture user messages from the Playground.
  • Message Store – Persist messages for later retrieval.
  • Display – Show messages in a custom UI panel.

Tips and Best Practices

  • Use Session ID to group messages that belong to the same user interaction.
  • Keep Sender Type consistent: “Machine” for system replies, “User” for user inputs.
  • If you plan to use dynamic data, set Data Template to something like {text} so the component can automatically pull the text from incoming data.
  • Connect the Message output to a Message Store if you need to keep a history of the conversation.

Security Considerations

The component stores messages only in Nappai’s internal memory. No external network calls are made, so there is no risk of leaking data outside the system. However, be mindful of the content you store if it contains sensitive information; consider adding encryption or access controls at the workflow level.