Automation assets: Templates and scripts

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
Navigate to Automation Assets in the left side menu of your Rewst platform.
Click + to the right of the Assets header.
Choose the type of template or script you wish to create from the selector menu that appears.
Click Properties.
Fill in the relevant fields with the information for your template.
Name
Description
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
Click Save Properties.
Enter your desired scripting into the code editor.
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?
