writing-scripts
Installation
SKILL.md
Writing Scripts
A script is a JavaScript function that runs at a specific hook point in the Celigo data pipeline. Scripts handle logic that expressions, filters, and visual mappings cannot -- complex conditionals, cross-record calculations, API calls within the pipeline, and custom routing.
Concerns when writing a script:
- Choosing the right hook point -- which function type matches what you're trying to accomplish
- Input/output contracts -- what
optionscontains and what the function must return (array length rules are strict) - Expression alternative -- filter, transform, and output filter have expression-based alternatives that don't require a script; prefer expressions when possible
- Available modules -- scripts can
importthree built-in modules:integrator-api(call Celigo APIs),dayjs(date/time manipulation), andsjcl(Stanford JavaScript Crypto Library for hashing/encryption) - One script, many functions -- a single script resource can contain multiple exported functions, each wired independently to different hook points
Used across flows, APIs, and tools.
Hook Points
Every script function runs at a specific point in the pipeline. Choose based on when you need to act and what data you need access to.