Skip to content

Connectors / General automation services · Connector

Add Custom Logic to Your Workflows with Merlin Functions

Run serverless custom functions inside your tray.ai automations without touching infrastructure.

What can you do with the Merlin Functions (Beta) connector?

Merlin Functions lets you run custom code and business logic inside your integration workflows, without giving up the speed of no-code automation. Need to transform a gnarly data structure, apply your own business rules, or call an internal API? You can do all of that natively in tray.ai, without duct-taping in a separate service. For teams that keep bumping against the limits of standard connectors, Merlin Functions is the escape hatch.

Automate & integrate Merlin Functions (Beta)

Automating Merlin Functions (Beta) business processes or integrating Merlin Functions (Beta) data is made easy with Tray.ai.

Use case

Custom Data Transformation and Enrichment

When data flowing between systems doesn't match the expected format, you can write and execute custom transformation logic on the fly. Parse complex JSON payloads, reformat date strings, normalize field naming conventions, or merge datasets from multiple sources — no clunky workarounds needed. Your downstream systems stay clean and consistent without a separate ETL tool.

  • Eliminate manual data reformatting between incompatible systems
  • Apply proprietary normalization rules not supported by standard connectors
  • Process nested or complex data structures with full programmatic control

Use case

Dynamic Business Rules Execution

Most organizations have business logic that's too context-sensitive for a standard connector — routing decisions, approval thresholds, pricing tiers, eligibility checks. You can encode these rules as executable functions that run in real time as part of an automated workflow, so your integration logic stays in sync with how your business actually works.

  • Encode custom eligibility, routing, or scoring logic directly in workflows
  • Update business rules independently of workflow structure
  • Support conditional branching based on multi-variable calculations

Use case

Internal API and Microservice Calls

Most enterprises have internal APIs or microservices that'll never get a dedicated tray.ai connector. Merlin Functions lets you write custom HTTP calls or SDK invocations to interact with these internal services, making them full participants in your automation workflows. No more waiting for a connector that may never come.

  • Integrate proprietary internal APIs without building a custom connector
  • Access internal microservices as workflow steps
  • Authenticate and interact with legacy systems using custom code

Use case

Advanced String and Text Processing

Workflows that handle unstructured text — parsing email bodies, extracting fields from documents, cleaning user-generated content — often need logic that standard string utilities can't touch. You can apply regex, NLP preprocessing, or custom parsing algorithms to text data mid-workflow, making it practical to work with unstructured information at scale.

  • Apply regex and custom parsing to extract structured data from text
  • Preprocess text for downstream AI or NLP workflows
  • Sanitize and validate user-generated content before storage

Use case

Cryptographic Operations and Security Transformations

Sometimes a workflow needs to sign a payload, verify a webhook, hash a sensitive field, or encrypt data before it reaches a third-party service. Merlin Functions gives you an environment to run these cryptographic operations securely and programmatically, without routing data through an external service. For teams with real compliance obligations, that matters.

  • Sign and verify webhook payloads using HMAC or other algorithms
  • Hash or encrypt sensitive fields before storing or transmitting data
  • Perform token generation and validation within secure workflow steps

Use case

Custom Aggregation and Reporting Logic

Automated reporting pipelines often need to aggregate, group, or calculate metrics in ways that standard connectors don't support. You can implement custom aggregation logic, compute weighted averages, run statistical summaries, or build scoring models directly in the workflow before results go to a dashboard or database.

  • Compute custom KPIs and metrics not available in standard connectors
  • Aggregate and group large datasets before writing to reporting destinations
  • Build reusable scoring or ranking functions across multiple workflows

Ready to solve your Merlin Functions (Beta) integration challenges?

See how Tray.ai makes it easy to connect, automate, and scale your workflows.

Challenges Tray.ai solves

Common obstacles when integrating Merlin Functions (Beta) — and how Tray.ai handles them.

Challenge

Going Beyond Standard Connector Capabilities

No matter how many connectors a platform offers, your specific business logic, data format, or internal system will eventually fall outside what's available. Teams often end up building and maintaining separate microservices just to fill these gaps, which adds real operational overhead and something new to keep alive.

How Tray.ai helps

Merlin Functions lets you embed custom executable logic directly into tray.ai workflows, so you're not spinning up external microservices or inventing workarounds. Developer-grade flexibility lives in the same platform as your automations.

Challenge

Maintaining Security During Data Transformation

When sensitive data — PII, financial records, credentials — flows through integration pipelines, applying encryption, hashing, or signing without routing it through additional external services is genuinely hard. Every extra service is another attack surface and another thing to audit.

How Tray.ai helps

With Merlin Functions, cryptographic and security operations run as native workflow steps inside tray.ai. Sensitive data stays in a controlled, auditable environment without needing an external service to handle security transformations.

Challenge

Keeping Business Logic in Sync with Workflows

Business rules change constantly, but when that logic is hardcoded into workflow configurations, every rule change means a workflow update. That creates bottlenecks for non-technical teams and quietly introduces drift between what the business intends and what the automation actually does.

How Tray.ai helps

Merlin Functions lets you encapsulate business logic as versioned, reusable functions that update independently of the workflow structure. Rule management and workflow design stop being tangled together.

Templates

Pre-built Merlin Functions (Beta) workflows you can deploy in minutes.

Webhook Signature Verification and Routing

M
Merlin Functions (Beta)
W
Webhook Trigger
Slack Slack

Automatically verify incoming webhook payloads using a custom HMAC signature check in Merlin Functions, then route verified events to the correct downstream workflow or reject invalid ones.

CRM Data Normalization Before Salesforce Sync

M
Merlin Functions (Beta)
Salesforce Salesforce
HubSpot HubSpot

Run raw contact data from web forms or third-party sources through a Merlin Functions normalization step to standardize phone numbers, names, and addresses before creating or updating records in Salesforce.

AI Agent with Custom Internal API Tool

M
Merlin Functions (Beta)
T
tray.ai AI Agent
Slack Slack

Build an AI agent that uses Merlin Functions as a callable tool to query an internal inventory or pricing API, so the agent can answer questions or make decisions based on real-time internal data.

Automated Report Generation with Custom Metrics

M
Merlin Functions (Beta)
Google Sheets Google Sheets
SendGrid SendGrid

Pull raw activity data from multiple sources, compute custom business metrics using Merlin Functions, and automatically deliver a formatted report to a Google Sheet or email distribution list.

Sensitive Field Encryption Before Database Write

M
Merlin Functions (Beta)
PostgreSQL PostgreSQL
AWS S3 AWS S3

Intercept records containing personally identifiable information, apply field-level encryption using Merlin Functions, and write only the encrypted values to a downstream database or data warehouse.

Text Extraction and NLP Preprocessing for AI Pipelines

M
Merlin Functions (Beta)
Gmail Gmail
OpenAI OpenAI

Process incoming documents or email bodies through Merlin Functions to extract structured fields, clean text, and prepare it for downstream AI enrichment or classification workflows.

See Merlin Functions (Beta) working against your stack.

We'll walk through a tailored demo with your systems plugged in.