Create reusable templates for tool actions with dynamic variables, rich formatting, and powerful automation capabilities.
Tool Action Templates allow you to create reusable configurations for your tool actions (Slack messages, Discord embeds, emails, etc.). Templates support Handlebars syntax for dynamic content, rich formatting with Monaco editor for JSON/HTML, and can be shared across events and workflows.
Save and reuse common tool action configurations across events
Monaco editor with syntax highlighting for JSON and HTML fields
Handlebars variables for event data, conditions, and runtime values
Tool Action Templates are pre-configured settings for specific tool actions that can be quickly applied when creating events or conditional actions. Each template is associated with a specific tool (Slack, Discord, Email, etc.) and action type (send message, create channel, etc.).
Each template contains the following elements
A descriptive name to identify the template (e.g., "Event Success Notification")
Optional details about when and how to use the template
The specific tool and action type this template is for
Pre-filled values for the action parameters, including Handlebars variables
Templates support Monaco editor for complex content
When creating templates, certain fields automatically use the Monaco editor:
Templates can be created and managed from the Tools page in your dashboard. Navigate to Tools → Templates in your Cronium app to get started.
Follow these steps to create a new tool action template
Select Tool and Action
Choose the tool (Slack, Discord, etc.) and the specific action type
Name Your Template
Give it a descriptive name like "Daily Report" or "Error Alert"
Configure Parameters
Fill in the action parameters, using Handlebars variables where needed
Preview and Save
Preview how your template will look and save it for future use
Templates can be applied when creating events with tool actions or when setting up conditional actions in workflows.
Use templates when creating tool action events
Apply templates in workflow conditional actions
Cronium templates use standard Handlebars syntax with the cronium namespace to access runtime data and context variables.
Access event data using the cronium namespace
{{cronium.event.name}}
{{cronium.event.status}}
{{cronium.event.duration}}
{{cronium.event.executionTime}}Use dot notation to access nested properties in the cronium context.
Show content based on conditions
{{#ifEquals cronium.event.status "success"}}
✅ Event completed successfully!
{{else}}
❌ Event failed or encountered errors.
{{/ifEquals}}
{{#if cronium.event.output}}
Output: {{cronium.event.output}}
{{/if}}Use built-in helpers for conditional rendering based on event data.
Access nested properties safely with fallbacks
{{get cronium.getVariables "database.host" "localhost"}}
{{get cronium.input "user.name" "Unknown User"}}
{{get cronium.event "server" "Local"}}Use the get helper to safely access nested properties with default values.
Templates have access to a rich context of runtime data through the cronium namespace. All data is automatically populated based on the current event execution.
Current event execution details
User-defined variables from the Variables system
{{cronium.getVariables.example_api_key}}
{{cronium.getVariables.database_url}}
{{get cronium.getVariables "config.timeout" "30"}}Access variables created through the Variables system in user settings.
Input data passed to the event (workflow context)
{{cronium.input.user_id}}
{{cronium.input.message}}
{{get cronium.input "config.retries" "3"}}Data passed from workflow nodes or API calls to the current event.
Custom conditions set by cronium.setCondition()
{{#if cronium.getCondition.data_valid}}
Data validation passed
{{/if}}
{{#ifEquals cronium.getCondition.environment "production"}}
Running in production mode
{{/ifEquals}}Boolean conditions set during script execution using cronium.setCondition().
Cronium provides built-in Handlebars helpers for common formatting, conditional logic, and safe data access operations.
Safe property access with optional fallback values
{{get cronium.event "output" "No output available"}}
{{get cronium.getVariables "database.port" "5432"}}
{{get cronium.input "user.email" "unknown@example.com"}}Parameters: object, path, fallback (optional)
Conditional rendering based on value equality
{{#ifEquals cronium.event.status "success"}}
🎉 Success message
{{else}}
⚠️ Error or failure message
{{/ifEquals}}Parameters: value1, value2
Format milliseconds into human-readable duration
Duration: {{formatDuration cronium.event.duration}}
<!-- Output: "2.5s", "1.2m", "45ms", etc. -->Converts milliseconds to readable format (ms, s, m, h)
Format ISO timestamps into readable dates
Started: {{formatTime cronium.event.executionTime}}
<!-- Output: "12/27/2024, 2:30:45 PM" -->Converts ISO timestamp to localized date/time string
Convert objects to formatted JSON (useful for debugging)
Debug info: {{json cronium.input}}
Variables: {{json cronium.getVariables}}Outputs pretty-printed JSON for complex objects
Dynamic property access using variables
{{lookup cronium.getVariables "example_api_key"}}
{{lookup cronium.event "status"}}Access object properties using dynamic field names
Here are practical examples of templates for different communication tools and use cases.
HTML email template for event notifications
<h2>{{#ifEquals cronium.event.status "success"}}✅{{else}}❌{{/ifEquals}} Event: {{cronium.event.name}}</h2>
<p><strong>Status:</strong> {{cronium.event.status}}</p>
<p><strong>Duration:</strong> {{formatDuration cronium.event.duration}}</p>
<p><strong>Started:</strong> {{formatTime cronium.event.executionTime}}</p>
{{#if cronium.event.server}}
<p><strong>Server:</strong> {{cronium.event.server}}</p>
{{/if}}
{{#if cronium.event.output}}
<h3>Output:</h3>
<pre>{{cronium.event.output}}</pre>
{{/if}}
{{#if cronium.event.error}}
<h3>Error Details:</h3>
<p style="color: red;">{{cronium.event.error}}</p>
{{/if}}JSON Block Kit template for Slack notifications
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "{{#ifEquals cronium.event.status 'success'}}✅{{else}}❌{{/ifEquals}} {{cronium.event.name}}"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Status:* {{cronium.event.status}}"
},
{
"type": "mrkdwn",
"text": "*Duration:* {{formatDuration cronium.event.duration}}"
},
{
"type": "mrkdwn",
"text": "*Started:* {{formatTime cronium.event.executionTime}}"
}{{#if cronium.event.server}},
{
"type": "mrkdwn",
"text": "*Server:* {{cronium.event.server}}"
}{{/if}}
]
}{{#if cronium.event.output}},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Output:*
```{{cronium.event.output}}```"
}
}{{/if}}
]
}JSON embed template for Discord webhooks
{
"embeds": [
{
"title": "{{cronium.event.name}}",
"color": {{#ifEquals cronium.event.status "success"}}65280{{else}}16711680{{/ifEquals}},
"fields": [
{
"name": "Status",
"value": "{{cronium.event.status}}",
"inline": true
},
{
"name": "Duration",
"value": "{{formatDuration cronium.event.duration}}",
"inline": true
},
{
"name": "Started",
"value": "{{formatTime cronium.event.executionTime}}",
"inline": true
}{{#if cronium.event.server}},
{
"name": "Server",
"value": "{{cronium.event.server}}",
"inline": true
}{{/if}}{{#if cronium.event.output}},
{
"name": "Output",
"value": "```{{cronium.event.output}}```",
"inline": false
}{{/if}}
],
"timestamp": "{{cronium.event.executionTime}}"
}
]
}Cronium provides two types of templates: system templates managed by administrators and user templates that you can create and customize.
Pre-built templates managed by administrators
Custom templates created by individual users
Manage your templates in the Tools → Templates section of your dashboard. Filter by tool and action type to organize your templates effectively.
Use descriptive template names
Make templates easy to identify and select
Include relevant context
Add event name, status, and timing information
Use conditional blocks
Show different content for success vs failure
Provide fallback values
Use the get helper with defaults for optional data
Missing fallbacks
Always provide defaults for optional properties
Invalid JSON in Slack/Discord
Validate JSON syntax before saving templates
Hardcoded values
Use variables and context data instead of static text
Overly complex templates
Keep templates simple and focused on essential information