Convert Figma logo to code with AI

temporalio logotemporal

Temporal service

11,289
810
11,289
476

Top Related Projects

8,171

Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way.

12,835

Conductor is a microservices orchestration engine.

36,173

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows

15,793

Prefect is a workflow orchestration framework for building resilient data pipelines in Python.

11,125

An orchestration platform for the development, production, and observation of data assets.

Workflow Engine for Kubernetes

Quick Overview

Temporal is an open-source microservices orchestration platform for building scalable and reliable applications. It provides a programming model and runtime for writing and executing long-running business logic, workflows, and distributed transactions. Temporal aims to simplify the development of complex, distributed systems by handling many of the challenges associated with state management, fault tolerance, and scalability.

Pros

  • Durable execution: Workflows are resilient to failures and can resume from where they left off
  • Language-agnostic: Supports multiple programming languages (Go, Java, PHP, TypeScript)
  • Scalability: Designed to handle high-throughput and large-scale applications
  • Visibility: Provides built-in tools for monitoring and debugging workflows

Cons

  • Learning curve: Requires understanding of new concepts and programming model
  • Complexity: Can be overkill for simple applications or small-scale projects
  • Infrastructure requirements: Needs a dedicated cluster and database for production use
  • Limited ecosystem: Fewer third-party integrations compared to some other orchestration tools

Code Examples

  1. Defining a simple workflow in Go:
func MyWorkflow(ctx workflow.Context, name string) (string, error) {
    greeting := "Hello, " + name + "!"
    return greeting, nil
}
  1. Starting a workflow execution:
workflowOptions := client.StartWorkflowOptions{
    ID:        "my-workflow-id",
    TaskQueue: "my-task-queue",
}
we, err := c.ExecuteWorkflow(context.Background(), workflowOptions, MyWorkflow, "World")
if err != nil {
    log.Fatalln("Unable to execute workflow", err)
}
  1. Defining an activity:
func MyActivity(ctx context.Context, input string) (string, error) {
    return "Activity result: " + input, nil
}
  1. Calling an activity from a workflow:
func WorkflowWithActivity(ctx workflow.Context, input string) (string, error) {
    var result string
    err := workflow.ExecuteActivity(ctx, MyActivity, input).Get(ctx, &result)
    if err != nil {
        return "", err
    }
    return result, nil
}

Getting Started

  1. Install the Temporal server (using Docker):
docker run --rm -p 7233:7233 temporalio/temporal:latest
  1. Install the Temporal CLI:
curl -sSf https://temporal.download/cli.sh | sh
  1. Create a new Go project and install the Temporal SDK:
go mod init myproject
go get go.temporal.io/sdk
  1. Write your first workflow and worker, then run them:
// worker.go
package main

import (
    "go.temporal.io/sdk/client"
    "go.temporal.io/sdk/worker"
)

func main() {
    c, err := client.NewClient(client.Options{})
    if err != nil {
        log.Fatalln("Unable to create client", err)
    }
    defer c.Close()

    w := worker.New(c, "my-task-queue", worker.Options{})
    w.RegisterWorkflow(MyWorkflow)
    
    err = w.Run(worker.InterruptCh())
    if err != nil {
        log.Fatalln("Unable to start worker", err)
    }
}

Competitor Comparisons

8,171

Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way.

Pros of Cadence

  • Longer history and more established in production environments
  • Larger community and ecosystem of tools/integrations
  • More comprehensive documentation and examples

Cons of Cadence

  • Less active development and slower release cycle
  • More complex setup and configuration process
  • Limited language support (primarily Go and Java)

Code Comparison

Cadence workflow definition:

func MyWorkflow(ctx workflow.Context, input string) error {
    activity := workflow.ExecuteActivity(ctx, MyActivity, input)
    var result string
    if err := activity.Get(ctx, &result); err != nil {
        return err
    }
    return nil
}

Temporal workflow definition:

func MyWorkflow(ctx workflow.Context, input string) error {
    var result string
    err := workflow.ExecuteActivity(ctx, MyActivity, input).Get(ctx, &result)
    if err != nil {
        return err
    }
    return nil
}

Both frameworks use similar concepts and syntax for defining workflows and activities. However, Temporal generally offers a more streamlined API and improved developer experience. Temporal also provides better support for multiple programming languages, including Go, Java, PHP, and TypeScript.

12,835

Conductor is a microservices orchestration engine.

Pros of Conductor

  • More mature project with longer history and wider adoption
  • Extensive documentation and community support
  • Flexible architecture supporting multiple languages and storage backends

Cons of Conductor

  • Steeper learning curve due to more complex architecture
  • Requires more infrastructure setup and maintenance
  • Less native support for some advanced workflow patterns

Code Comparison

Conductor workflow definition (JSON):

{
  "name": "example_workflow",
  "tasks": [
    {
      "name": "task_1",
      "taskReferenceName": "task_1",
      "type": "SIMPLE"
    },
    {
      "name": "task_2",
      "taskReferenceName": "task_2",
      "type": "SIMPLE"
    }
  ]
}

Temporal workflow definition (Go):

func ExampleWorkflow(ctx workflow.Context) error {
    err := workflow.ExecuteActivity(ctx, Activity1).Get(ctx, nil)
    if err != nil {
        return err
    }
    return workflow.ExecuteActivity(ctx, Activity2).Get(ctx, nil)
}

Both Conductor and Temporal offer powerful workflow orchestration capabilities, but they differ in their approach and implementation. Conductor uses a JSON-based workflow definition, while Temporal relies on code-based workflows. Temporal provides a more developer-friendly experience with better type safety and IDE support, while Conductor offers more flexibility in terms of supported languages and storage options.

36,173

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows

Pros of Airflow

  • Mature ecosystem with extensive community support and a wide range of integrations
  • Rich UI for monitoring, scheduling, and managing workflows
  • Flexible task dependencies and scheduling options

Cons of Airflow

  • Steeper learning curve, especially for complex workflows
  • Can be resource-intensive for large-scale deployments
  • Less robust support for long-running workflows and error handling

Code Comparison

Airflow DAG definition:

from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from datetime import datetime

def my_task():
    print("Hello, Airflow!")

dag = DAG('example_dag', start_date=datetime(2023, 1, 1), schedule_interval='@daily')
task = PythonOperator(task_id='my_task', python_callable=my_task, dag=dag)

Temporal workflow definition:

func MyWorkflow(ctx workflow.Context) error {
    logger := workflow.GetLogger(ctx)
    logger.Info("Hello, Temporal!")
    return nil
}

func main() {
    c, err := client.NewClient(client.Options{})
    if err != nil {
        log.Fatalln("Unable to create client", err)
    }
    defer c.Close()
    workflowOptions := client.StartWorkflowOptions{
        ID:        "my-workflow",
        TaskQueue: "my-task-queue",
    }
    _, err = c.ExecuteWorkflow(context.Background(), workflowOptions, MyWorkflow)
    if err != nil {
        log.Fatalln("Unable to execute workflow", err)
    }
}
15,793

Prefect is a workflow orchestration framework for building resilient data pipelines in Python.

Pros of Prefect

  • More lightweight and easier to get started with for simple workflows
  • Flexible task-based approach allows for more granular control over individual steps
  • Better integration with Python ecosystem and data science tools

Cons of Prefect

  • Less robust for long-running, mission-critical workflows
  • Lacks some advanced features like versioning and rollback capabilities
  • Smaller community and ecosystem compared to Temporal

Code Comparison

Prefect workflow:

@task
def fetch_data():
    return pd.read_csv("data.csv")

@task
def process_data(df):
    return df.groupby("category").sum()

@flow
def my_workflow():
    data = fetch_data()
    result = process_data(data)
    return result

Temporal workflow:

func MyWorkflow(ctx workflow.Context) error {
    var result string
    err := workflow.ExecuteActivity(ctx, FetchData).Get(ctx, &result)
    if err != nil {
        return err
    }
    err = workflow.ExecuteActivity(ctx, ProcessData, result).Get(ctx, &result)
    return err
}

Both Prefect and Temporal offer workflow orchestration capabilities, but they cater to different use cases and have distinct strengths. Prefect is more Python-centric and suitable for data-oriented tasks, while Temporal provides a more robust platform for complex, long-running workflows across multiple languages.

11,125

An orchestration platform for the development, production, and observation of data assets.

Pros of Dagster

  • More focused on data pipelines and ETL workflows
  • Provides a rich UI for monitoring and debugging data pipelines
  • Integrates well with popular data tools like Pandas, Spark, and dbt

Cons of Dagster

  • Less suitable for general-purpose workflow orchestration
  • Steeper learning curve for non-data-centric use cases
  • More limited in terms of long-running workflow support

Code Comparison

Dagster:

@op
def process_data(context, data):
    # Process data
    return processed_data

@job
def my_data_pipeline():
    process_data()

Temporal:

func ProcessData(ctx workflow.Context, data string) (string, error) {
    // Process data
    return processedData, nil
}

func MyWorkflow(ctx workflow.Context, input string) error {
    return workflow.ExecuteActivity(ctx, ProcessData, input).Get(ctx, nil)
}

Both frameworks offer ways to define and execute workflows, but Dagster's syntax is more tailored for data pipelines, while Temporal provides a more general-purpose workflow definition approach.

Workflow Engine for Kubernetes

Pros of Argo Workflows

  • Native Kubernetes integration, ideal for cloud-native environments
  • Strong support for data-driven and parallel workflows
  • Rich ecosystem of plugins and integrations

Cons of Argo Workflows

  • Limited support for long-running workflows
  • Less robust handling of complex business logic and state management
  • Steeper learning curve for non-Kubernetes users

Code Comparison

Argo Workflows (YAML):

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: hello-world-
spec:
  entrypoint: whalesay
  templates:
  - name: whalesay
    container:
      image: docker/whalesay
      command: [cowsay]
      args: ["hello world"]

Temporal (Go):

func Workflow(ctx workflow.Context) error {
    ctx = workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
        StartToCloseTimeout: time.Minute,
    })
    var result string
    err := workflow.ExecuteActivity(ctx, SayHello, "World").Get(ctx, &result)
    if err != nil {
        return err
    }
    logger.Info("Result", "value", result)
    return nil
}

Both Argo Workflows and Temporal offer powerful workflow orchestration capabilities, but they cater to different use cases. Argo Workflows excels in Kubernetes-native environments and data-processing pipelines, while Temporal provides more robust support for long-running, stateful workflows with complex business logic. The choice between them depends on your specific requirements and infrastructure preferences.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Build status Coverage Status Discourse Go Report Card

Temporal

Temporal is a durable execution platform that enables developers to build scalable applications without sacrificing productivity or reliability. The Temporal server executes units of application logic called Workflows in a resilient manner that automatically handles intermittent failures, and retries failed operations.

Temporal is a mature technology that originated as a fork of Uber's Cadence. It is developed by Temporal Technologies, a startup by the creators of Cadence.

image

Learn more:

Getting Started

Download and Start Temporal Server Locally

Execute the following commands to start a pre-built image along with all the dependencies.

brew install temporal
temporal server start-dev

Refer to Temporal CLI documentation for more installation options.

Run the Samples

Clone or download samples for Go or Java and run them with the local Temporal server. We have a number of HelloWorld type scenarios available, as well as more advanced ones. Note that the sets of samples are currently different between Go and Java.

Use CLI

Use Temporal CLI to interact with the running Temporal server.

temporal operator namespace list
temporal workflow list

Use Temporal Web UI

Try Temporal Web UI by opening http://localhost:8233 for viewing your sample workflows executing on Temporal.

Repository

This repository contains the source code of the Temporal server. To implement Workflows, Activities and Workers, use one of the supported languages.

Contributing

We'd love your help in making Temporal great. Please review the internal architecture docs.

See CONTRIBUTING.md for how to build and run the server locally, run tests, etc.

If you'd like to work on or propose a new feature, first peruse feature requests and our proposals repo to discover existing active and accepted proposals.

Feel free to join the Temporal community forum or Slack to start a discussion or check if a feature has already been discussed. Once you're sure the proposal is not covered elsewhere, please follow our proposal instructions or submit a feature request.

License

MIT License

NPM DownloadsLast 30 Days