writing-scripts

Implement Celigo JavaScript hook functions for pipeline control and routing with strict I/O contracts.

3|2|Updated May 20, 2026
One-click install
npx skills add https://github.com/celigo/ai --skill writing-scripts-celigo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-scripts
Source: https://github.com/celigo/ai/tree/main/skills/writing-scripts
Command: npx skills add https://github.com/celigo/ai --skill writing-scripts-celigo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It solves the problem of implementing complex pipeline logic in Celigo when expressions, filters, and mappings are not sufficient, especially when you need precise control over when and how records are processed.

Core Features & Use Cases

  • Choose the correct hook point: preSavePage, preMap, postMap, postSubmit, postResponseMap, filter/transform, branching, handleRequest, and contentBasedFlowRouter.
  • Implement strict input/output contracts: write batch-return functions that match array length rules and return per-record error shapes safely.
  • Add real execution capabilities: use built-in modules like integrator-api for Celigo API calls, dayjs for date/time logic, and sjcl for hashing/encryption.
  • Debug and iterate: validate behavior with Celigo script debug logs and align hook wiring to the correct resource (export/import/flow/router/API).

Quick Start

Create a Celigo script that implements a record filter and wire it to your export step at the filter hook.

Frequently Asked Questions about writing-scripts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write JavaScript hook scripts for Celigo data pipelines?

To write Celigo JavaScript hook scripts, implement specific hook functions like preMap or postSubmit that control data pipeline execution and routing. You must respect strict batch array length matching and return structured errors instead of throwing exceptions.

When should I use JavaScript hooks instead of expressions in Celigo integrations?

Use JavaScript hooks in Celigo integrations when expression-based configuration is insufficient for your logic. Hooks provide precise control over export and import preprocessing, batch post-processing, and flow-level response post-mapping scenarios.

What Celigo hook points are available for custom JavaScript data routing?

Available Celigo hook points for custom JavaScript routing include preSavePage, preMap, postMap, postSubmit, postResponseMap, filter/transform, branching, handleRequest, and contentBasedFlowRouter for AS2 content-based routing scenarios.

Can I use external modules like dayjs and sjcl in Celigo hook scripts?

Yes, you can use approved built-in modules like integrator-api for Celigo API calls, dayjs for date and time logic, and sjcl for hashing and encryption within your hook scripts to add real execution capabilities.

How do I debug JavaScript hook logic in Celigo integrator-api scripts?

Debug Celigo JavaScript hook logic by validating behavior with Celigo script debug logs. Ensure your hook wiring aligns with the correct resource type, such as export, import, flow, router, or API request handling.