Custom Processors: Create Your Own Code

Created by Brian Glick, Modified on Tue, 4 Nov at 11:48 AM by Brian Glick

Custom processors are JavaScript scripts that run within your Chain.io flows to transform, validate, and enrich your data. They allow you to implement custom business logic without requiring external servers or complex integrations.


Key Benefits

  • No Infrastructure Required - Runs securely in Chain.io's cloud environment
  • Real-time Processing - Transform data as it flows through your integration
  • Flexible Data Transformation - Handle JSON, CSV, XML, and Excel files
  • Built-in Libraries - Access to popular JavaScript libraries like Lodash, Luxon, and SheetJS
  • ?AI Code Assistant - Describe your challenge in plain English and get automatically generated code


When to Use Custom Processors

Custom processors are perfect for:

  • ? Data Transformation

    • Format Conversion - JSON ↔ CSV ↔ XML ↔ Excel

    • Field Mapping - Make simple field adjustments like moving a single value.  For more complex mappings check out our Custom Mapping tool

    • Data Enrichment - Add calculated fields, timestamps, or lookups

  • Data Validation & Quality

    • Required Field Checks - Ensure critical data is present

    • Format Validation - Verify emails, phone numbers, dates
      - Conditional Processing - Skip processing for irrelevant files or based on values like mode of transportation

Types of Custom Processors

  • Pre-processors - Transform data before it goes through Chain.io's main processing
  • Post-processors - Transform data after Chain.io processes it but before final delivery


Getting Started

For complete documentation, examples, and best practices, visit our comprehensive guide:

Chain.io Custom Processor Examples Repository


This repository includes:

  • ? Quick Start Guide - Get up and running in 5 minutes
  • ? Real-world Examples - Production-ready processors you can use immediately
  • ? Complete Documentation - Everything from basic concepts to advanced techniques
  • ?️ Best Practices - Proven patterns from the Chain.io community
  • ? Troubleshooting Guide - Solutions to common issues


?AI Tips

  • Keep it simple - Need to convert an Excel sheet to CSV then replace a value, try prompting to do the conversion, accept that change, then prompt again for the value replacement
  • Ask it to handle common errors - AI will notice potential failure points and make your flows more resilient, "Find potential failures in my code and put in error checking with log messages"
  • Explain complex processors  - Understand a complex processor that someone else built, "Don't change the code, just tell me what it does in simple business terms."

Need Help?

  1. Start with the repository - Most questions are answered in the comprehensive documentation
  2. Review the examples - See real-world implementations for common use cases
  3. Contact Support - For specific technical issues or custom requirements


The repository is actively maintained and includes contributions from the Chain.io community, making it your best resource for custom processor development.

 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article