Skip to content
Back to Knowledge Base

How to Use Scripts

Scripts are reusable Lua functions callable from Workflows, Custom Actions, and Custom Apps. They encapsulate logic you want to share across multiple Workflows.

RoleUse case
ScriptGeneral-purpose Lua, called from Workflow Script nodes
JDF TemplateGenerates JDF job tickets for press equipment
JMF TemplateGenerates JMF messages for machine communication
ML Data QueryReturns training data for ML model training
  1. Go to Menu → Developer → Scripts
  2. Click + New Script
  3. Enter a Name and select the Role
  4. Write the Lua code in the editor
  5. Click Save

Add a Script node, select the saved Script, and map input variables from the Workflow context. The return value is the node output.

-- Calculates a priority score from values passed into the script
local remaining_days = input.remaining_days or 0
local weight = input.tier == "premium" and 2 or 1
return math.max(0, (10 - remaining_days) * weight)