Files
hatchet/pkg/client/create/tasks.go
T
abelanger5 c6abd6b9d2 feat: multiple workflow concurrency keys (#1511)
* feat: multiple workflow concurrency keys

* [Python]: Allow multiple workflow-level concurrency keys (#1512)

* chore: generate

* feat: multi concurrency

* chore: version

* feat: example + test

* fix: expand tests

* Feat  ts multiple wf concurrency (#1522)

* feat: multiple concurrency

* release: 1.2.0

* fix: merge

* fix: concurrency defn

* fix: ts multiple concurrency backwards compat (#1531)

* fix

* gen

* chore: lint

---------

Co-authored-by: mrkaye97 <mrkaye97@gmail.com>

---------

Co-authored-by: Gabe Ruttner <gabriel.ruttner@gmail.com>

* chore: ver

* chore: gen

* chore: versions

* fix: manually rename migration

* fix: patch ver

---------

Co-authored-by: mrkaye97 <mrkaye97@gmail.com>
Co-authored-by: Gabe Ruttner <gabriel.ruttner@gmail.com>
2025-04-14 17:29:17 -04:00

59 lines
1.8 KiB
Go

package create
import (
"time"
"github.com/hatchet-dev/hatchet/pkg/client/types"
)
// TaskDefaults defines default configuration values for tasks within a workflow.
type TaskDefaults struct {
// (optional) ExecutionTimeout specifies the maximum duration a task can run after starting before being terminated
ExecutionTimeout time.Duration
// (optional) ScheduleTimeout specifies the maximum time a task can wait in the queue to be scheduled
ScheduleTimeout time.Duration
// (optional) Retries defines the number of times to retry a failed task
Retries int32
// (optional) RetryBackoffFactor is the multiplier for increasing backoff between retries
RetryBackoffFactor float32
// (optional) RetryMaxBackoffSeconds is the maximum backoff duration in seconds between retries
RetryMaxBackoffSeconds int32
}
// WorkflowCreateOpts contains configuration options for creating a new workflow.
type WorkflowCreateOpts[I any] struct {
// (required) The friendly name of the workflow
Name string
// (optional) The version of the workflow
Version string
// (optional) The human-readable description of the workflow
Description string
// (optional) The event names that trigger the workflow
OnEvents []string
// (optional) The cron expressions for scheduled workflow runs
OnCron []string
// (optional) Concurrency settings to control parallel execution
Concurrency []types.Concurrency
// (optional) Strategy for sticky execution of workflow runs
StickyStrategy *types.StickyStrategy
// (optional) Default settings for all tasks within this workflow
TaskDefaults *TaskDefaults
// (optional) The key to use for the output of the workflow (i.e. the name of the fn where O is the output type)
OutputKey *string
// (optional) The default priority for tasks in this workflow
DefaultPriority *int32
}