For the complete documentation index, see llms.txt. This page is also available as Markdown.

Automation assets: Templates and scripts

Templates and scripts are similar features in Rewst, though each is intended for a different purpose. Once created, they're separated by type into two sections in the platform for ease of organization and sorting. Both can be referenced in workflows.

To access both, navigate to Automations Assets in the left side menu of your Rewst platform.

If your automation requires a script, the Rewst Agent can write it for you. We don't recommend writing your own scripts manually unless you have previous in-depth experience with coding your own scripts.

The Automation Assets menu, with saved assets inside its library

What is a template?

Templates are used to create a standardized set of text used in several places in Rewst. For example, if you want to create a ticket and always use the same HTML for the ticket description, you would create a template. In the input, you would reference the template instead of having to type that same text each time.

Write templates in Jinja, Markdown, HTML, JavaScript, CSS, XML, JSON, or YAML language. Common examples of templates include:

Jinja templates

  • Data transformations - Manipulating and formatting data between workflow tasks

  • Dynamic field values - Creating dynamic inputs for action parameters

  • Conditional logic - Building expressions for transitions and decision-making

  • Text/message generation - Formatting emails, tickets, notifications, etc.

  • List/dictionary comprehensions - Processing collections of data

Workflow templates

  • Task configurations and parameters

  • Transition logic between tasks

  • Error handling patterns

  • Sub-workflow integration

  • With-items (loop) configurations

Trigger configuration templates

  • Webhook triggers

  • Scheduled/cron triggers

  • Integration-specific triggers - e.g., ticket creation, form submission

App Builder templates

  • Component configurations

  • Data binding expressions

  • Workflow integrations for apps

Write templates in either Markdown or HTML language.

What is a script?

Scripts in Rewst enable you to write scripts in a straightforward and accessible manner compared to traditional programming languages. Scripting tasks can range from batch processes on a local computer to generating dynamic web pages on a web server. Scripts can be written, edited, and executed more quickly and easily than software programs.

Write Rewst scripts in any of the following languages: PowerShell, Python, Bash, Jinja. All scripts are assigned a unique URL (GUID).

Create a template or script

Once a template or script is created, it will appear in your Automation Assets menu, as part of the Automation Assets Library. You may then call that asset from actions that use them in their configuration fields. Note that the template or scripy must exist before calling it from an action. If you have the Rewst Agent build for you, it will take care of the order of operations, and build both as needed.

  1. Navigate to Automation Assets in the left side menu of your Rewst platform.

  2. Click + to the right of the Assets header.

  3. Choose the type of template or script you wish to create from the selector menu that appears.

  4. Click Properties.

  5. Fill in the relevant fields with the information for your template.

    1. Name

    2. Description

    3. Slug - This won't automatically change when you update the name of the asset and will need to be manually adjusted if name changes are made

  6. Click Save Properties.

  7. Enter your desired scripting into the code editor.

  8. Click Save when finished.

Jinja: Use templates and scripts within workflows

While templates and scripts are written in HTML or Markdown, they can accept small elements of the language Jinja to set up elsewhere in Rewst. They allow for context variables to be set within them, which can then be referenced in workflows to allow the eventual sent message to populate with dynamic information.

Jinja uses curly braces— {}— to contain values. When scripting, data can be placed within these braces to manipulate and pipe the value into your script. If this is necessary, the Rewst Agent can do this work for you.

Last updated

Was this helpful?