Help us shape the future of Go! Take the 2026 Go Developer Survey

factory

package
v0.98.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 5 Imported by: 2

Documentation

Overview

Deprecated: This package is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

Deprecated: This package is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

Deprecated: This package is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDurableTask deprecated

func NewDurableTask[I, O any](opts create.StandaloneTask, fn func(ctx worker.DurableHatchetContext, input I) (*O, error), client v1.HatchetClient) workflow.WorkflowDeclaration[I, O]

Deprecated: NewDurableTask is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

NewDurableTask creates a durable task that is implemented as a simple workflow with a single task. It provides proper type inference for the input and output types.

Example:

type SimpleInput struct {
    Message string
}

type SimpleOutput struct {
    TransformedMessage string
}

simpleTask := v1.NewTask(v1.TaskCreateOpts[SimpleInput, SimpleOutput]{
    Name: "simple-task",
    Fn: func(input SimpleInput, ctx worker.DurableHatchetContext) (*SimpleOutput, error) {
        return &SimpleOutput{
            TransformedMessage: strings.ToLower(input.Message),
        }, nil
    },
}, &client)

func NewTask deprecated

func NewTask[I, O any](opts create.StandaloneTask, fn func(ctx worker.HatchetContext, input I) (*O, error), client v1.HatchetClient) workflow.WorkflowDeclaration[I, O]

Deprecated: NewTask is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

NewTask creates a standalone task that is implemented as a simple workflow with a single task. It provides proper type inference for the input and output types.

Example:

type SimpleInput struct {
    Message string
}

type SimpleOutput struct {
    TransformedMessage string
}

simpleTask := v1.NewTask(v1.TaskCreateOpts[SimpleInput, SimpleOutput]{
    Name: "simple-task",
    Fn: func(input SimpleInput, ctx worker.HatchetContext) (*SimpleOutput, error) {
        return &SimpleOutput{
            TransformedMessage: strings.ToLower(input.Message),
        }, nil
    },
}, &client)

func NewWorkflow deprecated

func NewWorkflow[I any, O any](opts create.WorkflowCreateOpts[I], client v1.HatchetClient) workflow.WorkflowDeclaration[I, O]

Deprecated: NewWorkflow is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL