We use cookies

We use cookies to ensure you get the best experience on our website. For more information on how we use cookies, please see our cookie policy.

By clicking "Accept", you agree to our use of cookies.
Learn more.

BlogMigrating from Mergent

Mergent Migration Guide

As Mergent sunsets its services, we’re here to help you seamlessly transition your background jobs and task processing to Hatchet, a modern, scalable platform for task orchestration in TypeScript, Python, and Go.

Why Choose Hatchet?

Hatchet offers a comprehensive solution for modern distributed task processing:

  • Powerful Task Orchestration: Build complex workflows using DAGs (Directed Acyclic Graphs) with intuitive code
  • Durable Execution: Reliable task processing with automatic retries and state persistence
  • Advanced Flow Control: Fine-grained control over concurrency, rate limits, and task priorities
  • Real-time Observability: Built-in monitoring dashboard and OpenTelemetry integration
  • Flexible Deployment: Run workers anywhere - from serverless to your own infrastructure
  • Developer-First Experience: Local development tools and straightforward debugging

Hatchet is trusted by F500s and startups for orchestrating AI, background jobs, and more.

Migration Steps

1. Setting Up Hatchet Client

First, install the Hatchet SDK to your project:

Create a virtual environment
Initialize the project and install the Hatchet SDK

Instantiate your Hatchet Client

It is recommended to instantiate a shared Hatchet Client in a separate file as a singleton.

Create a new file called hatchet-client.ts in your project root.

import { Hatchet } from "@hatchet-dev/typescript-sdk";
 
export const hatchet = Hatchet.init();

You can now import the Hatchet Client in any file that needs it.

import { hatchet } from "./hatchet-client";

2. Converting Mergent Tasks

Let’s look at an example of converting a Mergent task to Hatchet. We’ll use an image processing task as an example:

Before (Mergent)

After (Hatchet)

Key differences in the Hatchet implementation:

  • Type Safety: Hatchet provides built-in type validation using Pydantic/TypeScript/Go types
  • Step-based Execution: Tasks are broken down into atomic steps for better observability and retry control
  • Rich Metadata: Enhanced return types with additional metadata
  • Built-in Retries: Configurable retry policies at the task level
  • Timeout Control: Explicit timeout settings to prevent hung tasks

3. Migrating Task Triggers

In Mergent the primary way of triggering tasks was via the REST API or in the dashboard.

In Hatchet the primary way of triggering tasks is via the SDK. This offers a fully typed way to trigger tasks, with fully typed outputs of the task.

Before (Mergent)

After (Hatchet)

4. Converting Scheduled Tasks

In Mergent you could schedule tasks to run at a specific time using a cron expression or a fixed time via the dashboard or by adding a delay to the request body.

You can do the same in the Hatchet dashboard or programmatically using the SDK:

Before (Mergent)

After (Hatchet)

Worker Differences

In Mergent tasks are processed by an HTTP endpoint. In Hatchet there are two ways to process tasks:

  1. Long-Running Worker (recommended): Process tasks via a long-running worker a. Managed by Hatchet — fully integrated with the platform and automatically scales with your workload b. Self-hosted — use your own infrastructure to run the worker
  2. HTTP Endpoint: Process tasks via an HTTP endpoint via webhook support (V0 only, V1 coming soon)

Need help migrating? Our team is here to assist with your transition. Join our Discord community or reach out to support@hatchet.run

Next Steps