Liquid Template

Processes a Liquid template with the provided data

Overview

This node processes a Liquid template using provided data, allowing dynamic content generation based on input or custom JSON data. It is useful for scenarios where templated text or structured output needs to be generated dynamically, such as creating personalized messages, generating HTML or JSON snippets, or formatting data for further processing.

Use Case Examples

  1. Generating personalized email content by rendering a template with user data from the input item.
  2. Creating custom JSON structures by rendering templates with static or dynamic data.
  3. Formatting output messages or reports by applying Liquid templates to input data.

Properties

Name Meaning
Template The Liquid template string to be rendered, which can include placeholders for dynamic data.
Data Source Specifies the source of data for the template, either from the input item or custom JSON data provided by the user.
Custom Data Custom JSON data to be used for template variables when 'Custom Data' is selected as the data source.
Output Key The key under which the rendered template will be stored in the output JSON object.
Keep Input Data Determines whether to keep the original input data and add the rendered template to it, or to return only the rendered template in the output.

Output

JSON

- The rendered Liquid template string stored under the user-defined output key.

  • error - Error message if template rendering fails (present only on error).
  • success - Boolean flag indicating success status of the template rendering (false on error).

Dependencies

  • liquidjs library for parsing and rendering Liquid templates

Troubleshooting

  • Common issues include syntax errors in the Liquid template causing rendering failures.
  • Invalid JSON format in custom data input can cause parsing errors.
  • If the output key is not set correctly, the rendered template may not appear in the expected output location.

Discussion