Why scripts are useful
Visual workflow blocks handle many tasks, but scripts are useful when you need custom formatting, filtering, calculations, or data cleanup.
- Keep scripts short.
- Use clear variable names.
- Return structured data for the next step.
Transforming data
A common script takes incoming JSON, selects the fields that matter, normalizes names or dates, and creates a clean object for later actions.
- Check for missing fields.
- Normalize text before comparing it.
- Avoid changing the original data unexpectedly.
Handling errors
Scripts should fail clearly. If a required value is missing, the workflow should know whether to stop, retry, or ask for human review.
- Validate before transforming.
- Use helpful error messages.
- Do not log secrets or private content unnecessarily.