Message Formatter
The Message Formatter step generates a plain text string using a Handlebars-like template, transforming structured data into a human-readable message.When to Use
- Format HTTP responses into chat-ready or user-friendly text.
- Create concise summaries without needing an LLM.
- Build consistent and deterministic responses for end-users.
Configuration
-
Template: A multiline text field where you define your message using Handlebars expressions (e.g.,
{{ ... }}).💡 Note: This template engine is based on Scriban, a powerful scripting language. You can leverage many of Scriban’s advanced features like piping and various syntax constructs to manipulate data within your template.
Input
The Message Formatter uses upstream data, referencing values viaInputs... or Steps.... This includes branch output if the formatter is placed within an If step.
Example Input:
Syntax
The message formatter’s templating engine is based on Scriban. This allows for powerful data manipulation beyond simple variable insertion. For example, to parse a JSON string from a step’s output and then access a field:Steps.CreateJSON.Output is treated as a string, then piped through the object.from_json filter to cast it into an object, and finally, the UserInput field is accessed.
Output Schema
The step outputs a single rendered string.Output: The generated plain text string after the template has been processed with the provided data.Success: A boolean indicating if the message was successfully formatted.
Example: “First Product” Message
This example demonstrates how to format details about a product fetched from a previousHTTP_Request step into a user-friendly message.
Template:
