> For the complete documentation index, see [llms.txt](https://docs.rewst.help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rewst.help/rewst-documentation/documentation/automations/automation-assets-templates-and-scripts.md).

# Automation assets: Templates and scripts

{% hint style="info" %}
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.
{% endhint %}

<figure><img src="https://3039672601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh0G0em3PH6aDfPoI5XpN%2Fuploads%2FatNK7ADCBWBrAMk7Cypg%2FScreenshot%202026-08-11%20at%202.17.33%E2%80%AFPM.png?alt=media&amp;token=0ccaf05f-505c-416e-a8a4-7c0a75d313a3" alt=""><figcaption><p>The Automation Assets menu, with saved assets inside its library</p></figcaption></figure>

## 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

{% hint style="info" %}
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.
{% endhint %}

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.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.rewst.help/rewst-documentation/documentation/automations/automation-assets-templates-and-scripts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
